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 2020/11/20 16:52:37 UTC

[GitHub] [cloudstack] slavkap opened a new pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

slavkap opened a new pull request #4491:
URL: https://github.com/apache/cloudstack/pull/4491


   When changing the service offering of a VM the disk_offering_id is not
   updated in volumes DB table and VM could not start
   
   Fixes #4125
   
   ### 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)
   
   
   


----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


   @rhtyd 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] sureshanaparti commented on a change in pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -1177,6 +1167,23 @@ private UserVm upgradeStoppedVirtualMachine(Long vmId, Long svcOffId, Map<String
 
     }
 
+    private void resizeVolumeWithNewOfferings(VMInstanceVO vmInstance, ServiceOfferingVO newServiceOffering)

Review comment:
       ```suggestion
       private void resizeRootVolumeOfVmWithNewOffering(VMInstanceVO vmInstance, ServiceOfferingVO newServiceOffering)
   ```




----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachine when updating read/write rate

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


   <b>Trillian test result (tid-3410)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 39374 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4491-t3410-kvm-centos7.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 | `Failure` | 234.29 | 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] slavkap commented on a change in pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -1177,6 +1167,23 @@ private UserVm upgradeStoppedVirtualMachine(Long vmId, Long svcOffId, Map<String
 
     }
 
+    private void resizeVolumeWithNewOfferings(VMInstanceVO vmInstance, ServiceOfferingVO newServiceOffering)
+            throws ResourceAllocationException {
+        DiskOfferingVO newROOTDiskOffering = _diskOfferingDao.findById(newServiceOffering.getId());
+
+        List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vmInstance.getId());
+
+        for (final VolumeVO rootVolumeOfVm : vols) {
+            rootVolumeOfVm.setDiskOfferingId(newROOTDiskOffering.getId());
+
+            _volsDao.update(rootVolumeOfVm.getId(), rootVolumeOfVm);
+
+            ResizeVolumeCmd resizeVolumeCmd = new ResizeVolumeCmd(rootVolumeOfVm.getId(), newROOTDiskOffering.getMinIops(), newROOTDiskOffering.getMaxIops());
+
+            _volumeService.resizeVolume(resizeVolumeCmd);

Review comment:
       thanks @sureshanaparti for the code review! I will move the update of new disk offerings after the resizeVolume, but maybe I need to move the method invocation of resizeVolumeWithNewOfferings before upgradeVMDb (like how it's invoked in upgradeStoppedVirtualMachine)?




----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachine when updating read/write rate

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


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


   Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2502


----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


   @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] sureshanaparti commented on a change in pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -1177,6 +1167,23 @@ private UserVm upgradeStoppedVirtualMachine(Long vmId, Long svcOffId, Map<String
 
     }
 
+    private void resizeVolumeWithNewOfferings(VMInstanceVO vmInstance, ServiceOfferingVO newServiceOffering)
+            throws ResourceAllocationException {
+        DiskOfferingVO newROOTDiskOffering = _diskOfferingDao.findById(newServiceOffering.getId());
+
+        List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vmInstance.getId());
+
+        for (final VolumeVO rootVolumeOfVm : vols) {
+            rootVolumeOfVm.setDiskOfferingId(newROOTDiskOffering.getId());
+
+            _volsDao.update(rootVolumeOfVm.getId(), rootVolumeOfVm);
+
+            ResizeVolumeCmd resizeVolumeCmd = new ResizeVolumeCmd(rootVolumeOfVm.getId(), newROOTDiskOffering.getMinIops(), newROOTDiskOffering.getMaxIops());
+
+            _volumeService.resizeVolume(resizeVolumeCmd);

Review comment:
       @slavkap In case any failure in the ResizeVolumeCmd execution, the volume will still point to the new offering. So, better to update the new offering in the volume after ResizeVolumeCmd execution is successful.




----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachine when updating read/write rate

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


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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4491: fix on changeServiceForVirtualMachine when updating read/write rate

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






----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


   @GabrielBrascher as this pertains to your issue can you review and verify the fix?


----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachine when updating read/write rate

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


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

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



[GitHub] [cloudstack] rhtyd merged pull request #4491: fix on changeServiceForVirtualMachine when updating read/write rate

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


   


----------------------------------------------------------------
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 #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


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

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4491: fix on changeServiceForVirtualMachnie when updating read/write rate

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


   @GabrielBrascher i suppose this will wait for 4.14.2?


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