vmware: do not tear down vm disks if deploy-as-is vm has vm snapshots (#9243)

This commit is contained in:
Wei Zhou 2024-06-18 08:28:20 +02:00 committed by GitHub
parent 7e71e50578
commit f360f7048d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2203,7 +2203,7 @@ public class VmwareResource extends ServerResourceBase implements StoragePoolRes
throw new Exception("Failed to find the newly create or relocated VM. vmName: " + vmInternalCSName); throw new Exception("Failed to find the newly create or relocated VM. vmName: " + vmInternalCSName);
} }
} }
if (deployAsIs) { if (deployAsIs && !vmMo.hasSnapshot()) {
s_logger.info("Mapping VM disks to spec disks and tearing down datadisks (if any)"); s_logger.info("Mapping VM disks to spec disks and tearing down datadisks (if any)");
mapSpecDisksToClonedDisksAndTearDownDatadisks(vmMo, vmInternalCSName, specDisks); mapSpecDisksToClonedDisksAndTearDownDatadisks(vmMo, vmInternalCSName, specDisks);
} }