1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #2228: Fixed bug with Chown action and running quotas

(cherry picked from commit 912359bafc8b02b27f2a9d218c18bb6f61f670e5)
This commit is contained in:
juanmont 2018-09-07 12:36:14 +02:00 committed by Ruben S. Montero
parent a3ac445f7e
commit 7be6e601f0

View File

@ -37,6 +37,8 @@ PoolObjectSQL * RequestManagerChown::get_and_quota(
int old_uid;
int old_gid;
std::string memory, cpu;
PoolObjectSQL * object;
object = pool->get(oid);
@ -66,6 +68,20 @@ PoolObjectSQL * RequestManagerChown::get_and_quota(
Template * tmpl = vm->clone_template();
if ( (vm->get_state() == VirtualMachine::ACTIVE) ||
(vm->get_state() == VirtualMachine::PENDING) ||
(vm->get_state() == VirtualMachine::CLONING) ||
(vm->get_state() == VirtualMachine::CLONING_FAILURE) ||
(vm->get_state() == VirtualMachine::HOLD) )
{
vm->get_template_attribute("MEMORY", memory);
vm->get_template_attribute("CPU", cpu);
tmpl->add("RUNNING_MEMORY", memory);
tmpl->add("RUNNING_CPU", cpu);
tmpl->add("RUNNING_VMS", 1);
}
quota_map.insert(make_pair(Quotas::VIRTUALMACHINE, tmpl));
VirtualMachineDisks::image_ds_quotas(tmpl, ds_quotas);