mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-8405: Restore VM results in deletion of data disk.
Dont evict template when a delete command has been sent to VMware resource for deletion of volume.
This commit is contained in:
parent
429296e7b7
commit
f45e6b94ed
@ -5145,7 +5145,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
||||
ClusterMO clusterMo = new ClusterMO(context, morCluster);
|
||||
|
||||
VirtualMachineMO vmMo = clusterMo.findVmOnHyperHost(vol.getPath());
|
||||
if (vmMo != null) {
|
||||
if (vmMo != null && vmMo.isTemplate()) {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Destroy template volume " + vol.getPath());
|
||||
}
|
||||
|
||||
@ -1695,17 +1695,6 @@ public class VmwareStorageProcessor implements StorageProcessor {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Destroy root volume directly from datastore");
|
||||
}
|
||||
} else {
|
||||
// evitTemplate will be converted into DestroyCommand, test if we are running in this case
|
||||
VirtualMachineMO vmMo = clusterMo.findVmOnHyperHost(vol.getPath());
|
||||
if (vmMo != null) {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Destroy template volume " + vol.getPath());
|
||||
}
|
||||
|
||||
vmMo.destroy();
|
||||
return new Answer(cmd, true, "Success");
|
||||
}
|
||||
}
|
||||
|
||||
VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, vol.getPath(), new DatacenterMO(context, morDc));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user