Skip to content

Commit 06c0486

Browse files
author
Mike Tutkowski
committed
CLOUDSTACK-6170 (VMware root-disk support for managed storage)
1 parent 2145522 commit 06c0486

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,13 @@ public Answer deleteVolume(DeleteCommand cmd) {
15851585

15861586
// let vmMo.destroy to delete volume for us
15871587
// vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
1588-
vmMo.destroy();
1588+
1589+
if (isManaged) {
1590+
vmMo.unregisterVm();
1591+
}
1592+
else {
1593+
vmMo.destroy();
1594+
}
15891595

15901596
// this.hostService.handleDatastoreAndVmdkDetach(iScsiName, storageHost, storagePort);
15911597
if (managedIqns != null && !managedIqns.isEmpty()) {

vmware-base/src/com/cloud/hypervisor/vmware/mo/BaseMO.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public String getName() throws Exception {
7070
return _name;
7171
}
7272

73+
public void unregisterVm() throws Exception {
74+
_context.getService().unregisterVM(_mor);
75+
}
76+
7377
public boolean destroy() throws Exception {
7478
ManagedObjectReference morTask = _context.getService().destroyTask(_mor);
7579

0 commit comments

Comments
 (0)