1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-12 08:58:17 +03:00

feature #1798: Get rid of HYPERVISOR_MEM as resources can be now limited host or cluster-wise

This commit is contained in:
Ruben S. Montero 2014-03-04 12:02:08 +01:00
parent 7577d6d6b9
commit f8977e26c3
7 changed files with 2 additions and 43 deletions

View File

@ -22,9 +22,6 @@
#
# LIVE_RESCHEDS: Perform live (1) or cold migrations (0) when rescheduling a VM
#
# HYPERVISOR_MEM: Fraction of total MEMORY reserved for the hypervisor.
# E.g. 0.1 means that only 90% of the total MEMORY will be used
#
# DEFAULT_SCHED: Definition of the default scheduling algorithm
# - policy:
# 0 = Packing. Heuristic that minimizes the number of hosts in use by
@ -71,8 +68,6 @@ MAX_HOST = 1
LIVE_RESCHEDS = 0
HYPERVISOR_MEM = 0.1
DEFAULT_SCHED = [
policy = 1
]

View File

@ -28,10 +28,7 @@ class HostPoolXML : public PoolXML
{
public:
HostPoolXML(Client* client, float mem):PoolXML(client)
{
HostXML::set_hypervisor_mem(mem);
};
HostPoolXML(Client* client):PoolXML(client) {};
~HostPoolXML(){};

View File

@ -113,15 +113,6 @@ public:
*/
int search(const char *name, int& value);
/**
* Sets the memory fraction reserved for the hypervisor. This function
* should be called before using the host pool.
*/
static void set_hypervisor_mem(float mem)
{
hypervisor_mem = 1.0 - mem;
};
/**
* Checks if the host is a remote public cloud
* @return true if the host is a remote public cloud
@ -151,8 +142,6 @@ private:
bool public_cloud;
// Configuration attributes
static float hypervisor_mem; /**< Fraction of memory for the VMs */
static const char *host_paths[]; /**< paths for search function */
static int host_num_paths; /**< number of paths*/

View File

@ -60,7 +60,6 @@ protected:
machines_limit(0),
dispatch_limit(0),
host_dispatch_limit(0),
hypervisor_mem(0),
client(0)
{
am.addListener(this);
@ -171,11 +170,6 @@ private:
*/
unsigned int host_dispatch_limit;
/**
* Memory reserved for the hypervisor
*/
float hypervisor_mem;
/**
* OpenNebula zone id.
*/

View File

@ -22,9 +22,6 @@
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
float HostXML::hypervisor_mem;
int HostXML::host_num_paths = 4;
const char *HostXML::host_paths[] = {
@ -51,10 +48,6 @@ void HostXML::init_attributes()
running_vms = atoll(((*this)["/HOST/HOST_SHARE/RUNNING_VMS"])[0].c_str());
//Reserve memory for the hypervisor
max_mem = static_cast<int>(hypervisor_mem * static_cast<float>(max_mem));
public_cloud = false;
vector<string> public_cloud_vector = (*this)["/HOST/TEMPLATE/PUBLIC_CLOUD"];

View File

@ -122,8 +122,6 @@ void Scheduler::start()
conf.get("LIVE_RESCHEDS", live_rescheds);
conf.get("HYPERVISOR_MEM", hypervisor_mem);
// -----------------------------------------------------------
// Log system & Configuration File
// -----------------------------------------------------------
@ -285,7 +283,7 @@ void Scheduler::start()
// Pools
// -------------------------------------------------------------------------
hpool = new HostPoolXML(client, hypervisor_mem);
hpool = new HostPoolXML(client);
clpool = new ClusterPoolXML(client);
vmpool = new VirtualMachinePoolXML(client,machines_limit,(live_rescheds==1));

View File

@ -44,7 +44,6 @@ void SchedulerTemplate::set_conf_default()
# DEFAULT_SCHED
# DEFAULT_DS_SCHED
# LIVE_RESCHEDS
# HYPERVISOR_MEM
# LOG
#-------------------------------------------------------------------------------
*/
@ -104,12 +103,6 @@ void SchedulerTemplate::set_conf_default()
vattribute = new VectorAttribute("DEFAULT_DS_SCHED",vvalue);
conf_default.insert(make_pair(vattribute->name(),vattribute));
//HYPERVISOR_MEM
value = "0.1";
attribute = new SingleAttribute("HYPERVISOR_MEM",value);
conf_default.insert(make_pair(attribute->name(),attribute));
//LOG CONFIGURATION
vvalue.clear();
vvalue.insert(make_pair("SYSTEM","file"));