Why restored as new VM still shows the hostname/computer name as the source VM name?

Mishra, Suryakant 40 Reputation points
2024-12-02T09:53:44.7366667+00:00

Hello Team,

I have restored VM abcd1234 with an option- restore as new VM and given name wxyz1234. Post restoration the VM name reflect as wxyz1234 but when we get into the VM- overview tab, the hostname/computer name reflects as the source VM name- abcd1234. Is this normal azure behavior or something unusual in our environment. Because I haven't experience this issue in other backup tools in my career. If it is a know issue to Azure then what's the solution to it.

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,496 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ashok Gandhi Kotnana 10,430 Reputation points Microsoft External Staff Moderator
    2024-12-02T11:38:26+00:00

    Hi @Mishra, Suryakant,

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    Yes, this is expected behavior in Azure when restoring a VM using the "Restore as new VM" option. The hostname (computer name) inside the VM remains as it was configured in the original VM because Azure's backup and restoration process creates a new VM by cloning the original VM's disk. The hostname is part of the OS configuration, which is stored in the VM's disk image, and Azure does not automatically update it during restoration.

    This behavior contrasts with some other backup tools that modify the hostname as part of the restoration process.

    Why does this happen?

    1. Azure Backup Design: The backup primarily works at the disk level, not the OS configuration level.
    2. OS-Level Changes Are Not Made: Azure does not modify the contents of the VM's operating system during the restore process, preserving the original hostname and configurations.

    How to Resolve This?

    If the mismatch between the VM name and hostname is an issue, you can manually update the hostname inside the VM after the restoration.

    Steps to Update Hostname:

    Windows VM:

    • Log in to the VM.
      • Go to System Properties > Computer Name > Change.
        • Enter the new desired hostname (e.g., wxyz1234).
          • Restart the VM for the changes to take effect.
          1. Linux VM:
          • SSH into the VM.
    • Update the hostname using the following commands:
        sudo hostnamectl set-hostname wxyz1234
      

    Edit the /etc/hosts and /etc/hostname files (if applicable) to ensure the new hostname persists across reboots.

    let us know if any help, we will always help as you needed.!

    User's image

    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

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.