cloudstack
cloudstack copied to clipboard
Inserts timer in check detach volume
Description
When detaching a volume, if the volume is in use inside the VM, the hypervisor waits until it is possible to execute the task. This waiting period causes ACS to interpret that the disk could not be removed and presents an error message to the user. This behavior can generate inconsistencies, because the volume detach is performed, but the ACS does not identify this information. If the user requests the volume detach again, a new error message is presented, saying that the volume in question is not contained in the target instance.
To work around the situation, the wait.detach.device property was created in the agent.properties file. It determines, in milliseconds, the time ACS will wait before considering the detach command to have failed. The default value of this property is 10000 (10 seconds).
Also, changes have been made so that an exception is not thrown when the user tries to remove a volume that is no longer contained in the VM. That way, if the detach command fails to extrapolate the time configured by the wait.detach.device property, but the volume is still removed from the instance by the hypervisor, the user can later remove it via the UI, without having to stop the VM to perform this procedure.
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
Feature/Enhancement Scale
- [ ] Major
- [x] Minor
How Has This Been Tested?
Hi @RodrigoDLopez Can this detach wait time passed through detach cmd (DettachCommand) and handle the timeout in resource layer, later this might be useful to extend to other hypervisors if needed.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@RodrigoDLopez can you look at the comment and the conflicts?
Found UI changes, kicking a new UI QA build @blueorangutan ui
@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
@RodrigoDLopez can you look at the comment and the conflicts?
Sorry for the delay @daan. Now the wait.detach.device value is configurable via global settings as suggested by @sureshanaparti. And changed the signature of the methods to void. Thus, it is not necessary to return null.
UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6508 (SL-JID-2439)
Codecov Report
Merging #6508 (648f8e2) into main (48ffa5d) will increase coverage by
0.03%. The diff coverage is3.33%.
@@ Coverage Diff @@
## main #6508 +/- ##
============================================
+ Coverage 10.84% 10.87% +0.03%
- Complexity 7097 7117 +20
============================================
Files 2485 2485
Lines 245366 245531 +165
Branches 38318 38336 +18
============================================
+ Hits 26606 26701 +95
- Misses 215491 215560 +69
- Partials 3269 3270 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...om/cloud/storage/dao/GuestOSHypervisorDaoImpl.java | 32.25% <0.00%> (-0.36%) |
:arrow_down: |
| ...storage/image/deployasis/DeployAsIsHelperImpl.java | 13.26% <0.00%> (-0.21%) |
:arrow_down: |
| ...ain/java/com/cloud/network/vpc/VpcManagerImpl.java | 4.12% <0.00%> (-0.01%) |
:arrow_down: |
| ...ud/hypervisor/kvm/storage/KVMStorageProcessor.java | 4.99% <2.08%> (-0.01%) |
:arrow_down: |
| ...n/java/com/cloud/storage/VolumeApiServiceImpl.java | 12.90% <33.33%> (+0.03%) |
:arrow_up: |
| .../org/apache/cloudstack/quota/QuotaManagerImpl.java | 44.92% <0.00%> (-1.08%) |
:arrow_down: |
| ...n/java/com/cloud/vm/VirtualMachineProfileImpl.java | 36.44% <0.00%> (-0.70%) |
:arrow_down: |
| ...torage/allocator/AbstractStoragePoolAllocator.java | 8.88% <0.00%> (-0.16%) |
:arrow_down: |
| ...ava/com/cloud/api/query/dao/VolumeJoinDaoImpl.java | 5.78% <0.00%> (-0.07%) |
:arrow_down: |
| ...dstack/storage/datastore/PrimaryDataStoreImpl.java | 2.23% <0.00%> (-0.02%) |
:arrow_down: |
| ... and 13 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
@blueorangutan package
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4419
@blueorangutan test
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
Trillian Build Failed (tid-5104)
Trillian Build Failed (tid-5104)
Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 4450
Found UI changes, kicking a new UI QA build @blueorangutan ui
@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6508 (SL-JID-2496)
@blueorangutan package
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4465
@blueorangutan test
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
Trillian Build Failed (tid-5166)
Trillian Build Failed (tid-5168)
Trillian Build Failed (tid-5172)
@RodrigoDLopez can you rebase this one on latest main. I see software version discrepancies in the systemvms
@blueorangutan package
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.