Hibernate Windows Azure VM (IAAS)

I am a developer and use an Azure VM for my main development platform. To save the company some money I thought I might shut it down at weekends etc. but often I have many programs etc open that I'd like to keep going. I tried turning hibernation on, thinking I could hibernate and then shut down via portal (or script) but I got:

C:\Windows\system32>powercfg /hibernate on

Hibernation failed with the following error: The request is not supported.

The following items are preventing hibernation on this system. The system firmware does not support hibernation.

Is there anyway to achieve what I'm trying to do (save state but power down) on an Azure VM?


Solution 1:

2 possible stop states of VM in Azure:

  • stopped (shutdown inside VM, billed)

  • stopped-deallocated (shutdown in portal, no bills)

Microsoft is working to make it clear.

http://blogs.technet.com/b/uspartner_ts2team/archive/2014/10/10/azure-virtual-machines-stopping-versus-stopping-deallocating.aspx

http://feedback.azure.com/forums/216843-virtual-machines/suggestions/6272098-stopped-vs-stopped-deallocated

Solution 2:

There's currently no support for hibernation. You can start or stop a vm and that's basically the 2 possible states in Azure. To save money you will have to create an automation (powershell) script to shutdown or start VMs acording to specific schedules but that won't save your user session.

Solution 3:

Azure VMs have only 2 states (i.e. start and stop), but you can certainly tweak this by using extension mechanism during VM creation.

We can do this hibernation as below steps.

  1. Create an standalone application, which will do following things.

    • Read your system "Recent File".
    • Scan all the running process.
    • Now based on process name and recently opened file from recent directory get their absolute path and store into some temp file.
    • Make sure that file creation should overwrite old file, every time it execute.
    • If file exist then during startup this application should opened all the listed file and launch process too.
  2. Now, Store your above created executable file into some publicly access Storage account.

  3. Write one power shell scripts where you can access above mentioned storage account and it will download step 1 created executable application into that VM, which will keep scanning and reading and storing all the recently opened applications into one temp file and during startup it should open too.

  4. For getting download that executable into respective VM, you can use "Extension" mechanism while VM creation where you will attach power shell scripts.

  5. So from next time, after deallocating your VM, whenever you will start that old VM again it will read that temp file where all the file name and process name was listed and opened that.

This way, you can achieve your hibernation process.

Hope these steps are clear, otherwise post an update so I provide more guidance.