28

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?

Daniel
  • 3,021
  • 5
  • 35
  • 50

3 Answers3

27

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

n0099
  • 520
  • 1
  • 4
  • 12
Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
  • 3
    Reboots will not wipe the temporary storage. – kwill Aug 29 '13 at 20:07
  • 2
    Even if a reboot doesn't wipe it most times there is no guarantee that this will always be the case, see above "is not guaranteed to be predictable". – Dijkgraaf Nov 06 '14 at 23:26
  • 6
    It would seem reboots or brief shutdowns can wipe the temporary D: drive. I spent the morning setting up an Azure G2 VM. I shut it down for a lunch and when I started it up everything on the D: was gone. Including the SQL installation - bummer. Live an learn. – JimSTAT Mar 26 '15 at 20:30
  • I just experienced a reboot and it did wipe the temporary disk. – m_kramar Jan 17 '17 at 02:32
8

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

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • Storing swap files is a viable use case? – Hassan Baig Mar 09 '17 at 15:28
  • @HassanBaig Yes. Refer [Is it safe to store a swap-file on the Temporary Disk on Azure?](https://serverfault.com/questions/722730/is-it-safe-to-store-a-swap-file-on-the-temporary-disk-on-azure). – Md Shihab Dec 11 '17 at 07:24
2

When you resize the VM, When you shutdown or restart your VM, when your VM is moved to a different host server(due to service healing, shutdown and restart), when the host is updated, when the host experiences a hardware failure etc.

Source: Azure Pricing page

Phill Healey
  • 3,084
  • 2
  • 33
  • 67