1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

feature #687: The scheduler now loads the pool of users

This commit is contained in:
Ruben S. Montero 2011-07-03 04:16:35 +02:00
parent 72a26d476f
commit 9c46bb4131
5 changed files with 27 additions and 3 deletions

View File

@ -49,9 +49,9 @@ protected:
return get_nodes("/HOST_POOL/HOST[STATE<3]", content);
};
virtual void add_object(xmlNodePtr node);
void add_object(xmlNodePtr node);
virtual int load_info(xmlrpc_c::value &result);
int load_info(xmlrpc_c::value &result);
};
#endif /* HOST_POOL_XML_H_ */

View File

@ -53,7 +53,7 @@ public:
flush();
// -------------------------------------------------------------------------
// Load the ids (to get an updated list of hosts)
// Load the ids (to get an updated list of the pool)
// -------------------------------------------------------------------------
xmlrpc_c::value result;
@ -97,6 +97,8 @@ public:
add_object(nodes[i]);
}
free_nodes(nodes);
return 0;
};

View File

@ -18,6 +18,7 @@
#define SCHEDULER_H_
#include "Log.h"
#include "UserPoolXML.h"
#include "HostPoolXML.h"
#include "VirtualMachinePoolXML.h"
#include "SchedulerPolicy.h"
@ -48,6 +49,7 @@ protected:
int _machines_limit, int _dispatch_limit, int _host_dispatch_limit):
hpool(0),
vmpool(0),
upool(0),
timer(_timer),
url(_url),
machines_limit(_machines_limit),
@ -71,6 +73,11 @@ protected:
delete vmpool;
}
if ( upool != 0)
{
delete upool;
}
if ( client != 0)
{
delete client;
@ -83,6 +90,7 @@ protected:
HostPoolXML * hpool;
VirtualMachinePoolXML * vmpool;
UserPoolXML * upool;
// ---------------------------------------------------------------
// Scheduler Policies

View File

@ -21,6 +21,8 @@ Import('sched_env')
lib_name='scheduler_pool'
source_files=[
'UserPoolXML.cc',
'UserXML.cc',
'HostPoolXML.cc',
'HostXML.cc',
'VirtualMachinePoolXML.cc',

View File

@ -121,6 +121,7 @@ void Scheduler::start()
hpool = new HostPoolXML(client);
vmpool = new VirtualMachinePoolXML(client, machines_limit);
upool = new UserPoolXML(client);
// -----------------------------------------------------------
// Load scheduler policies
@ -228,6 +229,17 @@ int Scheduler::set_up_pools()
return rc;
}
//--------------------------------------------------------------------------
//Cleans the cache and get the pending VMs
//--------------------------------------------------------------------------
rc = upool->set_up();
if ( rc != 0 )
{
return rc;
}
//--------------------------------------------------------------------------
//Get the matching hosts for each VM
//--------------------------------------------------------------------------