mirror of https://github.com/apache/cloudstack.git
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.
(cherry picked from commit f45e6b94ed)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
681d8c0518
commit
db379bf0e8
|
|
@ -5148,7 +5148,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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1679,17 +1679,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…
Reference in New Issue