What is the relationship and difference between managed, unmanaged, persistent, ephemeral os disk?

Jun Hou 21 Reputation points
2021-07-14T04:12:05.617+00:00

According to the following document, when creating a node in aks cluster, you can select Ephemeral or Managed through the option of --node-osdisk-type. It seems the concept to be the opposite of "Ephemeral" is "Managed".
https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest

But in another document below it compared persistent and ephemeral OS disks. And said only Managed OS Disk supports Ephemeral OS Disk. This makes me very confused. What is the relationship between these four kinds of disk?
https://learn.microsoft.com/en-us/azure/virtual-machines/ephemeral-os-disks

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,456 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
668 questions
0 comments No comments
{count} votes

Accepted answer
  1. SRIJIT-BOSE-MSFT 4,346 Reputation points Microsoft Employee
    2021-07-14T08:28:08.197+00:00

    @Jun Hou , Thank you for your question.

    Persistent volumes

    Volumes defined and created as part of the pod lifecycle only exist until you delete the pod. Pods often expect their storage to remain if a pod is rescheduled on a different host during a maintenance event, especially in StatefulSets. A persistent volume (PV) is a storage resource created and managed by the Kubernetes API that can exist beyond the lifetime of an individual pod.

    You can use Azure Disks or Files to provide the PersistentVolume. As noted in the Volumes section, the choice of Disks or Files is often determined by the need for concurrent access to the data or the performance tier.

    Persistent Volumes when using Azure Disk are added as DataDisk resources.

    Ephemeral OS

    By default, Azure automatically replicates the operating system disk for an virtual machine to Azure storage to avoid data loss should the VM need to be relocated to another host. However, since containers aren't designed to have local state persisted, this behavior offers limited value while providing some drawbacks, including slower node provisioning and higher read/write latency.

    By contrast, ephemeral OS disks are stored only on the host machine, just like a temporary disk. This provides lower read/write latency, along with faster node scaling and cluster upgrades.

    Like the temporary disk, an ephemeral OS disk is included in the price of the virtual machine, so you incur no additional storage costs.

    When a user does not explicitly request managed disks for the OS, AKS will default to ephemeral OS if possible for a given node pool configuration.

    Note: Local state will not be persisted with ephemeral OS Disk if the node Virtual Machine/;Virtual Machine Scale Set Instance is deallocated. Ephemeral OS Disks are Azure managed and can only be populated by Azure managed OS images. Currently, you cannot bring your own image and create an ephemeral OS disk from it.

    Managed OS Disk

    Azure Managed Disk which does not depend on the node Virtual Machine's host. These are page blobs which are managed by Azure. Local state of the node is persisted even if the node Virtual Machine/;Virtual Machine Scale Set Instance is deallocated.

    Currently, AKS provides a security-optimized host OS by default, but no option to select an alternate operating system. [Reference] Thus you cannot use unmanaged OS with AKS.

    ----------

    To summarize, in the context of AKS cluster node OS Disk, Ephemeral OS Disks which are managed by Azure and can only be populated with Azure managed OS images are operating system disks stored on the VM host and does not persist local state of the VM if the node VM is rebooted. The only other option available for an AKS node OS disk is Managed which is an Azure Managed Disk that is not stored on the VM host and persists local state of the VM even after it is deallocated.

    Persistent volumes on the other hand are Kubernetes objects which can be implemented in Azure using Disks or Files. When using Azure Disks, these are added as data disks to the node VMs.

    ----------

    Hope this helps.

    Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.