mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 12039, 12041: detach all disks before destroy worker VM to avoid accidentally delete the underlying disk along with the worker VM. Reviewed-by: Kelven
This commit is contained in:
parent
37908d2669
commit
67a2320001
@ -507,8 +507,10 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
|
||||
return new Ternary<String, Long, Long>(installPath + "/" + templateName + ".ova", size, size);
|
||||
|
||||
} finally {
|
||||
if(clonedVm != null)
|
||||
clonedVm.destroy();
|
||||
if(clonedVm != null) {
|
||||
clonedVm.detachAllDisks();
|
||||
clonedVm.destroy();
|
||||
}
|
||||
|
||||
vmMo.removeSnapshot(tmpSnapshotName, false);
|
||||
}
|
||||
@ -656,8 +658,10 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
|
||||
clonedVm.moveAllVmDiskFiles(primaryDsMo, "", false);
|
||||
clonedVm.detachAllDisks();
|
||||
} finally {
|
||||
if(clonedVm != null)
|
||||
clonedVm.destroy();
|
||||
if(clonedVm != null) {
|
||||
clonedVm.detachAllDisks();
|
||||
clonedVm.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user