mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F #2228: Fixed bug with Chown action and running quotas
This commit is contained in:
parent
da81bb7701
commit
912359bafc
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user