CP-10824: Supp Pack installation through XenCenter: Add other_config entry for the temporary VDI

- add an entry in the VDI's other_config to identify it as supp pack iso, so that we can easily find these vdis and remove if needed

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2015-01-27 11:00:35 +00:00
parent 23eabb23d9
commit a6b58acbd2

View File

@ -63,6 +63,7 @@ namespace XenAdmin.Actions
ApiMethodsToRoleCheck.Add("VDI.create");
ApiMethodsToRoleCheck.Add("VDI.destroy");
ApiMethodsToRoleCheck.Add("VDI.set_other_config");
ApiMethodsToRoleCheck.Add("http/put_import_raw_vdi");
Host = master;
@ -150,6 +151,15 @@ namespace XenAdmin.Actions
throw;
}
// mark the vdi as being a temporary supp pack iso
vdi = Connection.Resolve(vdiRef);
if (vdi != null)
{
var otherConfig = new Dictionary<string, string>(vdi.other_config);
otherConfig["supp_pack_iso"] = "true";
VDI.set_other_config(Session, vdiRef, otherConfig);
}
if (localStorageHost != null)
VdiRefs.Add(localStorageHost, vdiRef);
else // shared SR