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/06/19 19:10:14 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4148: server: Do not resize volume of running vm on KVM host if host is not Up or not Enabled

weizhouapache commented on a change in pull request #4148:
URL: https://github.com/apache/cloudstack/pull/4148#discussion_r443003808



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1187,6 +1189,16 @@ private VolumeVO orchestrateResizeVolume(long volumeId, long currentSize, long n
             if (currentSize != newSize && _volsDao.getHypervisorType(volume.getId()) == HypervisorType.XenServer && !userVm.getState().equals(State.Stopped)) {
                 throw new InvalidParameterValueException(errorMsg);
             }
+
+            /* Do not resize volume of running vm on KVM host if host is not Up or not Enabled */
+            if (currentSize != newSize && userVm.getState() == State.Running && userVm.getHypervisorType() == HypervisorType.KVM) {
+                HostVO host = _hostDao.findById(userVm.getHostId());
+                if (host.getStatus() != Status.Up) {

Review comment:
       @rhtyd added null check




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