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 2021/02/02 07:22:14 UTC

[GitHub] [cloudstack] shwstppr opened a new pull request #4638: server: fix root disk size on vm reset

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


   ### Description
   
   On resize of ROOT volume add detail in the VM for `rootdisksize` which will allow resizing root disk when VM reset is performed.
   
   Fixes #3957 
   
   ### 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):
   
   
   ### 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/master/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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: debian. SL-JID 371


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

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-810757024


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

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4638: server: fix root disk size on vm reset

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


   @shwstppr (cc @Spaceman1984 ) the consensus so far is to revert to the template including the template root size disk. making it optional is outside of this scope.


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


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

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



[GitHub] [cloudstack] shwstppr commented on a change in pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
shwstppr commented on a change in pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#discussion_r610588460



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -6678,6 +6678,12 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final
                 newVol = volumeMgr.allocateDuplicateVolume(root, null);
             }
 
+            if (userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.ROOT_DISK_SIZE) == null && !newVol.getSize().equals(template.getSize())) {
+                VolumeVO resizedVolume = (VolumeVO) newVol;
+                resizedVolume.setSize(template.getSize());
+                _volsDao.update(resizedVolume.getId(), resizedVolume);
+            }
+
             // 1. Save usage event and update resource count for user vm volumes
             _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.volume, newVol.isDisplay());
             _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.primary_storage, newVol.isDisplay(), new Long(newVol.getSize()));

Review comment:
       @sureshanaparti same object is been cast to VolumeVO and size is updated  at 6682-6683. `newVol` will return the updated size




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

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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#discussion_r611013729



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -6678,6 +6678,12 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final
                 newVol = volumeMgr.allocateDuplicateVolume(root, null);
             }
 
+            if (userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.ROOT_DISK_SIZE) == null && !newVol.getSize().equals(template.getSize())) {
+                VolumeVO resizedVolume = (VolumeVO) newVol;
+                resizedVolume.setSize(template.getSize());
+                _volsDao.update(resizedVolume.getId(), resizedVolume);

Review comment:
       I missed this comment, if we need to address anything additional pl raise a new PR @shwstppr @sureshanaparti 




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

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



[GitHub] [cloudstack] shwstppr commented on a change in pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
shwstppr commented on a change in pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#discussion_r610589014



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -6678,6 +6678,12 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final
                 newVol = volumeMgr.allocateDuplicateVolume(root, null);
             }
 
+            if (userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.ROOT_DISK_SIZE) == null && !newVol.getSize().equals(template.getSize())) {
+                VolumeVO resizedVolume = (VolumeVO) newVol;
+                resizedVolume.setSize(template.getSize());
+                _volsDao.update(resizedVolume.getId(), resizedVolume);

Review comment:
       @sureshanaparti Duplicating using template, won't that affect other existing values of the entry - folder, path, etc?




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

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



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#discussion_r610543254



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -6678,6 +6678,12 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final
                 newVol = volumeMgr.allocateDuplicateVolume(root, null);
             }
 
+            if (userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.ROOT_DISK_SIZE) == null && !newVol.getSize().equals(template.getSize())) {
+                VolumeVO resizedVolume = (VolumeVO) newVol;
+                resizedVolume.setSize(template.getSize());
+                _volsDao.update(resizedVolume.getId(), resizedVolume);

Review comment:
       @shwstppr it is possible to handle this case while allocating duplicate volume with template ?




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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-781322701


   cc @Pearl1594 @harikrishna-patnala @nvazquez 


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

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



[GitHub] [cloudstack] rhtyd merged pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638


   


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

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



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#discussion_r610544957



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -6678,6 +6678,12 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final
                 newVol = volumeMgr.allocateDuplicateVolume(root, null);
             }
 
+            if (userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.ROOT_DISK_SIZE) == null && !newVol.getSize().equals(template.getSize())) {
+                VolumeVO resizedVolume = (VolumeVO) newVol;
+                resizedVolume.setSize(template.getSize());
+                _volsDao.update(resizedVolume.getId(), resizedVolume);
+            }
+
             // 1. Save usage event and update resource count for user vm volumes
             _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.volume, newVol.isDisplay());
             _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.primary_storage, newVol.isDisplay(), new Long(newVol.getSize()));

Review comment:
       `newVol` here doesn't have updated template size, refresh it after the template size is updated in DB.




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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


   <b>Trillian test result (tid-276)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 53529 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4638-t276-vmware-67u3.zip
   Intermittent failure detected: /marvin/tests/smoke/test_diagnostics.py
   Intermittent failure detected: /marvin/tests/smoke/test_network.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_usage.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
   Smoke tests completed. 80 look OK, 3 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_05_ping_in_cpvm_success | `Failure` | 15.33 | test_diagnostics.py
   test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | `Failure` | 319.79 | test_routers_network_ops.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 605.11 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 530.36 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 558.01 | test_vpc_redundant.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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: debian. SL-JID 271


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


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

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-809140208


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


   @Pearl1594 a Jenkins job has been kicked to build packages. 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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4638: server: fix root disk size on vm reset

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


   code looks good @shwstppr but have you verified that the resize code is being called on a vm reset?


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4638: server: fix root disk size on vm reset

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


   <b>Trillian test result (tid-306)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 44095 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4638-t306-vmware-67u3.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Smoke tests completed. 82 look OK, 1 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_03_deploy_and_upgrade_kubernetes_cluster | `Error` | 3774.44 | test_kubernetes_clusters.py
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 128.96 | test_kubernetes_clusters.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.

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



[GitHub] [cloudstack] rhtyd commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-817097282


   Merged based on Daan, Pearl's review testing and smoketests


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

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-809115604


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

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



[GitHub] [cloudstack] shwstppr commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-779754177


   @DaanHoogland I stopped work on this after your comment on the issue and reconsidering reset behaviour.
   I think to support not reverting root disk size to the original value, maybe we can have a new param in resetVirtualMachine API. Default behaviour will revert size but user can call the API with the new flag to not revert it. However, that may require additional changes and testing.


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

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #4638: server: fix root disk size on vm reset

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #4638:
URL: https://github.com/apache/cloudstack/pull/4638#issuecomment-809167440


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

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