weizhouapache opened a new pull request, #8570: URL: https://github.com/apache/cloudstack/pull/8570
### Description This PR fixes the issue below - Volumes are left over on datastore when restore a volume from backup and attach to another VM (more information below ) - unable to detach volume when restore backup and attach to vm then detach the volume (more infomation below) More information - Steps to reproduce the issue that Volumes are left over on datastore when restore a volume from backup and attach to another VM 1. create a VM (A) with ROOT and DATA disk 2. assign to a backup offering 3. create backup 4. create another VM (B) 5. restore the DATA disk of VM A, and attach to VM B 6. When operation is done, check the datastore Without this change, the ROOT image is not removed and left over on the datastore. ``` [root@ref-trl-5933-v-Mr8-wei-zhou-esxi2:/vmfs/volumes/5f60667d-18d828eb] ls -l /vmfs/volumes/5f60667d-18d828eb/CS-RSTR-dfb6f21c-a941-49db-9963-4f0286a17dac total 1784840 -rw------- 1 root root 5242880000 Jan 24 09:23 ROOT-722_2-flat.vmdk -rw------- 1 root root 499 Jan 24 09:23 ROOT-722_2.vmdk ``` With this change, the whole temporary vm has been destroyed. ``` [root@ref-trl-5933-v-Mr8-wei-zhou-esxi2:/vmfs/volumes/5f60667d-18d828eb] ls -l /vmfs/volumes/5f60667d-18d828eb/CS-RSTR-734bee3b-640c-4ff0-a34b-bc45358565b2 ls: /vmfs/volumes/5f60667d-18d828eb/CS-RSTR-734bee3b-640c-4ff0-a34b-bc45358565b2: No such file or directory ``` - Steps to reproduce the issue that unable to detach volume when restore backup and attach to vm then detach the volume 1. create a VM (A) with ROOT and DATA disk 2. assign to a backup offering 3. create backup 4. create another VM (B) 5. restore the DATA disk of VM A, and attach to VM B 6. detach the new Volume from VM B ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
