You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2021/01/28 11:15:11 UTC

[cloudstack] branch 4.15 updated: Fix merge issue from 74bae56642b224e9ccf54bf6ad3dd73b4cf13f41

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.15
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.15 by this push:
     new 1bccb95  Fix merge issue from 74bae56642b224e9ccf54bf6ad3dd73b4cf13f41
1bccb95 is described below

commit 1bccb954c4999d14949351a6b15f518992c43204
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Thu Jan 28 16:43:59 2021 +0530

    Fix merge issue from 74bae56642b224e9ccf54bf6ad3dd73b4cf13f41
    
    Fixes fwd merge issue from origin/4.14
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 server/src/main/java/com/cloud/vm/UserVmManagerImpl.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
index fcf7008..cc31eac 100644
--- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
@@ -1261,6 +1261,19 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
         return resizeVolumeCmd;
     }
 
+    private void resizeRootVolumeOfVmWithNewOffering(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());
+            ResizeVolumeCmd resizeVolumeCmd = new ResizeVolumeCmd(rootVolumeOfVm.getId(), newROOTDiskOffering.getMinIops(), newROOTDiskOffering.getMaxIops());
+            _volumeService.resizeVolume(resizeVolumeCmd);
+            _volsDao.update(rootVolumeOfVm.getId(), rootVolumeOfVm);
+        }
+    }
+
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_NIC_CREATE, eventDescription = "Creating Nic", async = true)
     public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) throws InvalidParameterValueException, PermissionDeniedException, CloudRuntimeException {