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.
|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.