You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**Size limit for OS disk**| 2 TiB | Cache size for the VM size or 2 TiB, whichever is smaller. For the **cache size in GiB**, see [DS](sizes-general.md), [ES](sizes-memory.md), [M](sizes-memory.md), [FS](sizes-compute.md), and [GS](sizes-previous-gen.md#gs-series)|
36
-
|**VM sizes supported**| All | VM sizes that support Premium storage such as DSv1, DSv2, DSv3, Esv3, Fs, FsV2, GS, M |
34
+
|**VM sizes supported**| All | VM sizes that support Premium storage such as DSv1, DSv2, DSv3, Esv3, Fs, FsV2, GS, M, Mdsv2,Bs, Dav4, Eav4|
37
35
|**Disk type support**| Managed and unmanaged OS disk | Managed OS disk only |
38
36
|**Region support**| All regions | All regions |
39
37
|**Data persistence**| OS disk data written to OS disk are stored in Azure Storage | Data written to OS disk is stored on local VM storage and isn't persisted to Azure Storage. |
@@ -43,68 +41,38 @@ Key differences between persistent and ephemeral OS disks:
43
41
| **Resizing to a new VM size** | OS disk data is preserved | Data on the OS disk is deleted, OS is reprovisioned
44
42
|**Page file placement**| For Windows, page file is stored on the resource disk | For Windows, page file is stored on the OS disk (for both OS cache placement and Temp disk placement). |
45
43
46
-
47
44
## Size requirements
48
45
49
46
You can choose to deploy Ephemeral OS Disk on VM cache or VM temp disk.
50
-
The image OS disk’s size should be equal to or greater than the temp/cache size of the disk chosen.
47
+
The image OS disk’s size should be less than or equal to the temp/cache size of the VM size chosen.
51
48
52
49
For example, if you want to opt for **OS cache placement**: Standard Windows Server images from the marketplace are about 127 GiB, which means that you need a VM size that has a cache equal to or larger than 127 GiB. The Standard_DS3_v2 has a cache size of 127 GiB, which is large enough. In this case, the Standard_DS3_v2 is the smallest size in the DSv2 series that you can use with this image.
53
50
54
-
If you want to opt for **Temp disk placement**: Standard Ubuntu server image from marketplace comes with 30-GiB OS disk space. To enable Ephemeral OS disk, the disk size must be equal to or larger than 30 GiB. Standard_B4ms has a temp size of 32 GiB, which can fit the 30 GiB OS disk. But Standard_B2ms has a temp size of 16 GiB, which wouldn't be able to fit 30 GiB of OS disk.
51
+
If you want to opt for **Temp disk placement**: Standard Ubuntu server image from marketplace is about 30 GiB. To enable Ephemeral OS disk on temp, the temp disk size must be equal to or larger than 30 GiB. Standard_B4ms has a temp size of 32 GiB, which can fit the 30 GiB OS disk. Upon creation of the VM, the temp disk space would be 2 GiB.
52
+
> [!Important] If opting for temp disk placement the Final Temp disk size = (Initial temp disk size - OS image size).
55
53
56
54
Basic Linux and Windows Server images in the Marketplace that are denoted by `[smallsize]` tend to be around 30 GiB and can use most of the available VM sizes.
57
55
Ephemeral disks also require that the VM size supports **Premium storage**. The sizes usually (but not always) have an `s` in the name, like DSv2 and EsV3. For more information, see [Azure VM sizes](sizes.md) for details around which sizes support Premium storage.
58
56
59
-
60
57
## Ephemeral OS Disks can now be stored on temp/Resource disks
61
58
Ephemeral OS disk can now be stored either in VM cache disk or VM temp/resource disk.
62
-
This feature enables Ephemeral OS disks to be created for all the VMs, which don't have a cache or insufficient cache (such as Dav3, Dav4, Eav4, and Eav3) but has temp disk to store the Ephemeral OS disk.
59
+
This feature enables Ephemeral OS disks to be created for all the VMs, which don't have cache or have insufficient cache (such as Dav3, Dav4, Eav4, and Eav3) but has sufficient temp disk to host the Ephemeral OS disk.
63
60
[DiffDiskPlacement](/rest/api/compute/virtualmachines/list#diffdiskplacement) is the new property that can be used to specify where you want to place the Ephemeral OS disk.
64
61
With this feature, when a Windows VM is provisioned, we configure the pagefile to be located on the OS Disk.
65
62
66
-
## PowerShell
67
-
To use an ephemeral disk for a PowerShell VM deployment, use [Set-AzVMOSDisk](/powershell/module/az.compute/set-azvmosdisk) in your VM configuration. Set the `-DiffDiskSetting` to `Local` and `-Caching` to `ReadOnly`.
68
-
```powershell
69
-
Set-AzVMOSDisk -DiffDiskSetting Local -Caching ReadOnly
70
-
```
71
-
For scale set deployments, use the [Set-AzVmssStorageProfile](/powershell/module/az.compute/set-azvmssstorageprofile) cmdlet in your configuration. Set the `-DiffDiskSetting` to `Local` and `-Caching` to `ReadOnly`.
72
-
73
-
```powershell
74
-
Set-AzVmssStorageProfile -DiffDiskSetting Local -OsDiskCaching ReadOnly
75
-
```
76
-
77
-
## CLI
78
-
79
-
To use an ephemeral disk for a CLI VM deployment, set the `--ephemeral-os-disk` parameter in [az vm create](/cli/azure/vm#az_vm_create) to `true` and the `--os-disk-caching` parameter to `ReadOnly`.
80
-
81
-
```azurecli-interactive
82
-
az vm create \
83
-
--resource-group myResourceGroup \
84
-
--name myVM \
85
-
--image UbuntuLTS \
86
-
--ephemeral-os-disk true \
87
-
--os-disk-caching ReadOnly \
88
-
--admin-username azureuser \
89
-
--generate-ssh-keys
90
-
```
91
-
92
-
For scale sets, you use the same `--ephemeral-os-disk true` parameter for [az-vmss-create](/cli/azure/vmss#az_vmss_create) and set the `--os-disk-caching` parameter to `ReadOnly`.
93
-
94
63
## Portal
95
64
96
65
In the Azure portal, you can choose to use ephemeral disks when deploying a virtual machine or virtual machine scale sets by opening the **Advanced** section of the **Disks** tab. For choosing placement of Ephemeral OS disk, select **OS cache placement** or **Temp disk placement**.
97
66
98
67

68
+
99
69
100
70
If the option for using an ephemeral disk or OS cache placement or Temp disk placement is greyed out, you might have selected a VM size that doesn't have a cache/temp size larger than the OS image or that doesn't support Premium storage. Go back to the **Basics** page and try choosing another VM size.
101
71
102
-
103
72
## Scale set template deployment
104
73
The process to create a scale set that uses an ephemeral OS disk is to add the `diffDiskSettings` property to the
105
74
`Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile` resource type in the template. Also, the caching policy must be set to `ReadOnly` for the ephemeral OS disk. placement can be changed to `CacheDisk` for OS cache disk placement.
@@ -184,6 +152,35 @@ You can deploy a VM with an ephemeral OS disk using a template. The process to c
184
152
}
185
153
```
186
154
155
+
> [!NOTE] Ephemeral OS disk placement option (VM cache disk or VM temp/resource disk) is coming soon on PowerShell and CLI
156
+
157
+
## PowerShell
158
+
To use an ephemeral disk for a PowerShell VM deployment, use [Set-AzVMOSDisk](/powershell/module/az.compute/set-azvmosdisk) in your VM configuration. Set the `-DiffDiskSetting` to `Local` and `-Caching` to `ReadOnly`.
159
+
```powershell
160
+
Set-AzVMOSDisk -DiffDiskSetting Local -Caching ReadOnly
161
+
```
162
+
For scale set deployments, use the [Set-AzVmssStorageProfile](/powershell/module/az.compute/set-azvmssstorageprofile) cmdlet in your configuration. Set the `-DiffDiskSetting` to `Local` and `-Caching` to `ReadOnly`.
163
+
164
+
```powershell
165
+
Set-AzVmssStorageProfile -DiffDiskSetting Local -OsDiskCaching ReadOnly
166
+
```
167
+
168
+
## CLI
169
+
170
+
To use an ephemeral disk for a CLI VM deployment, set the `--ephemeral-os-disk` parameter in [az vm create](/cli/azure/vm#az_vm_create) to `true` and the `--os-disk-caching` parameter to `ReadOnly`.
171
+
172
+
```azurecli-interactive
173
+
az vm create \
174
+
--resource-group myResourceGroup \
175
+
--name myVM \
176
+
--image UbuntuLTS \
177
+
--ephemeral-os-disk true \
178
+
--os-disk-caching ReadOnly \
179
+
--admin-username azureuser \
180
+
--generate-ssh-keys
181
+
```
182
+
183
+
For scale sets, you use the same `--ephemeral-os-disk true` parameter for [az-vmss-create](/cli/azure/vmss#az_vmss_create) and set the `--os-disk-caching` parameter to `ReadOnly`.
187
184
188
185
## Reimage a VM using REST
189
186
You can reimage a Virtual Machine instance with ephemeral OS disk using REST API as described below and via Azure portal by going to Overview pane of the VM. For scale sets, reimaging is already available through PowerShell, CLI, and the portal.
A: We support platformand custom images, up to the VM cache size, where all read/writes to the OS disk will be local on the same node as the Virtual Machine.
197
+
A: We support platform, Shared Image Gallery, and custom images, up to the VM cache size with OS cache placement and up to Temp disk size with Temp disk placement, where all read/writes to the OS disk will be local on the same node as the Virtual Machine.
201
198
202
199
**Q: Can the ephemeral OS disk be resized?**
203
200
204
201
A: No, once the ephemeral OS disk is provisioned, the OS disk cannot be resized.
205
202
206
203
**Q: Can the ephemeral OS disk placement be modified after creation of VM?**
207
204
208
-
A: No, once the ephemeral OS disk is provisioned, the OS disk placement cannot be changed. But the VM can be recreated via ARM template deployment/PowerShell/CLI by updating the OS disk placement of choosing. Resulting in the recreation of the VM with Data on the OS disk deleted and OS is reprovisioned.
205
+
A: No, once the ephemeral OS disk is provisioned, the OS disk placement cannot be changed. But the VM can be recreated via ARM template deployment/PowerShell/CLI by updating the OS disk placement of choosing. This would result in the recreation of the VM with Data on the OS disk deleted and OS is reprovisioned.
206
+
207
+
**Q: Is there any Temp disk created if image size equals to Temp disk size of VM size selected?**
208
+
209
+
A: No, in that case, there won't be any Temp disk drive created.
210
+
211
+
**Q: Are Ephemeral OS disks supported on low-priority VMs and Spot VMs?**
212
+
213
+
A: Yes. There is no option of Stop-Deallocate for Ephemeral VMs, rather users need to Delete instead of deallocating them.
209
214
210
215
**Q: Can I attach a Managed Disks to an Ephemeral VM?**
211
216
@@ -215,7 +220,7 @@ A: Yes, you can attach a managed data disk to a VM that uses an ephemeral OS dis
215
220
216
221
A: No, most Premium Storage VM sizes are supported (DS, ES, FS, GS, M, etc.). To know whether a particular VM size supports ephemeral OS disks, you can:
217
222
218
-
Call the `Get-AzComputeResourceSku` PowerShell cmdlet
0 commit comments