-
Notifications
You must be signed in to change notification settings - Fork 1.3k
vmware: fix stopped VM volume migration #4758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
80f9b4c
54ef6e7
7cc6b6e
ee6aacd
db2363d
e172623
691ca70
9973e57
2356894
80fdcbd
28ae509
79bb82c
b5bbe9f
5d685a9
1fdc825
5e89cb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,11 +34,6 @@ | |
| import java.util.concurrent.Executors; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import com.cloud.hypervisor.vmware.mo.VirtualStorageObjectManagerMO; | ||
| import com.cloud.hypervisor.vmware.mo.VirtualMachineDiskInfoBuilder; | ||
| import com.vmware.vim25.BaseConfigInfoDiskFileBackingInfo; | ||
| import com.vmware.vim25.VStorageObject; | ||
| import com.vmware.vim25.VirtualDiskType; | ||
| import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand; | ||
| import org.apache.cloudstack.storage.command.AttachAnswer; | ||
| import org.apache.cloudstack.storage.command.AttachCommand; | ||
|
|
@@ -84,7 +79,9 @@ | |
| import com.cloud.hypervisor.vmware.mo.HostStorageSystemMO; | ||
| import com.cloud.hypervisor.vmware.mo.HypervisorHostHelper; | ||
| import com.cloud.hypervisor.vmware.mo.NetworkDetails; | ||
| import com.cloud.hypervisor.vmware.mo.VirtualMachineDiskInfoBuilder; | ||
| import com.cloud.hypervisor.vmware.mo.VirtualMachineMO; | ||
| import com.cloud.hypervisor.vmware.mo.VirtualStorageObjectManagerMO; | ||
| import com.cloud.hypervisor.vmware.mo.VmwareHypervisorHost; | ||
| import com.cloud.hypervisor.vmware.resource.VmwareResource; | ||
| import com.cloud.hypervisor.vmware.util.VmwareContext; | ||
|
|
@@ -104,6 +101,7 @@ | |
| import com.cloud.vm.VmDetailConstants; | ||
| import com.google.common.base.Strings; | ||
| import com.google.gson.Gson; | ||
| import com.vmware.vim25.BaseConfigInfoDiskFileBackingInfo; | ||
| import com.vmware.vim25.DatastoreHostMount; | ||
| import com.vmware.vim25.HostHostBusAdapter; | ||
| import com.vmware.vim25.HostInternetScsiHba; | ||
|
|
@@ -122,11 +120,13 @@ | |
| import com.vmware.vim25.HostUnresolvedVmfsVolume; | ||
| import com.vmware.vim25.InvalidStateFaultMsg; | ||
| import com.vmware.vim25.ManagedObjectReference; | ||
| import com.vmware.vim25.VStorageObject; | ||
| import com.vmware.vim25.VirtualDeviceBackingInfo; | ||
| import com.vmware.vim25.VirtualDeviceConfigSpec; | ||
| import com.vmware.vim25.VirtualDeviceConfigSpecOperation; | ||
| import com.vmware.vim25.VirtualDisk; | ||
| import com.vmware.vim25.VirtualDiskFlatVer2BackingInfo; | ||
| import com.vmware.vim25.VirtualDiskType; | ||
| import com.vmware.vim25.VirtualMachineConfigSpec; | ||
| import com.vmware.vim25.VmConfigInfo; | ||
| import com.vmware.vim25.VmfsDatastoreExpandSpec; | ||
|
|
@@ -2683,15 +2683,14 @@ public Answer deleteVolume(DeleteCommand cmd) { | |
| List<VirtualDisk> virtualDisks = vmMo.getVirtualDisks(); | ||
| List<String> managedDatastoreNames = getManagedDatastoreNamesFromVirtualDisks(virtualDisks); | ||
|
|
||
| // Preserve other disks of the VM | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for these changes @shwstppr.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @harikrishna-patnala I've verified the destroy case and have seen any issue. |
||
| List<String> detachedDisks = vmMo.detachAllDisksExcept(vol.getPath(), diskInfo != null ? diskInfo.getDiskDeviceBusName() : null); | ||
| VmwareStorageLayoutHelper.moveVolumeToRootFolder(new DatacenterMO(context, morDc), detachedDisks); | ||
| // let vmMo.destroy to delete volume for us | ||
| // vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class }); | ||
|
|
||
| if (isManaged) { | ||
| List<String> detachedDisks = vmMo.detachAllDisksExcept(vol.getPath(), diskInfo != null ? diskInfo.getDiskDeviceBusName() : null); | ||
| VmwareStorageLayoutHelper.moveVolumeToRootFolder(new DatacenterMO(context, morDc), detachedDisks); | ||
| vmMo.unregisterVm(); | ||
| } | ||
| else { | ||
| } else { | ||
| vmMo.destroy(); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.