You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "shwstppr (via GitHub)" <gi...@apache.org> on 2023/03/06 06:29:13 UTC

[GitHub] [cloudstack] shwstppr opened a new pull request, #7312: storage: fix vmware volume cleanup failure

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

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

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


[GitHub] [cloudstack] shwstppr commented on pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1456337763

   @blueorangutan test centos7 vmware-67u3


-- 
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] nvazquez commented on pull request #7312: storage: fix vmware volume cleanup failure

Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1476673831

   @shwstppr is this PR still relevant for 4.17 or can be closed?


-- 
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] shwstppr commented on a diff in pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on code in PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#discussion_r1126079320


##########
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java:
##########
@@ -318,6 +319,35 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
         return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
     }
 
+    protected Host getVmwareHostFromVolumeToDelete(VolumeInfo volume) {
+        VirtualMachine vm = volume.getAttachedVM();
+        if (vm == null) {

Review Comment:
   Yes then the calling method code tries to find a host based on the storage at line 476 https://github.com/apache/cloudstack/pull/7312/files#diff-45668a1459e79e7705bb54a8f6e09d972a12ffe972b06b61468e06f4f8ce2c3dR476



-- 
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] shwstppr closed pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr closed pull request #7312: storage: fix vmware volume cleanup failure
URL: https://github.com/apache/cloudstack/pull/7312


-- 
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 #7312: storage: fix vmware volume cleanup failure

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1456089347

   @shwstppr 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] blueorangutan commented on pull request #7312: storage: fix vmware volume cleanup failure

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1456170004

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5682


-- 
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] shwstppr commented on pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1456087565

   Tested the fix with a 4.15.2.0 patch. DeleteCommand send to correct host in the source cluster
   
   @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] shwstppr commented on a diff in pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on code in PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#discussion_r1126080453


##########
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java:
##########
@@ -318,6 +319,35 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
         return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
     }
 
+    protected Host getVmwareHostFromVolumeToDelete(VolumeInfo volume) {
+        VirtualMachine vm = volume.getAttachedVM();
+        if (vm == null) {
+            return null;
+        }
+        Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId();
+        if (hostId == null) {
+            return null;
+        }
+        HostVO host = hostDao.findById(hostId);

Review Comment:
   It will try to find the host based on the storage pool of the volume at line 476, https://github.com/apache/cloudstack/pull/7312/files#diff-45668a1459e79e7705bb54a8f6e09d972a12ffe972b06b61468e06f4f8ce2c3dR476
   
   An option could be to completely remove the logic to try and find a host based on volume VM



-- 
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] shwstppr commented on pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1486193576

   @nvazquez cc @vladimirpetrov yes, we can close this. As per my update on this tagged issue, the problem is fixed with https://github.com/apache/cloudstack/pull/5575. ACS marks volume as detached once migration is complete and then deletion of source volume file is handled by an appropriate host.


-- 
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] shwstppr commented on pull request #7312: storage: fix vmware volume cleanup failure

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1463387349

   @vladimirpetrov probably update the wrong PR. Re-requesting your review


-- 
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] rohityadavcloud commented on a diff in pull request #7312: storage: fix vmware volume cleanup failure

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on code in PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#discussion_r1126046897


##########
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java:
##########
@@ -318,6 +319,35 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
         return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
     }
 
+    protected Host getVmwareHostFromVolumeToDelete(VolumeInfo volume) {
+        VirtualMachine vm = volume.getAttachedVM();
+        if (vm == null) {

Review Comment:
   If the volume isn't attached to a VM - would it be removed by GC (if not by this code) then?



##########
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java:
##########
@@ -318,6 +319,35 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
         return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
     }
 
+    protected Host getVmwareHostFromVolumeToDelete(VolumeInfo volume) {
+        VirtualMachine vm = volume.getAttachedVM();
+        if (vm == null) {
+            return null;
+        }
+        Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId();
+        if (hostId == null) {
+            return null;
+        }
+        HostVO host = hostDao.findById(hostId);

Review Comment:
   question - should we find host which has access to the storage pool (not always the vm's host ID or the last host ID?) to be responsible for deleting the volume?



-- 
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 #7312: storage: fix vmware volume cleanup failure

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1456339545

   @shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) 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 #7312: storage: fix vmware volume cleanup failure

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#issuecomment-1457436681

   <b>Trillian test result (tid-6265)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40762 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7312-t6265-vmware-67u3.zip
   Smoke tests completed. 99 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_04_deploy_vm_with_extraconfig_throws_exception_vmware | `Error` | 1.17 | test_deploy_vm_extra_config_data.py
   test_05_deploy_vm_with_extraconfig_vmware | `Error` | 1.14 | test_deploy_vm_extra_config_data.py
   test_01_deploy_vm_on_specific_host | `Error` | 4.31 | test_vm_deployment_planner.py
   test_02_deploy_vm_on_specific_cluster | `Error` | 0.12 | test_vm_deployment_planner.py
   test_03_deploy_vm_on_specific_pod | `Error` | 0.15 | test_vm_deployment_planner.py
   test_04_deploy_vm_on_host_override_pod_and_cluster | `Error` | 1.17 | test_vm_deployment_planner.py
   test_05_deploy_vm_on_cluster_override_pod | `Error` | 1.14 | test_vm_deployment_planner.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