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:
Likitha Shetty 2015-03-12 14:32:58 +05:30 committed by Sanjay Tripathi
parent 429296e7b7
commit f45e6b94ed
2 changed files with 1 additions and 12 deletions

View File

@ -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());
}

View File

@ -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));