When driving down the street I think we all know what to do when we see a Stop Sign – we know we need to stop the car.

What happens when you see Stopped as a status for a Windows Azure Virtual Machines?

A little over a month ago Microsoft announced they would no longer charge for a Stopped Virtual Machine. This came as welcome news as I am sure many of you are like me – have left something on for a few days and received a bill for it.

What Microsoft introduced was really a new definition of Stopped to go along with the existing process they had in place.

We now have the following two definitions:

  • Stopped
  • Stopped – Deallocated

When you create a Virtual Machine inside Windows Azure you get a Cloud Service to basically host that virtual machine role. You can add more than one Virtual Machine to that Cloud Service and would do so to achieve high availability.

Up until a few days ago, that Cloud Service was always hidden from the Windows Azure Management Portal. You could see it when you deleted the last virtual machine in the service or using PowerShell. Now, you can see the services inside the UI – so that should help with the confusion. The Cloud Service, along with other things, is what gives your Virtual Machine a Virtual IP address (VIP).

In the pictures below you can see a few of my Virtual Machines and Cloud Services in the Stopped and Stopped Deallocated state.

What’s the difference between Stopped and Stopped– Deallocated?

Stopped $$$ – When a virtual machine is stopped you are still being charged for the virtual machine. You also have the Virtual IP (VIP) address reserved and when you start the machine back up again you will get the same VIP. This is useful when you must have the same VIP.

Stopped Deallocated – When a virtual machine is stopped deallocated you are no longer charged for the virtual machine. The catch is, when you start it back up you might not get the same VIP back again. You get a message about this when you stop the Virtual Machine.

For all the work I am doing right now, the Stopped Deallocated state works just fine for me.

See below on how to get your Virtual Machine into a Stopped or Stopped Deallocated state.

How to Stop a Virtual Machine ($$$)

  • PowerShell
    • Stop-AzureVM -Name $VirtualMachineName -ServiceName $ServiceName –StayProvisioned (StayProvisioned is new in PowerShell as of 06/13)
  • Selecting Shut Down while logged into the Virtual Machine
    • Example: https://management.core.windows.net/<subscription-id>/services/hostedservices/swt003-sql01/deployments/swt003-sql01/roleInstances/swt003-sql01/Operations

How to Stop – Deallocate a Virtual Machine (Money Saver!!!!)

  • PowerShell
    • Stop-AzureVM -Name $VirtualMachineName -ServiceName $ServiceName –Force (Note if you don’t use –Force you get an annoying confirmation popup)
  • Using the Windows Azure Management Portal
    • You will get a confirmation informing you the Virtual IP will be released

Please post if I have missed any other ways to stop a Virtual Machine.

How are you using Windows Azure Virtual Machines? Does the Stopped Deallocated state work for you?