Configuring Custom VM Name

Configuring Custom VM Name

You can customize VM names if you do not want ESC to auto-generate VM names. To customize VM names, specify the vim_vm_name in the VM group section of the deployment datamodel. If vim_vm_name is not specified, ESC will auto-generate the VM names.

While specifying a custom name, if a VM group has more than one VM, an "_<index>" is appended to the custom VM name in the output. For example, the first VM in the group is named as specified in the vim_vm_name, and second VM onwards an index "_1", "_2" is appended to the custom name. For a custom name specified as ABC, the output will display the VM names as VMname, VMname_1, VMname_2, and so on. If a VM group only has a single VM, then there is no "_<index>" appended to the custom VM name.

A single deployment can contain multiple VM groups, and each individual VM group can specify a different vim_vm_name value, if required. For example, a deployment could have two VM groups: the first group specifies a vim_vm_name and all VMs have their names generated as described above. The second VM group does not specify a vim_vm_name, therefore all VM names created from this group are auto generated.

Custom VM names only have to be unique within the deployment and tenant for an OpenStack deployment. In other words, custom VM names can be duplicated across different tenants - or even duplicated within the same tenant as long as it is for a different deployment. For a VMware deployment, the custom VM name must be unique throughout the entire vCenter server. In other words, no duplicate VM names are permitted.


Note

You can use a maximum of 63 characters for the custom name. A VM name should not contain special characters and can only contain alphanumeric characters and "_" and "-".
<esc_datamodel xmlns="http://www.cisco.com/esc/esc"> <tenants><tenant>
  <name>Admin</name>
   <deployments>
    <deployment>
     <deployment_name>NwDepModel_nosvc</deployment_name>

    <vm_group>
    <name>CIRROS</name>
    <image>Automation-Cirros-Image</image>
    <flavor>Automation-Cirros-Flavor</flavor>
    <vim_vm_name>VMname</vim_vm_name>
    <scaling>
        <min_active>1</min_active>
        <max_active>2</max_active>
        <elastic>true</elastic>
    </scaling>
</vm_group>

Note

  • The ESC Portal does not display the VM Name that was configured during the deployment time.

  • Duplicate VM Names are not supported on VMWare.

  • VM names cannot be modified after a deployment is complete.


The following are some output samples with the custom VM name. If the vim_vm_name was set during the deployment, the same value will be shown in the output. If this value was not set during the deployment, ESC will auto-generate the VM name.

  • Below is an example of the output operational data fetched using the esc_nc_cli script after adding a custom VM name. A new element called <vmname> will be shown under the vm_group element. The value in the <status_message> field is also updated to reflect the custom VM name.
    
    <?xml version="1.0" encoding="UTF-8"?>
    <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
      <data>
        <esc_datamodel xmlns="http://www.cisco.com/esc/esc">
          <opdata>
            <tenants>
              <tenant>
                <name>xyzzy</name>
                <deployments>
                  <deployment_name>my-deployment-123</deployment_name>
                  <deployment_id>78d48bf8-5f67-45fc-8d92-5ad4676yf57</deployment_id>
                  <vm_group>
                    <name>Grp1</name>
                    <vm_instance>
                      <vm_id>df108144-ec4f-4d66-a62f-98096ecddef0</vm_id>
                      <name>VMname</name>                  
                  </vm_group>
    
  • Below is an example output operational data fetched using a REST API.
    
    GET http://localhost:8080/ESCManager/v0/deployments/example-deployment-123 
    | xmllint --format -
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <deployment xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <datacenter>
        <default>false</default>
      </datacenter>
      <deployment_details>
        <host_uuid>8623f1476302a5815608dbd4c2f836c570e8c74cbfbaff41c78564b1</host_uuid>
        <host_name>my-server</host_name>
        <vm_uuid>e7e5a905-e0c7-4652-ae1f-23a409a58219</vm_uuid>
        <interfaces>
          <interface>
    
          </interface>
        </interfaces>
        <vm_group_name>Grp1</vm_group_name>
        <vm_name>VMname_1</vm_name><-- ##### custom vm name, single VM in the VM group, so no appended "_<index>" -->
        <vm_state_machine_state>VM_ALIVE_STATE</vm_state_machine_state>
      </deployment_details>
    </deployment>