15

I am looking to rename an Azure VM. I have copied a VM from one subscription to another using this guide:

http://blogs.msdn.com/b/microsoft_press/archive/2014/01/29/from-the-mvps-copying-a-virtual-machine-from-one-windows-azure-subscription-to-another-with-powershell.aspx

This has worked fine and I am happy with the newly created VM in my new subscription. However, the VM has retained the original system's name and I would like to rename this.

By "name", I mean the label that is given on the Azure portal on the following screenshot:

image

I have changed the host name of the new VM in the hope that it would reflect the change in this list, but to no avail. The DNS and all other settings are correct.

Is there any way I can change this without creating a new virtual machine? Perhaps there is a cmdlet which will allow this name to be changed or a hidden option in the portal?

  • 1
    You can copy VM using open source tool ADCMS. The Azure Data Center Migration Solution (ADCMS) is designed to address common migration scenarios, such as moving to a closer data center with lower latency; deploying the same solution configuration to multiple data centers; or even moving between subscriptions, such as from an MSDN test account to a full production deployment. Azure Data Center Migration Tool Blog blog.persistentsys.com/…/persistent-systems-releases-azure-data-center-migration-solution (blog.persistentsys.com/index.php/2015/01/06/… – Milind Patil Jan 18 '15 at 15:24
  • Here is a guide to deleting the VM and attaching an existing disk to it. You can also change the virtual network associated with the VM by doing this. blogs.msdn.com/b/walterm/archive/2013/05/29/… – Carlan Wray Feb 18 '16 at 12:59
11

At this time, there is no way to rename a VM. You could try this as a workaround: Delete the VM while retaining all the Disks that were attached to it. Then recreate the VM with the new name and reattach the Disks that were attached to the original VM.

0

Here is a powershell script to reploy a VM.

It is intended to add a VM to an availability group, which incidentally I needed to do at the same time I wanted to rename it.

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/change-availability-set

I just modified it by adding a new parameter to the top

$newVmName = "RR-PROD-SIMON2"

and search and replaced $OriginalVM.Name for $newVmName

I'm not sure about capitalization rules, but I prefer to use all caps.

protected by Community Apr 21 '16 at 23:37

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.