When you create an Azure VM, it creates a D: drive named "Temporary Storage". It's unclear to me just how temporary this is though. Is it reset between reboots, start/stop, or just if the image is recreated? Or arbitrarily? Also, what are some use cases for this temporary storage?
The temporary disk provides short-term storage for applications and processes, and is intended to only store data such as page or swap files. Data on the temporary disk may be lost during a maintenance event or when you redeploy a VM.
This is because the data for the temporary disks is stored on the host operating system running the hypervisor software while the data for persistent disks is stored in Microsoft Azure Storage. The temporary disk is very useful for data which, you guessed it, is temporary in nature.
Virtual machines created in Windows Azure are created with temporary storage assigned automatically. Depending on the OS this can appear as: Windows Virtual Machine “D:\”
Each data disk can be up to 32,767 GiB. The number of data disks you can use depends on the size of the virtual machine.
Resets, reboots, fail overs etc. can wipe it. It is only to be used for swap files etc.
Performance Best Practices for SQL Server in Azure Virtual Machines
Temporary Disk
The temporary storage drive, labeled as the D: drive is not persisted and is not saved in the Windows Azure Blob storage. It is used primarily for the page file and its performance is not guaranteed to be predictable. Management tasks such as a change to the virtual machine size, resets the D: drive. In addition, Windows Azure erases the data on the temporary storage drive when a virtual machine fails over. The D: drive is not recommended for storing any user or system database files, including tempdb.
EDIT: Interestingly enough the above has now been updated to the below which says that is is OK to store your tempdb on if you are using the D-Series Virtual Machines.
The temporary storage drive, labeled as the D: drive, is not persisted to Azure blob storage. Do not store your data or log files on the D: drive. Only store tempdb and/or Buffer Pool Extensions on the D drive when using the D-Series Virtual Machines (VMs). Unlike the other VM series, the D drive in the D-Series VMs is SSD-based. This can improve the performance of workloads that heavily use temporary objects or that have working sets which don't fit in memory. For more information, see Using SSDs in Azure VMs to store SQL Server TempDB and Buffer Pool Extensions.
Some Azure Virtual Machine Basics Please
The Temporary storage drive is a local drive on the physical box that should only serve as scratch space. For example, we put the paging file onto this drive to save on transaction costs for each Windows page-in but nothing else. I would recommend you don’t put anything that you need persisted on this drive as it will be deleted upon any hardware failure the system sees whereas the OS disk and any data disks attached will remain persisted in storage even on hardware failures.
This disk is a local disk, non-replicated. If it crashes, anything on it is gone. If your VM is moved to another server, the content is gone. If you scale a VM size down, it's likely this data will be gone, as the allocation size decreases.
As for use cases: Think about database servers that need a scratch disk. Or maybe your workflow involves grabbing content from a blob, processing it, then shipping it off somewhere (e.g. photo/video/audio processing). You could download to temporary storage, do all of your transform work on that disk, then pick up the results, saving the final file somewhere durable. Temp storage use is really open-ended - it's really up to you how you use it; just realize that it's not durable storage (unlike your VHD, which is in durable storage).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With