mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 12158: only allow storage migration through migratevm api, iff no data disks attached to the vm. As data disks may have different service offering with the specified storage pool
status 12158: resolved fixed
This commit is contained in:
parent
39f03cf7c6
commit
009fa8c079
@ -3235,6 +3235,11 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
||||
if (vm.getType() != VirtualMachine.Type.User) {
|
||||
throw new InvalidParameterValueException("can only do storage migration on user vm");
|
||||
}
|
||||
|
||||
List<VolumeVO> vols = _volsDao.findByInstance(vm.getId());
|
||||
if (vols.size() > 1) {
|
||||
throw new InvalidParameterValueException("Data disks attached to the vm, can not migrate. Need to dettach data disks at first");
|
||||
}
|
||||
|
||||
HypervisorType destHypervisorType = _clusterDao.findById(destPool.getClusterId()).getHypervisorType();
|
||||
if (vm.getHypervisorType() != destHypervisorType) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user