Feature #1678: The sched treats uninitialized shared system DS as non-shared ones.

This commit is contained in:
Carlos Martín committed 2013-10-31 11:21:04 +01:00
1 parent d5ca7c3fc0
commit dfe2d0a6fe
3 files changed
+20 -3

No files matched your search

+12
View File
@@ -74,6 +74,16 @@ public:
return shared;
};
/**
* Returns true if the DS free_mb is not 0. Only for shared DS
* @return true if the DS is monitored
*/
bool is_monitored()
{
return monitored;
};
private:
int oid;
@@ -81,6 +91,8 @@ private:
long long free_mb; /**< Free disk for VMs (in MB). */
bool monitored;
bool shared;
static const char *ds_paths[]; /**< paths for search function */
+5
View File
@@ -38,6 +38,11 @@ void DatastoreXML::init_attributes()
cluster_id = atoi(((*this)["/DATASTORE/CLUSTER_ID"] )[0].c_str() );
free_mb = atoll(((*this)["/DATASTORE/FREE_MB"])[0].c_str());
long long total_mb = atoll(((*this)["/DATASTORE/TOTAL_MB"])[0].c_str());
long long used_mb = atoll(((*this)["/DATASTORE/USED_MB"])[0].c_str());
monitored = (free_mb != 0 || total_mb != 0 || used_mb != 0);
string shared_st;
this->xpath(shared_st, "/DATASTORE/TEMPLATE/SHARED", "YES");
+3 -3
View File
@@ -684,7 +684,7 @@ void Scheduler::match_schedule()
// Check datastore capacity
// -----------------------------------------------------------------
if (ds->is_shared())
if (ds->is_shared() && ds->is_monitored())
{
if (ds->test_capacity(vm_disk))
{
@@ -886,7 +886,7 @@ void Scheduler::dispatch()
if (!vm->is_resched())
{
if (ds->is_shared())
if (ds->is_shared() && ds->is_monitored())
{
test_cap_result = ds->test_capacity(dsk);
}
@@ -944,7 +944,7 @@ void Scheduler::dispatch()
// DS capacity is only added for new deployments, not for migrations
if (!vm->is_resched())
{
if (ds->is_shared())
if (ds->is_shared() && ds->is_monitored())
{
ds->add_capacity(dsk);
}