Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ protected StartAnswer execute(StartCommand cmd) {
throw new Exception("Failed to find the newly create or relocated VM. vmName: " + vmInternalCSName);
}
}
if (deployAsIs) {
if (deployAsIs && !vmMo.hasSnapshot()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems right to me as I see some other calls of tearDownVmDevices() method before this call which does handle snapshot existance.
https://github.com/shapeblue/cloudstack/blob/78e07cff62dd98d9b88852a47407e80fa57537d2/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L2826-L2834

private void tearDownVmDevices(VirtualMachineMO vmMo, boolean hasSnapshot, boolean deployAsIs) throws Exception {
    if (deployAsIs) {
        vmMo.tearDownDevices(new Class<?>[]{VirtualEthernetCard.class});
    } else if (!hasSnapshot) {
        vmMo.tearDownDevices(new Class<?>[]{VirtualDisk.class, VirtualEthernetCard.class});
    } else {
        vmMo.tearDownDevices(new Class<?>[]{VirtualEthernetCard.class});
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @harikrishna-patnala
It looks consistent with this pr.

I got the error on vcenter: " Invalid configuration for device '0'. Cannot remove virtual disk from the virtual machine because it or one of its parent disks is part of a snapshot of the virtual machine."
it seems to be a known restriction that disk cannot be removed from vm with snapshot.

s_logger.info("Mapping VM disks to spec disks and tearing down datadisks (if any)");
mapSpecDisksToClonedDisksAndTearDownDatadisks(vmMo, vmInternalCSName, specDisks);
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.