cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-9104) VM naming convention in case vmware is used
Date Thu, 02 Mar 2017 09:22:45 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-9104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15891902#comment-15891902
] 

ASF GitHub Bot commented on CLOUDSTACK-9104:
--------------------------------------------

Github user priyankparihar commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1302#discussion_r103880795
  
    --- 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) {
    +
    +        String vmInternalCSName = "";
    +        String vmNameOnVcenter  = "";
    +        if(vmSpec != null)
    +        {
    +            vmInternalCSName = vmNameOnVcenter = vmSpec.getName();
    +            if (_instanceNameFlag == true && vmSpec.getType() == VirtualMachine.Type.User)
{
    +                String[] tokens = vmInternalCSName.split("-");
    +                if(tokens.length<3) throw new InvalidParameterValueException("Invalid
vmInternalCSName format: "+vmInternalCSName+" expected format : *-*-* (e.g -> i-x-y)");
// vmInternalCSName has format i-x-y-<instance.name>
    +                vmNameOnVcenter = String.format("%s-%s-%s-%s", tokens[0], tokens[1],
tokens[2], vmSpec.getHostName());
    --- End diff --
    
    >As per previous code, vmNameOnVcenter = vmSpec.getHostName(), which will introduce
backward compatibility issues for older 4.3 environments. Is there any code that handles for
such old VMs.
    
    Yes, vm.instancename.flag will handle backward compatibility issue. 
    
    Case (vm.instancename.flag = True):
    User can create the VM with same name form different account. 
    Case (vm.instancename.flag = False):
    User can not create the VM with same name form different account.
    Note - But in both the cases, VM with same name are not allowed on a particular network.
And only for the User VM's name format will be like "I-<user-id>-<Display-Name>"
if "vm.instancename.flag = True". It will not cause any impact on other VM names( like Router
VM).


> VM naming convention in case vmware is used
> -------------------------------------------
>
>                 Key: CLOUDSTACK-9104
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9104
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: Priyank Parihar
>            Assignee: Priyank Parihar
>
> ISSUE
> ======
> VM naming convention in case vmware is used.
> Description
> ==========
> User with different account cannot create VMs with the same name, which was possible
earlier (I am not sure in which CCP version). That time naming convention used was like this
“I-<user-id>-<Display-Name>”
> Currently if vm.instancename.flag is set to true the VM name will be exactly as display
name given. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message