Jaa


Windows Azure Disk Partition Preservation

 

 

One of the regular questions I get asked is what happens to my disks and drive letters in Windows Azure VMs when <x> happens. The following chart will outline the different scenarios that affect your VM instances, and what happens to the different disks. Note that this information is for stateless PaaS VMs and not the new Windows Azure Virtual Machine persistent VMs.

 

Windows Azure Disk Partitions

  • C: - Local Resource disk. This disk contains Azure logs and configuration files, Windows Azure Diagnostics (which includes your IIS logs), and any LocalStorage resources you define. 
  • D: - Windows disk. This is the OS disk and contains the Program Files folder (which includes installations done via startup tasks unless you specify another disk), registry changes, System32 folder, and the .NET framework.
  • E: or F: - Application disk. This is the disk where your .cspkg is extracted and includes your website, binaries, role host process, startup tasks, web.config, etc.

 

Disk Preservation

  C (Local Resource) D (Windows) E / F (Application)
VM Reboot From Within VM* Preserved Preserved Preserved
Internal Fabric Node Recovery (power cycle node) Preserved Rebuilt Preserved
Portal Reboot, Host OS Update, Stop/Start Service Preserved Preserved Rebuilt
Portal ReImage or Guest OS Update Preserved Rebuilt Rebuilt
In-Place Upgrade (default when deploying from Visual Studio) Preserved Preserved Rebuilt**
Node Migration (ie. server failure) Rebuilt Rebuilt Rebuilt
Rebuild Role Instance API (link) Rebuilt Rebuilt Rebuilt

 

* This reboot is one done from within the VM by doing something such as executing shutdown /r /t 0. The portal reboot is done via the 'Reboot' button in the portal.

** In this scenario the application disk will switch from E to F (or vice-versa). To detect the current application disk, applications should query the %RoleRoot% environment variable.

Comments

  • Anonymous
    October 05, 2012
    Might be worth clarifying that this only applies to PaaS, not Windows Azure Virtual Machines (IaaS).

  • Anonymous
    October 05, 2012
    Good point Grant, thanks.  I have updated the post to call this out.

  • Anonymous
    February 09, 2013
    Two questions on this posting. 1) Both the Base and Differencing virtualized partitions are preserved / rebuilt?, or are there times it can be mutually exclusive (ie: just the diff disk is rebuilt, and not the base, or the base swapped out for a cached host OS image, while the diff is un-mounted/remounted?  How does the local storage "best-effort preservation" setting impact this?  Me=>Inquiring Mindset.

  • Anonymous
    February 10, 2013
    Hey Eric, let me know if this helps answer your questions.

  1. You may need to clarify what you are referring to with the base and diff disks, but ultimately any concept of base or diff disks in PaaS is purely an implementation detail and does not affect these scenarios (or any other externally exposed scenario).  As far as your guest OS or application code is concerned about, there are only 3 disks, C: D: E:/F:.  If any of the disks are built with base+diff disks or not, it is irrelevant to your app.  In this scenario of drive preservation, the entire disk is either preserved or rebuilt from scratch.
  2. The cleanOnRoleRecycle setting for your LocalStorage resources on the C: drive does not have any effect here.  The cleanOnRoleRecycle setting dictates what happens to your local storage resources whenever the host bootstrapper (or any process underneath it) is restarted.  See blogs.msdn.com/.../windows-azure-role-architecture.aspx for more info.  In the scenarios above where the C:  is preserved, then your cleanOnRoleRecycle settings will be honored, in the scenario where the C: is destroyed then all data is lost because your instance will be on a different server.
  • Anonymous
    September 18, 2017
    What is the size for Application disk for PaaS?
  • Anonymous
    March 26, 2019
    I've noticed the %temp% environment variable is assigned to a location on C:\ (C:\Resources\temp.\RoleTemp)However, data saved to this path is always gone after a reboot, even VM Reboot From Within VM.