none
How to re-use existing Azure DNS name when deleting/recreating VM

    Question

  • It seems that when you delete an Azure VM the DNS name assigned to the VM instance gets converted to an Azure "Cloud Service". I assume this is done to prevent the loss of the DNS name from the account. However, I don't see an easy way to re-deploy a new VM instance using this DNS name via either the "Cloud Services" section or the "Virtual Machines" section of the preview portal.

    When attempting to create a new VM using the same VHD I run into an error that the DNS name is "in use", and thus cannot create a new VM in this scenario. I assume this is a result of the DNS name being tied to the existing Cloud Service under our account.

    When using the Cloud Services section I see no way to initiate the creation of a new VM instance. The only options appear to be service-related (i.e upload a "Production Deployment", etc.).

    What is the proper way to re-assign this DNS name to a new VM in this scenario?

    Monday, August 13, 2012 2:07 PM

Answers

  • Deleting the VM does not convert the Vm instance to cloud service. When you create a standalone VM, Cloud service is created for you automatically. When you delete the VM, it does not automatically delete cloud service. After you delete the VM, if you do not have any other VMs using the cloud service and you want to use the same DNS name for your new VM, delete the cloud service and create a new VM with earlier DNS name.

    Hope this helps!

    Thanks,

    Hari.

    Monday, August 13, 2012 2:48 PM
    Moderator

All replies

  • Deleting the VM does not convert the Vm instance to cloud service. When you create a standalone VM, Cloud service is created for you automatically. When you delete the VM, it does not automatically delete cloud service. After you delete the VM, if you do not have any other VMs using the cloud service and you want to use the same DNS name for your new VM, delete the cloud service and create a new VM with earlier DNS name.

    Hope this helps!

    Thanks,

    Hari.

    Monday, August 13, 2012 2:48 PM
    Moderator
  • Isn't there a chance that someone else could grab the DNS name in the time period between service delete and VM recreate? I realize this is a rare possibility, but it seems important enough to be addressed in a future update to the portal.
    Monday, August 13, 2012 2:52 PM