Github user priyankparihar commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1302#discussion_r103427150 --- Diff: plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java --- @@ -2226,17 +2227,33 @@ int getReservedCpuMHZ(VirtualMachineTO vmSpec) { return new String[] {datastoreDiskPath}; } - // Pair<internal CS name, vCenter display name> - private Pair<String, String> composeVmNames(VirtualMachineTO vmSpec) { - String vmInternalCSName = vmSpec.getName(); - String vmNameOnVcenter = vmSpec.getName(); - if (_instanceNameFlag && vmSpec.getHostName() != null) { - vmNameOnVcenter = vmSpec.getHostName(); + /** + * This method generates VM name for Vcenter and Cloudstack( when Hypervisor is VMware). + * It generates VM name according to _instanceNameFlag setting. + * + * @param VirtualMachineTO + * vmSpec + * @return Pair<internal CS name, vCenter display name>. A pair which contain 'internal CS name' and + * 'vCenter display name'(vCenter knows VM by this name). + **/ + protected Pair<String, String> composeVmNames(VirtualMachineTO vmSpec) { + --- End diff -- >Why is the method attribute changed from private to protected? Otherwise Unit testing will be difficult. >If vmspec is null, this method should throw an exception, to avoid a situation where empty vmnames are returned. In CS vmspec can not be null. But still code will be modified according your suggestion.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---