sigs.k8s.io/cluster-api-provider-azure@v1.14.3/docs/book/src/topics/os-disk.md (about) 1 # OS Disk 2 3 This document describes how to configure the OS disk for VMs provisioned in Azure. 4 5 ### Managed Disk Options 6 7 ### Storage Account Type 8 9 By default, Azure will pick the supported storage account type for your AzureMachine based on the specified VM size. If you'd like to specify a specific storage type, you can do so by specifying a `storageAccountType`: 10 11 ```yaml 12 managedDisk: 13 storageAccountType: Premium_LRS 14 ``` 15 16 Supported values are `Premium_LRS`, `Standard_LRS`, and `StandardSSDLRS`. Note that `UltraSSD_LRS` can only be used with data disks, it cannot be used with OS Disk. 17 18 Also, note that not all Azure VM sizes support Premium storage. To learn more about which sizes are premium storage-compatible, see [Sizes for virtual machines in Azure](https://learn.microsoft.com/azure/virtual-machines/sizes). 19 20 See [Azure documentation on disk types](https://learn.microsoft.com/azure/virtual-machines/disks-types) to learn more about the different storage types. 21 22 See [Introduction to Azure managed disks](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview) for more information on managed disks. 23 24 If the optional field `diskSizeGB` is not provided, it will default to 30GB. 25 26 ## Ephemeral OS 27 28 Ephemeral OS uses local VM storage for changes to the OS disk. 29 Storage devices local to the VM host will not be bound by normal managed 30 disk SKU limits. Instead they will always be capable of saturating the 31 VM level limits. This can significantly improve performance on the OS 32 disk. Ephemeral storage used for the OS will not persist between 33 maintenance events and VM redeployments. This is ideal for stateless 34 base OS disks, where any stateful data is kept elsewhere. 35 36 There are a few kinds of local storage devices available on Azure VMs. 37 Each VM size will have a different combination. For example, some sizes 38 support premium storage caching, some sizes have a temp disk while 39 others do not, and some sizes have local nvme devices with direct 40 access. Ephemeral OS uses the cache for the VM size, if one exists. 41 Otherwise it will try to use the temp disk if the VM has one. These are 42 the only supported options, and we do not expose the ability to manually 43 choose between these two disks (the default behavior is typically most 44 desirable). This corresponds to the `placement` property in the Azure 45 Compute REST API. 46 47 See [the Azure documentation](https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks) for full details. 48 49 ## Azure Machine DiffDiskSettings 50 51 Azure Machines support optionally specifying a field called `diffDiskSettings`. This mirrors the Azure Compute REST API. 52 53 When `diffDiskSettings.option` is set to `Local`, ephemeral OS will be enabled. We use the API shape provided by compute directly as they expose other options, although this is the main one relevant at this time. 54 55 ## Known Limitations 56 57 Not all SKU sizes support ephemeral OS. CAPZ will query Azure's resource 58 SKUs API to check if the requested VM size supports ephemeral OS. If 59 not, the azuremachine controller will log an event with the 60 corresponding error on the AzureMachine object. 61 62 ## Example 63 64 The below example shows how to enable ephemeral OS for a machine template. For control plane nodes, we strongly recommend using [etcd data disks](data-disks.md) to avoid data loss. 65 66 ````yaml 67 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 68 kind: AzureMachineTemplate 69 metadata: 70 name: ${CLUSTER_NAME}-md-0 71 namespace: default 72 spec: 73 template: 74 spec: 75 location: ${AZURE_LOCATION} 76 osDisk: 77 diffDiskSettings: 78 option: Local 79 diskSizeGB: 30 80 managedDisk: 81 storageAccountType: Standard_LRS 82 osType: Linux 83 sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} 84 vmSize: ${AZURE_NODE_MACHINE_TYPE} 85 ````