Azure VM Scale Set - custom VM Names

Kirubakara Senthil Kumar S 191 Reputation points
2022-02-24T04:30:08.45+00:00

In the Azure VM ScaleSet i am running a Vendor product, This vendor product requires a fixed IP and host names to enable the listener at specific port. We deployed this VMSS in a subnet. By this way, we got the fixed IP. But, we are unable to get the fixed VM Names.

Any idea to get fixed VM Names for the VMs in the VMSS ??

I am looking fixed IP and Fixed host name. As we have fixed IP from Subnet, I would like to assign a Fixed name to the VM based on a IP. For example if the IP is 10.200.10.5 - I would like to assign the VM name as USXXXXX05.. something like this.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,018 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
449 questions
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,366 Reputation points Microsoft Employee Moderator
    2022-02-24T07:06:02.363+00:00

    Hello @Kirubakara Senthil Kumar S ,
    It might not be possible to generate a custom VM Names when you deploy your machines in a Virtual Machine Scale Set.
    By default all the VM names under VMSS takes a naming convention of : "{scale-set-name}_{instance-id}

    Each VM in a scale set also gets a computer name assigned to it. This computer name is the hostname of the VM in the Azure-provided DNS name resolution within the virtual network. This computer name is of the form "{computer-name-prefix}{base-36-instance-id}".

    The {base-36-instance-id} is in base 36 and is always six digits in length. If the base 36 representation of the number takes fewer than six digits, the {base-36-instance-id} is padded with zeros to make it six digits in length. For example, an instance with {computer-name-prefix} "nsgvmss" and instance ID 85 will have computer name "nsgvmss00002D".

    For example if you use the below command to create VMSS:

    az vmss create -g vmsstest -n vmsstest --computer-name-prefix comp --image UbuntuLTS

    Then it will create a VMSS with 2 VMs
    VM names will be vmsstest1 , vmsstest2
    Computer Names will be comp1, comp2

    For your scenario , If you still have a requirement of fixed host names - then you can try creating Standard VMs with your custom naming convention grouping in an AvailabilitySet and put those VMs behind a Load Balancer.

    Please reference below documents:
    (While creating the VMs you can customize the VM names based upon your above mentioned requirements)

    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/tutorial-availability-sets
    https://learn.microsoft.com/en-us/azure/load-balancer/tutorial-multi-availability-sets-portal


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.