Inserts timer in check detach volume#6508
Conversation
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
|
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. |
JoaoJandre
left a comment
There was a problem hiding this comment.
I agree with Daan that the attachOrDetachDevice method should be void. Apart from that, CLGTM.
|
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 |
|
@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
Sorry for the delay @daan. Now the |
|
UI build: ✔️ |
Codecov Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
DaanHoogland
left a comment
There was a problem hiding this comment.
some sonar cloud comments, @RodrigoDLopez . I think we are about ready with this.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Show resolved
Hide resolved
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
Outdated
Show resolved
Hide resolved
|
@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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ 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) |
1 similar comment
|
Trillian Build Failed (tid-5104) |
|
@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. |
|
SonarCloud Quality Gate failed. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4547 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
This PR will only address Volume detach with delay. As we do not have a use case for applying a delay in the ISO detach process, we will not extend it right now; however, if the community presents a solid use case, we can address it in a new issue/PR. |
|
Trillian test result (tid-5199)
|
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
Outdated
Show resolved
Hide resolved
|
@RodrigoDLopez will you apply @stephankruggg 's sugestions? |
|
@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. |
address Stephan reviews Co-authored-by: Stephan Krug <stekrug@icloud.com>
|
@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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4732 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-5345)
|
@RodrigoDLopez can you add a test scenario to the description? |
I'm a bit confused @RodrigoDLopez . are you mixing two test scenarios in this description, one of which does not apply to this PR? |
I am so sorry @DaanHoogland. I mixed up two of my open PRs. I updated this test scenario description. Again, sorry about that. |
perfectly understandable, no problem, can happen. |









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.deviceglobal configuration was created. 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, 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
Feature/Enhancement Scale
How Has This Been Tested?
A value was defined in the
wait.detach.deviceconfiguration, after that we sent thedetachVolumecommand. By watching the Agent log we could see if the command was successful or if the volume was busy during thedetachVolume; if the Volume was busy, we will wait for the value defined inwait.detach.devicebefore assuming that ACS failed to detach the Volume and then we will notify the operators that the volume could not be detached with the message: "Could not detach volume after sending the command and waiting for [wait.detach.devicevalue] milliseconds. Probably the VM does not support the sent detach command or the device is busy at the moment. Try again in a couple of minutes.". Otherwise, the successful message will be shown to notify that the volume was successfully detached.