MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Cluster node disk type #11761

Closed spacecat closed 6 years ago

spacecat commented 6 years ago

Hi,

How do I create a cluster with a standard Azure disk?

This does not seem to be possible using the cli.

Can the disk type be changed after the cluster has been created?

Can I set the disk type when creating the cluster?

By default a premium disk is created when creating a new cluster.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mimckitt commented 6 years ago

Thanks for the question! We are investigating and will update you shortly.

iainfoulds commented 6 years ago

Hi, @spacecat. By default, a storage class for managed-premium is created, but not managed-standard. Create a storage class definition named managed-standard.yaml and paste the following:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: managed-standard
provisioner: kubernetes.io/azure-disk
parameters:
  storageaccounttype: Standard_LRS
  kind: Managed

Create with kubectl create -f managed-standard.yaml.

You can verify the storage class is now available with kubectl get sc.

When you create a PVC following the example in the docs, instead use storageClassName: managed-standard to create a standard managed disk rather than premium.

I'll update the docs to reflect how you can use standard disks. Note that performance on standard HDD disks may not be ideal for production workloads, hence the default to premium disks.

@MicahMcKittrick-MSFT You can just assign this issue to me for doc updates.

in-progress

spacecat commented 6 years ago

Hi,

What about the disk type of the node OS disk?

Seems it is not possible to set/change neither by using the Azure portal nor the CLI.

I have created a new standard disk storage class and tried to use it in a statefulset but I got an error the new disk about to be provisioned is not of the same type as the node OS disk. When I updated the statefulset to use managed-premium then it worked.

iainfoulds commented 6 years ago

@spacecat The OS disk is driven by the VM size. The default size is _Standard_DS1v2. VM sizes with an S in them use premium storage. You can select a different --vm-node-size such as _Standard_D2v3 which then uses standard disks for the OS disk. More information on VM sizes can be found here - https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes

There isn't anything additional currently in the AKS REST API (https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/createorupdate) that lets you define the type of disk outside of choosing a preferred VM size and then using the Kubernetes storage classes.

iainfoulds commented 6 years ago

@spacecat After discussion with the product team, they're going to raise the issue to engineering on the disconnect between standard storage classes and premium storage. The solution provided to create a definition for the standard storage class is the current solution.

I've created a backlog work item to update the docs to show this approach until any engineering changes are implemented.

If you encounter issues using storage, please create an Azure support request which also lets the product team know that customers are needing assistance and can prioritize engineering updates.

@MicahMcKittrick-MSFT For now, #please-close