Machine cannot restart due to RoleStateUnknown RRS feed

  • General discussion

  • The following error may occur if you have stopped your virtual machine and after some time are attempting to restart it: "The virtual machine cannot restart. The current virtual machine state is RoleStateUnknown."

    This is a platform issue that we will be fixing in the future. You can workaround this issue by removing the virtual machine (hitting delete in the portal) and re-deploying it using the same disk. This will appear like "reboot" to the Virtual Machine.

    You can also import/export using powershell capabilities (which also saves aside the ports added and the data disks attached). Details on this can be found here:

    Download the PowerShell Tools here: https://www.windowsazure.com/en-us/manage/downloads/

    Documentation on configuring PowerShell can be found here: http://msdn.microsoft.com/en-us/library/windowsazure/jj156055.aspx


    To export:

    Export-AzureVM -ServiceName 'ServiceName' -Name 'VMName'-Path 'c:\folder\VM.xml'

    Then, remove the VM:

    Remove-AzureVM -ServiceName 'ServiceName' -Name 'VMName'

    To import:

    Import-AzureVM -Path 'c:\folder\VM.xml' |
    >> New-AzureVM -ServiceName 'ServiceName' -Location 'loc'

    More Details on using the import/export functionality, try this blog post: http://michaelwasham.com/2012/06/18/importing-and-exporting-virtual-machine-settings/

    NOTE: If you are attempting to just change the size of your Virtual Machine, you can do this without stopping the Virtual Machine. You can go into the "Configure" tab on the virtual machine in the management portal and select the Virtual Machine size. This will change the size without first stopping, which will allow you to avoid this issue in this scenario.

    Wednesday, June 13, 2012 4:48 PM

All replies

  • Hint : deletion of the respective cloud service along with the virtual machine, would allow you to create the virtual machine with the same previous DNS name.

    Thursday, July 12, 2012 4:21 AM
  • I believe we need not remove the cloud service. We can just deploy the VM to the same cloud service when you are creating it. If you delay creating VM for any reason, you might lose the DNS name.

    Veerendra Balla

    Monday, July 16, 2012 5:02 AM
  • Hi Veerendra,

    In my case, without the deleting the respective cloud service, it was not allowed to create the Virtual Machine with same DNS name.

    was I missed something?

    Friday, July 20, 2012 5:01 AM
  • Hi,

    If you look at the below screenshot, select connect to existing vitual machine and select the cloud service url you want to deploy to!

    Veerendra Balla

    Friday, July 20, 2012 5:11 AM
  • Hi,

    My partner did that and then found the softwares and data which he installed to the drive D: were gone. Is there any way that can help him to restore those data?


    John Chang


    Friday, July 20, 2012 6:57 AM
  • Drive d: is a TEMPORARY drive on the VM. If you want material to persist you need to put it either on the OS disk or an attached data disk, both of which are persisted to Windows Azure Blob Storage.
    Friday, July 20, 2012 8:09 AM
  • Thanks Veer.
    Monday, July 23, 2012 3:14 AM
  • Can you please mark my post as anwered if you feel that it was helpful. Or vote if it helped you in anyother way.

    Veerendra Balla

    Monday, July 23, 2012 5:27 AM
  • Just to close on this discussion, we just finishing deploying an update to the platform where we do not expect customers to see this failure any longer. Attempts to restart a Virtual Machine should no longer fail with the above error and should attempt reboot, regardless of the current state.


    Tuesday, July 24, 2012 7:17 AM