mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-15 17:23:10 +09:00
Feature #2494: The scheduler looks for LIMIT_MB in DS template
This commit is contained in:
1 parent
9eba97912c
commit
2d2f7c9d41
1 file changed
+13
@@ -43,6 +43,19 @@ void DatastoreXML::init_attributes()
|
||||
|
||||
monitored = (free_mb != 0 || total_mb != 0 || used_mb != 0);
|
||||
|
||||
vector<string> strings = ((*this)["/DATASTORE/TEMPLATE/LIMIT_MB"]);
|
||||
|
||||
if (!strings.empty())
|
||||
{
|
||||
long long limit_mb = atoll(strings[0].c_str());
|
||||
long long free_limited = limit_mb - (total_mb - free_mb);
|
||||
|
||||
if (free_limited < free_mb)
|
||||
{
|
||||
free_mb = free_limited;
|
||||
}
|
||||
}
|
||||
|
||||
string shared_st;
|
||||
this->xpath(shared_st, "/DATASTORE/TEMPLATE/SHARED", "YES");
|
||||
|
||||
|
||||
Reference in new issue
Block a user