Sunday, April 14, 2013

Azure Ate My VM! Or: How to Get Your VM Back

If for any reason your Azure account is suspended (exceeding 90 day compute per month, exceeding monthly spending limit) your IaaS VMs will be deleted. It would appear as if this is normal. Fortunately your disks associated with your VM are not deleted, so we can recover. Hopefully, this is something Microsoft addresses in the near future. For now, let's fix it!

Oh No! Peaches02 is missing!


Fix It

  1. First we'll need to reclaim our DNS address. To do so, click on "Cloud Services" and delete the cloud service that is squatting on the name of your old VM you want to recreate.
  2. Now we will recreate the VM using our pre-existing disk. Fortunately, this disk will present itself in the "gallery". Click "New" on the lower left. 
  3. Select "Compute"->"Virtual Machine"->"From Gallery". You'll see your disk in there. Select it.
  4. Set the name to the same as it was before. The size though, can be changed if you like. (For example, I took mine from medium to small)
  5. Set the DNS name to the same as it was before, and select the region as you desire. 
  6. Associate with an availability set if you like and fire it up!


Your RDP port will probably change because of the way MSFT does Natting for the virtual IPs. I was honored to have 3389 on my vm for the first go-around, but when I set it up again MSFT had already given that port back out. It will automatically create a new NAT (endpoint) mapping, so to determine the new port navigate to virtual machines->(VM)->endpoints and take note of the new RemoteDesktop port.

All your endpoints will be deleted. This can be a real pain if you have alot, but fortunately I have a solution for that.

If there are any questions, let me know. Happy clouding!

No comments: