mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Merge pull request #1249 from kc284/master2
Avoid KeyNotFoundException when moving VMs with unresolved VDIs
This commit is contained in:
commit
f8274705c9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user