harikrishna-patnala commented on pull request #4493:
URL: https://github.com/apache/cloudstack/pull/4493#issuecomment-732651497
@PaulAngus @weizhouapache
We have not changed anything related to existing behaviour of detach or
delete of volumes during the destroy and recover VM. We are trying to fix the
issue to keep the same behaviour as before.
Disks will still remain attached to VM when VM is destroyed (not expunged),
when VM actually gets expunged then the disks will be detached from VM.
I'll quickly explain about the previous behaviour of destroy and recover VM,
then what is the regression caused and how is this PR addressing that issue.
**Existing behaviour:**
1. When destroy VM without expunge and when no data disk is selected for
deletion
- VM is stopped and data disks will still shown as attached to original
VM
- When tried to recover the VM, the VM is made ready along with its data
disks as before.
2. When destroy VM without expunge and when one or more data disks are
selected for deletion
- VM is stopped and data disks which are selected for deletion will be
deleted and other data disks will still remain attached
- When tried to recover the VM, the VM is made ready along with
remaining data disks which are not deleted
3. When destroy VM with expunge and when no data disk is selected for
deletion
- All data disks are detached from VM
- VM will be destroyed and expunged completely
4. When destroy VM with expunge and few data disks are selected for deletion
- Data disks marked for deletion are deleted and the remaining disks are
detached from VM
- VM will be destroyed and expunged completely.
**What is the issue and what caused the regression:**
The issue is when VM is tried to recover, VM comes up only with root disk.
Data disks are detached from the VM during destroy (which is not supposed to be
as per the expected behaviour)
During the new changes of VMware vSphere from PR 4307, we had to reconcile
the disks location into CloudStack based on the actual location in storage. (It
can happen that disks can be moved across datastores in a datastore cluster,
this has to be reconciled in CloudStack during detach of Volumes from
CloudStack).
To address this, a clean detach of volumes is performed from service layers
(previously it used to be from VMware resource layer).
This detach has to be done during VM expunge but I did it during VM destroy
which caused the issue now.
**Fix:**
so now we are detaching of the volumes logic during VM expunge operation
which is original behaviour.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]