[
https://issues.apache.org/jira/browse/CLOUDSTACK-9368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15300392#comment-15300392
]
ASF GitHub Bot commented on CLOUDSTACK-9368:
--------------------------------------------
Github user rafaelweingartner commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1560#discussion_r64607461
--- Diff:
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
---
@@ -5510,6 +5501,27 @@ public Answer execute(DestroyCommand cmd) {
}
}
+ /**
+ * Use data center to look for vm, instead of randomly picking up a
cluster<br/>
+ * (in multiple cluster environments vm could not be found if wrong
cluster was chosen)
+ * @param context vmware context
+ * @param hyperHost vmware hv host
+ * @param vol volume
+ * @return a virtualmachinemo if could be found on datacenter
+ * @throws Exception if there is an error while finding vm
+ * @throws CloudRuntimeException if datacenter cannot be found
+ */
+ protected VirtualMachineMO findVmOnDatacenter(VmwareContext context,
VmwareHypervisorHost hyperHost, VolumeTO vol) throws Exception {
+ DatacenterMO dcMo = new DatacenterMO(context,
hyperHost.getHyperHostDatacenter());
+ if (dcMo.getMor() == null) {
+ String msg = "Unable to find VMware DC";
+ s_logger.error(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ VirtualMachineMO vmMo = dcMo.findVm(vol.getPath());
--- End diff --
What about using here: `return dcMo.findVm(vol.getPath());`
then, we could save 1 line of code ;)
> Fix for Support configurable NFS version for Secondary Storage mounts
> ---------------------------------------------------------------------
>
> Key: CLOUDSTACK-9368
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9368
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: VMware
> Affects Versions: 4.9.0
> Reporter: Nicolas Vazquez
> Fix For: 4.9.0
>
>
> This issue address a problem introduced in
> [CLOUDSTACK-9252|https://issues.apache.org/jira/browse/CLOUDSTACK-9252] in
> which NFS version couldn't be changed after hosts resources were configured
> on startup (for hosts using `VmwareResource`), and as host parameters didn't
> include `nfs.version` key, it was set `null`.
> h4. Proposed solution
> In this proposed solution `nfsVersion` would be passed in `NfsTO` through
> `CopyCommand` to `VmwareResource`, who will check if NFS version is still
> configured or not. If not, it will use the one sent in the command and will
> set it to its storage processor and storage handler. After those setups, it
> will proceed executing command.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)