mirror of https://github.com/apache/cloudstack.git
Merge remote-tracking branch 'origin/4.15'
This commit is contained in:
commit
be5e61a2f3
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue