Search in sources :

Example 1 with VmwareStorageProcessorConfigurableFields

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;
}
Also used : VmwareStorageProcessorConfigurableFields(com.cloud.storage.resource.VmwareStorageProcessor.VmwareStorageProcessorConfigurableFields)

Example 2 with VmwareStorageProcessorConfigurableFields

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;
}
Also used : HypervisorType(com.cloud.hypervisor.Hypervisor.HypervisorType) PrimaryDataStoreTO(org.apache.cloudstack.storage.to.PrimaryDataStoreTO) DataStoreTO(com.cloud.agent.api.to.DataStoreTO) PrimaryDataStoreTO(org.apache.cloudstack.storage.to.PrimaryDataStoreTO) VmwareStorageProcessorConfigurableFields(com.cloud.storage.resource.VmwareStorageProcessor.VmwareStorageProcessorConfigurableFields) EnumMap(java.util.EnumMap)

Aggregations

VmwareStorageProcessorConfigurableFields (com.cloud.storage.resource.VmwareStorageProcessor.VmwareStorageProcessorConfigurableFields)2 DataStoreTO (com.cloud.agent.api.to.DataStoreTO)1 HypervisorType (com.cloud.hypervisor.Hypervisor.HypervisorType)1 EnumMap (java.util.EnumMap)1 PrimaryDataStoreTO (org.apache.cloudstack.storage.to.PrimaryDataStoreTO)1