[Simulator] Add zone wide storage (#5986)

* [Simulator] Add zone wide storage

* Refactor
This commit is contained in:
Nicolas Vazquez 2022-02-16 22:50:55 -03:00 committed by GitHub
parent ee947e1310
commit ed30683e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -50,6 +50,7 @@ import com.cloud.agent.api.GetStoragePoolCapabilitiesCommand;
import com.cloud.network.router.VirtualNetworkApplianceManager;
import com.cloud.server.StatsCollector;
import com.cloud.upgrade.SystemVmTemplateRegistration;
import com.google.common.collect.Sets;
import org.apache.cloudstack.annotation.AnnotationService;
import org.apache.cloudstack.annotation.dao.AnnotationDao;
import org.apache.cloudstack.api.ApiConstants;
@ -775,9 +776,11 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
} else {
throw new InvalidParameterValueException("Missing parameter hypervisor. Hypervisor type is required to create zone wide primary storage.");
}
if (hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.VMware && hypervisorType != HypervisorType.Hyperv && hypervisorType != HypervisorType.LXC
&& hypervisorType != HypervisorType.Any) {
throw new InvalidParameterValueException("zone wide storage pool is not supported for hypervisor type " + hypervisor);
Set<HypervisorType> supportedHypervisorTypes = Sets.newHashSet(HypervisorType.KVM, HypervisorType.VMware,
HypervisorType.Hyperv, HypervisorType.LXC, HypervisorType.Any, HypervisorType.Simulator);
if (!supportedHypervisorTypes.contains(hypervisorType)) {
throw new InvalidParameterValueException("Zone wide storage pool is not supported for hypervisor type " + hypervisor);
}
} else {
ClusterVO clusterVO = _clusterDao.findById(clusterId);

View File

@ -313,7 +313,7 @@ export default {
inject: ['parentFetchData'],
data () {
return {
hypervisors: ['KVM', 'VMware', 'Hyperv', 'Any'],
hypervisors: ['KVM', 'VMware', 'Hyperv', 'Any', 'Simulator'],
protocols: [],
providers: [],
scope: 'cluster',