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

F #2347: Fixes some bugs to VMGroups

This commit is contained in:
Ruben S. Montero 2017-01-05 00:32:14 +01:00
parent a6fc7b23cb
commit 20d10c7b12
2 changed files with 9 additions and 1 deletions

View File

@ -2949,7 +2949,7 @@ int VirtualMachine::get_vmgroup(string& error)
vmg_uid = get_uid();
}
vmgroup = vmgrouppool->get(gname, vmg_uid, true);
vmgroup = vmgrouppool->get(vmg_name, vmg_uid, true);
}
else if ( thegroup->vector_value("VMGROUP_ID", vmg_id) == 0 )
{

View File

@ -63,6 +63,12 @@ void VMGroupRole::del_vm(int vm_id)
void VMGroupRole::set_vms()
{
if ( vms.empty() )
{
va->remove("VMS");
return;
}
std::string vms_str = one_util::join(vms.begin(), vms.end(), ',');
va->replace("VMS", vms_str);
@ -521,6 +527,8 @@ int VMGroup::post_update_template(string& error)
return -1;
}
obj_template->erase("ROLE");
if ( check_affinity("AFFINED", error) == -1 )
{
return -1;