use of com.cloud.storage.resource.VmwareStorageProcessor.VmwareStorageProcessorConfigurableFields in project cloudstack by apache.
the class VmwareStorageSubsystemCommandHandler method reconfigureStorageProcessor.
public boolean reconfigureStorageProcessor(EnumMap<VmwareStorageProcessorConfigurableFields, Object> params) {
VmwareStorageProcessor processor = (VmwareStorageProcessor) this.processor;
for (VmwareStorageProcessorConfigurableFields key : params.keySet()) {
switch(key) {
case NFS_VERSION:
String nfsVersion = (String) params.get(key);
processor.setNfsVersion(nfsVersion);
this._nfsVersion = nfsVersion;
break;
case FULL_CLONE_FLAG:
boolean fullClone = (boolean) params.get(key);
processor.setFullCloneFlag(fullClone);
break;
case DISK_PROVISIONING_STRICTNESS:
boolean diskProvisioningStrictness = (boolean) params.get(key);
processor.setDiskProvisioningStrictness(diskProvisioningStrictness);
break;
default:
s_logger.error("Unknown reconfigurable field " + key.getName() + " for VmwareStorageProcessor");
return false;
}
}
return true;
}
use of com.cloud.storage.resource.VmwareStorageProcessor.VmwareStorageProcessorConfigurableFields in project cloudstack by apache.
the class VmwareResource method examineStorageSubSystemCommandFullCloneFlagForVmware.
/**
* Examine StorageSubSystem command to get full clone flag, if provided
*
* @param cmd command to execute
* @param params params
* @return copy of params including new values, if suitable
*/
protected EnumMap<VmwareStorageProcessorConfigurableFields, Object> examineStorageSubSystemCommandFullCloneFlagForVmware(CopyCommand cmd, EnumMap<VmwareStorageProcessorConfigurableFields, Object> params) {
EnumMap<VmwareStorageProcessorConfigurableFields, Object> paramsCopy = new EnumMap<VmwareStorageProcessorConfigurableFields, Object>(params);
HypervisorType hypervisor = cmd.getDestTO().getHypervisorType();
if (hypervisor != null && hypervisor.equals(HypervisorType.VMware)) {
DataStoreTO destDataStore = cmd.getDestTO().getDataStore();
if (destDataStore instanceof PrimaryDataStoreTO) {
PrimaryDataStoreTO dest = (PrimaryDataStoreTO) destDataStore;
if (dest.isFullCloneFlag() != null) {
paramsCopy.put(VmwareStorageProcessorConfigurableFields.FULL_CLONE_FLAG, dest.isFullCloneFlag().booleanValue());
}
if (dest.getDiskProvisioningStrictnessFlag() != null) {
paramsCopy.put(VmwareStorageProcessorConfigurableFields.DISK_PROVISIONING_STRICTNESS, dest.getDiskProvisioningStrictnessFlag().booleanValue());
}
}
}
return paramsCopy;
}
Aggregations