mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5329: fix NPE, in case of zone wide primary storage
Conflicts: api/src/com/cloud/storage/StoragePool.java server/src/com/cloud/vm/UserVmManagerImpl.java
This commit is contained in:
parent
a3736f26f1
commit
24d1f161b8
|
|
@ -18,6 +18,7 @@ package com.cloud.storage;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.hypervisor.Hypervisor;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
|
|
@ -98,10 +99,13 @@ public interface StoragePool extends Identity, InternalIdentity {
|
|||
|
||||
Long getPodId();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
String getStorageProviderName();
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
String getStorageProviderName();
|
||||
|
||||
boolean isInMaintenance();
|
||||
|
||||
Hypervisor.HypervisorType getHypervisor();
|
||||
|
||||
boolean isInMaintenance();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import javax.ejb.Local;
|
|||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -3720,7 +3721,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
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();
|
||||
HypervisorType destHypervisorType = destPool.getHypervisor();
|
||||
if (destHypervisorType == null) {
|
||||
destHypervisorType = _clusterDao.findById(
|
||||
destPool.getClusterId()).getHypervisorType();
|
||||
}
|
||||
|
||||
if (vm.getHypervisorType() != destHypervisorType) {
|
||||
throw new InvalidParameterValueException("hypervisor is not compatible: dest: " + destHypervisorType.toString() + ", vm: " + vm.getHypervisorType().toString());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue