CA-227272: Ignore unresolved VDIs first, then check if the storage mapping contains

the resolved ones and then try getting the target SR from the mapping.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2016-10-28 10:57:10 +01:00
parent 8b9985f894
commit c7994c286d

View File

@ -109,10 +109,15 @@ namespace XenAdmin.Actions.VMActions
if (!oldVBD.IsOwner)
continue;
SR sr = StorageMapping != null ? StorageMapping[oldVBD.VDI.opaque_ref] : null;
var curVdi = Connection.Resolve(oldVBD.VDI);
if (curVdi == null || sr == null || curVdi.SR.opaque_ref == sr.opaque_ref)
if (curVdi == null)
continue;
if (StorageMapping == null || !StorageMapping.ContainsKey(oldVBD.VDI.opaque_ref))
continue;
SR sr = StorageMapping[oldVBD.VDI.opaque_ref];
if (sr == null || curVdi.SR.opaque_ref == sr.opaque_ref)
continue;
RelatedTask = XenAPI.VDI.async_copy(Session, oldVBD.VDI.opaque_ref, sr.opaque_ref);