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.
* 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.
Might be worth clarifying that this only applies to PaaS, not Windows Azure Virtual Machines (IaaS).
Good point Grant, thanks. I have updated the post to call this out.
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.
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.