mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Development: Fix intantiate as persistent with locked disks
This commit is contained in:
parent
ce01a9c039
commit
75ce8a3056
@ -598,6 +598,17 @@ void Image::disk_attribute(VirtualMachineDisk * disk,
|
||||
}
|
||||
}
|
||||
|
||||
//Image is being copied/cloned
|
||||
if ( state == Image::LOCKED_USED || state == Image::LOCKED_USED_PERS
|
||||
|| state == Image::LOCKED )
|
||||
{
|
||||
disk->replace("CLONING", "YES");
|
||||
}
|
||||
else
|
||||
{
|
||||
disk->remove("CLONING");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// TYPE attribute
|
||||
//--------------------------------------------------------------------------
|
||||
|
@ -400,12 +400,6 @@ int ImagePool::acquire_disk(int vm_id,
|
||||
(*snap)->set_disk_id(disk_id);
|
||||
}
|
||||
|
||||
if ( img->get_state() == Image::LOCKED_USED ||
|
||||
img->get_state() == Image::LOCKED_USED_PERS )
|
||||
{
|
||||
disk->replace("CLONING", "YES");
|
||||
}
|
||||
|
||||
img->unlock();
|
||||
|
||||
if ( ds_pool->disk_attribute(datastore_id, disk) == -1 )
|
||||
|
@ -215,7 +215,11 @@ Request::ErrorCode VMTemplateInstantiate::request_execute(int id, string name,
|
||||
tmpl_str);
|
||||
}
|
||||
|
||||
VirtualMachine::set_auth_request(att.uid, ar, tmpl, true);
|
||||
extended_tmpl = *tmpl;
|
||||
|
||||
VirtualMachineDisks::extended_info(att.uid, &extended_tmpl);
|
||||
|
||||
VirtualMachine::set_auth_request(att.uid, ar, &extended_tmpl, true);
|
||||
|
||||
if (UserPool::authorize(ar) == -1)
|
||||
{
|
||||
@ -225,10 +229,6 @@ Request::ErrorCode VMTemplateInstantiate::request_execute(int id, string name,
|
||||
return AUTHORIZATION;
|
||||
}
|
||||
|
||||
extended_tmpl = *tmpl;
|
||||
|
||||
VirtualMachineDisks::extended_info(att.uid, &extended_tmpl);
|
||||
|
||||
if (quota_authorization(&extended_tmpl, Quotas::VIRTUALMACHINE, att,
|
||||
att.resp_msg) == false)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user