mirror of https://github.com/apache/cloudstack.git
Summary: allow resizing of data disk for xen when disk is detached
Detail: Disk should be resizable if detached from a user vm. If associated uservm is null, allow resize Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1357671066 -0700
This commit is contained in:
parent
7149d737e1
commit
17da266c48
|
|
@ -2208,12 +2208,6 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
|
|||
StoragePool pool = _storagePoolDao.findById(volume.getPoolId());
|
||||
long currentSize = volume.getSize();
|
||||
|
||||
/*Xen only works offline, SR does not support VDI.resizeOnline*/
|
||||
if(_volsDao.getHypervisorType(volume.getId()) == HypervisorType.XenServer
|
||||
&& ! userVm.getState().equals(State.Stopped)) {
|
||||
throw new InvalidParameterValueException("VM must be stopped in order to resize with the Xen HV");
|
||||
}
|
||||
|
||||
/* lets make certain they (think they) know what they're doing if they
|
||||
want to shrink, by forcing them to provide the shrinkok parameter. This will
|
||||
be checked again at the hypervisor level where we can see the actual disk size */
|
||||
|
|
@ -2235,6 +2229,12 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
|
|||
} else if(userVm.getLastHostId() != null) {
|
||||
hosts = new long[] { userVm.getLastHostId() };
|
||||
}
|
||||
|
||||
/*Xen only works offline, SR does not support VDI.resizeOnline*/
|
||||
if(_volsDao.getHypervisorType(volume.getId()) == HypervisorType.XenServer
|
||||
&& ! userVm.getState().equals(State.Stopped)) {
|
||||
throw new InvalidParameterValueException("VM must be stopped in order to resize with the Xen HV");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue