[ https://issues.apache.org/jira/browse/CLOUDSTACK-9422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15410008#comment-15410008 ]
ASF GitHub Bot commented on CLOUDSTACK-9422: -------------------------------------------- Github user nvazquez commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1602#discussion_r73753387 --- Diff: plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java --- @@ -537,15 +540,51 @@ public Answer executeRequest(Command cmd) { protected void checkStorageProcessorAndHandlerNfsVersionAttribute(StorageSubSystemCommand cmd) { if (storageNfsVersion != null) return; if (cmd instanceof CopyCommand){ - examineStorageSubSystemCommandNfsVersion((CopyCommand) cmd); + EnumMap<VmwareStorageProcessorConfigurableFields,Object> params = new EnumMap<VmwareStorageProcessorConfigurableFields,Object>(VmwareStorageProcessorConfigurableFields.class); + examineStorageSubSystemCommandNfsVersion((CopyCommand) cmd, params); + examineStorageSubSystemCommandFullCloneFlagForVmware((CopyCommand) cmd, params); + reconfigureProcessorByHandler(params); + } + } + + /** + * Reconfigure processor by handler + * @param params params + */ + protected void reconfigureProcessorByHandler(EnumMap<VmwareStorageProcessorConfigurableFields,Object> params) { + VmwareStorageSubsystemCommandHandler handler = (VmwareStorageSubsystemCommandHandler) storageHandler; + boolean success = handler.reconfigureStorageProcessor(params); + if (success){ + s_logger.info("VmwareStorageProcessor and VmwareStorageSubsystemCommandHandler successfully reconfigured"); + } else { + s_logger.error("Error while reconfiguring VmwareStorageProcessor and VmwareStorageSubsystemCommandHandler"); + } + } + + /** + * Examine StorageSubSystem command to get full clone flag, if provided + * @param cmd command to execute + * @param params params + */ + protected void examineStorageSubSystemCommandFullCloneFlagForVmware(CopyCommand cmd, EnumMap<VmwareStorageProcessorConfigurableFields,Object> params) { + HypervisorType hypervisor = cmd.getDestTO().getHypervisorType(); + if (hypervisor == null || (hypervisor != null && ! hypervisor.equals(HypervisorType.VMware))) return; + + DataStoreTO destDataStore = cmd.getDestTO().getDataStore(); + if (destDataStore instanceof PrimaryDataStoreTO){ + PrimaryDataStoreTO dest = (PrimaryDataStoreTO) destDataStore; + if (dest.isFullCloneFlag() != null){ + params.put(VmwareStorageProcessorConfigurableFields.FULL_CLONE_FLAG, dest.isFullCloneFlag().booleanValue()); --- End diff -- Done, thanks for the review > Granular VMware vm's creation as full clones on HV > -------------------------------------------------- > > Key: CLOUDSTACK-9422 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9422 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: VMware > Reporter: Nicolas Vazquez > Assignee: Nicolas Vazquez > > h3. Introduction > For VMware, It is possible to decide creating VMs as full clones on ESX HV, > adjusting {{vmware.create.full.clone}} global setting. We would like to > introduce this property as a primary storage detail, and use its value > instead of global setting's value. -- This message was sent by Atlassian JIRA (v6.3.4#6332)