mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-2796
Hypervisor type validation would be applicable only for zone wide primary storage pool.
This commit is contained in:
parent
984b59d1ee
commit
b4969c4af5
@ -777,23 +777,23 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
||||
"zone id can't be null, if scope is zone");
|
||||
}
|
||||
|
||||
String hypervisor = cmd.getHypervisor();
|
||||
HypervisorType hypervisorType;
|
||||
if (hypervisor != null) {
|
||||
try {
|
||||
hypervisorType = HypervisorType.getType(hypervisor);
|
||||
} catch (Exception e) {
|
||||
throw new InvalidParameterValueException("invalid hypervisor type" + hypervisor);
|
||||
HypervisorType hypervisorType = HypervisorType.KVM;
|
||||
if (scopeType == ScopeType.ZONE) {
|
||||
String hypervisor = cmd.getHypervisor();
|
||||
if (hypervisor != null) {
|
||||
try {
|
||||
hypervisorType = HypervisorType.getType(hypervisor);
|
||||
} catch (Exception e) {
|
||||
throw new InvalidParameterValueException("invalid hypervisor type" + hypervisor);
|
||||
}
|
||||
} else {
|
||||
throw new InvalidParameterValueException(
|
||||
"Missing parameter hypervisor. Hypervisor type is required to create zone wide primary storage.");
|
||||
}
|
||||
if (hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.VMware) {
|
||||
throw new InvalidParameterValueException(
|
||||
"zone wide storage pool is not suported for hypervisor type " + hypervisor);
|
||||
}
|
||||
} else {
|
||||
throw new InvalidParameterValueException(
|
||||
"Missing parameter hypervisor. Hypervisor type is required to create zone wide primary storage.");
|
||||
}
|
||||
|
||||
if (scopeType == ScopeType.ZONE &&
|
||||
(hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.VMware)) {
|
||||
throw new InvalidParameterValueException(
|
||||
"zone wide storage pool is not suported for hypervisor type " + hypervisor);
|
||||
}
|
||||
|
||||
Map ds = cmd.getDetails();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user