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

bug #2200: Number of VMS can be set in quota del operation. Prevents updating VMS_USED if set to 0 in

update

(cherry picked from commit df4d7db2adc989a72985a83b98f737b055c7cac7)
This commit is contained in:
Ruben S. Montero 2013-07-22 23:32:32 +02:00
parent 00e38376a9
commit 9d995f881a
2 changed files with 8 additions and 2 deletions

View File

@ -1295,6 +1295,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
deltas.add("MEMORY", dmemory);
deltas.add("CPU", dcpu);
deltas.add("VMS", 0);
switch (vm->get_state())
{

View File

@ -84,7 +84,7 @@ void QuotaVirtualMachine::del(Template * tmpl)
{
map<string, float> vm_request;
int memory;
int memory, vms;
float cpu;
if ( tmpl->get("MEMORY", memory) == false )
@ -97,7 +97,12 @@ void QuotaVirtualMachine::del(Template * tmpl)
cpu = 0;
}
vm_request.insert(make_pair("VMS",1));
if ( tmpl->get("VMS", vms) == false )
{
vms = 1;
}
vm_request.insert(make_pair("VMS", vms));
vm_request.insert(make_pair("MEMORY", memory));
vm_request.insert(make_pair("CPU", cpu));