cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sateesh-chodapuneedi <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-9104: VM naming convention in ...
Date Thu, 21 Apr 2016 10:58:31 GMT
Github user sateesh-chodapuneedi commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1302#discussion_r60561870
  
    --- Diff: plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
---
    @@ -2030,12 +2030,29 @@ 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).
    +     **/
    +    private Pair<String, String> composeVmNatmes(VirtualMachineTO vmSpec) {
    +
    +        String vmInternalCSName = null;
    --- End diff --
    
    Try to use emtpy/blank rather than null here, because these are being returned. Good practice
to avoid returning nulls.
    Of course, empty vm name is obviously invalid both in ACS database as well as hypervisor
(VMware here, this code is not being invoked for other hypervisor any way)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message