mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
B #4979: Remove OPENNEBULA_MANAGED in vm template clone (recursive)
(cherry picked from commit a84237a1dd
)
This commit is contained in:
parent
472ee2bccf
commit
34bc68017a
@ -129,6 +129,8 @@ protected:
|
||||
|
||||
return vm_instantiate.merge(tmpl, s_a, att);
|
||||
};
|
||||
|
||||
static const std::vector<const char*> REMOVE_DISK_ATTRS;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -119,6 +119,9 @@ Request::ErrorCode RequestManagerClone::clone(int source_id, const string &name,
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
const std::vector<const char*> VMTemplateClone::REMOVE_DISK_ATTRS = {
|
||||
"IMAGE", "IMAGE_UNAME", "IMAGE_UID", "OPENNEBULA_MANAGED"};
|
||||
|
||||
Request::ErrorCode VMTemplateClone::clone(int source_id, const string &name,
|
||||
int &new_id, bool recursive, const string& s_uattr, RequestAttributes& att)
|
||||
{
|
||||
@ -198,9 +201,10 @@ Request::ErrorCode VMTemplateClone::clone(int source_id, const string &name,
|
||||
goto error_images;
|
||||
}
|
||||
|
||||
(*disk)->remove("IMAGE");
|
||||
(*disk)->remove("IMAGE_UNAME");
|
||||
(*disk)->remove("IMAGE_UID");
|
||||
for (auto attr : REMOVE_DISK_ATTRS)
|
||||
{
|
||||
(*disk)->remove(attr);
|
||||
}
|
||||
|
||||
(*disk)->replace("IMAGE_ID", new_img_id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user