You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/11/09 19:08:26 UTC

[GitHub] [cloudstack] mprokopchuk opened a new pull request, #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

mprokopchuk opened a new pull request, #6891:
URL: https://github.com/apache/cloudstack/pull/6891

   ### Description
   
   VOLUME.DETACH, created during VM removal, has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.
   Steps to reproduce:
   
   1. Create Volume
   2. Create VM
   3. Attach Volume to VM
   4. Delete VM
   5. Check Volume events page, VOLUME.DETACH is missing there
   6. Check Events page, VOLUME.DETACH available, but has description "Vm Id: XXX" and resource is VM instead of Volume
   
   The root cause: @actionevent uses CallContext information for event details, and in this case CallContext contains VM information.
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### 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
   - [X] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   Before this change (see VOLUME.DETACH event):
   <img width="1506" alt="190269757-1b163476-88fd-47cb-8cb7-20a4cf629ab9" src="https://user-images.githubusercontent.com/742444/200919104-234f9821-e5a3-48ce-acba-e6c1cc256364.png">
   After this change:
   <img width="1514" alt="190269816-d91381b7-4a89-429b-9b38-8e9826e24562" src="https://user-images.githubusercontent.com/742444/200919179-6ab89237-0dcc-4d51-b57d-1f562f5ce60e.png">
   <img width="1513" alt="190269867-bc9d069b-9c3d-4b1a-a4c7-d65f9961a8c1" src="https://user-images.githubusercontent.com/742444/200919263-c7dbd650-2fca-456b-b889-29eac14210dd.png">
   
   
   ### How Has This Been Tested?
   Tested manually.
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1310012026

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. LL-JID 243


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1310235193

   @blueorangutan test


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland merged pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
DaanHoogland merged PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1309958981

   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] codecov[bot] commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1309315206

   # [Codecov](https://codecov.io/gh/apache/cloudstack/pull/6891?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#6891](https://codecov.io/gh/apache/cloudstack/pull/6891?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (71b773c) into [main](https://codecov.io/gh/apache/cloudstack/commit/1843632c24daf4767249c04249a6c37c224f6e87?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1843632) will **decrease** coverage by `0.00%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #6891      +/-   ##
   ============================================
   - Coverage     10.87%   10.87%   -0.01%     
   + Complexity     7117     7115       -2     
   ============================================
     Files          2485     2485              
     Lines        245499   245507       +8     
     Branches      38334    38334              
   ============================================
   - Hits          26699    26695       -4     
   - Misses       215530   215543      +13     
   + Partials       3270     3269       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cloudstack/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../src/main/java/com/cloud/vm/UserVmManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL3ZtL1VzZXJWbU1hbmFnZXJJbXBsLmphdmE=) | `6.71% <0.00%> (-0.02%)` | :arrow_down: |
   | [...dstack/network/contrail/model/ModelObjectBase.java](https://codecov.io/gh/apache/cloudstack/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9uZXR3b3JrLWVsZW1lbnRzL2p1bmlwZXItY29udHJhaWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Nsb3Vkc3RhY2svbmV0d29yay9jb250cmFpbC9tb2RlbC9Nb2RlbE9iamVjdEJhc2UuamF2YQ==) | `21.15% <0.00%> (-7.70%)` | :arrow_down: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on code in PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#discussion_r1018805029


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -8062,8 +8062,22 @@ private void validateVolumes(List<VolumeVO> volumes) {
     private void detachVolumesFromVm(List<VolumeVO> volumes) {
 
         for (VolumeVO volume : volumes) {
-
-            Volume detachResult = _volumeService.detachVolumeViaDestroyVM(volume.getInstanceId(), volume.getId());
+            CallContext vmContext = CallContext.current();
+            // Create new context and inject correct event resource type, id and details,
+            // otherwise VOLUME.DETACH event will be associated with VirtualMachine and contain VM id and other information.
+            CallContext volumeContext = CallContext.register(vmContext.getCallingUserId(), vmContext.getCallingAccountId());
+            volumeContext.setEventDetails("Volume Id: " + this._uuidMgr.getUuid(Volume.class, volume.getId()) + " Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, volume.getInstanceId()));
+            volumeContext.setEventResourceType(ApiCommandResourceType.Volume);
+            volumeContext.setEventResourceId(volume.getId());
+            volumeContext.setStartEventId(vmContext.getStartEventId());

Review Comment:
   this comment looks like it should be in the javadoc description of this method



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1310236335

   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1311066716

   <b>Trillian test result (tid-62)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 39550 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6891-t62-kvm-centos7.zip
   Smoke tests completed. 103 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_redundant_vpc_site2site_vpn | `Failure` | 750.30 | test_vpc_vpn.py
   test_01_vpc_site2site_vpn_multiple_options | `Error` | 1268.24 | test_vpc_vpn.py
   test_01_vpc_site2site_vpn | `Error` | 548.57 | test_vpc_vpn.py
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1309959659

   @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.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1309312255

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=6891)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6891&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6891&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6891&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6891&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6891&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6891&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6891&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6891&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1312699746

   fix for the vpc_vpn tests in #6512 , merging


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] mprokopchuk commented on pull request #6891: VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description.

Posted by GitBox <gi...@apache.org>.
mprokopchuk commented on PR #6891:
URL: https://github.com/apache/cloudstack/pull/6891#issuecomment-1332790936

   Thank you!


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org