|
| 1 | +--- |
| 2 | +title: Resize persistent volumes in Azure Container Storage Preview without downtime |
| 3 | +description: Resize persistent volumes in Azure Container Storage Preview without downtime. Scale up by expanding volumes backed by Azure Disk and NVMe storage pools. |
| 4 | +author: khdownie |
| 5 | +ms.service: azure-container-storage |
| 6 | +ms.topic: how-to |
| 7 | +ms.date: 09/13/2023 |
| 8 | +ms.author: kendownie |
| 9 | +--- |
| 10 | + |
| 11 | +# Resize persistent volumes in Azure Container Storage Preview |
| 12 | +You can expand persistent volumes in [Azure Container Storage](container-storage-introduction.md) to scale up quickly and without downtime. |
| 13 | + |
| 14 | +Shrinking persistent volumes isn't currently supported. You can't expand a volume beyond the size limits of your storage pool. |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +- This article requires version 2.0.64 or later of the Azure CLI. See [How to install the Azure CLI](/cli/azure/install-azure-cli). If you're using Azure Cloud Shell, the latest version is already installed. If you plan to run the commands locally instead of in Azure Cloud Shell, be sure to run them with administrative privileges. |
| 19 | +- You'll need an Azure Kubernetes Service (AKS) cluster with a node pool of at least three virtual machines (VMs) for the cluster nodes, each with a minimum of four virtual CPUs (vCPUs). |
| 20 | +- This article assumes you've already installed Azure Container Storage on your AKS cluster, and that you've created a storage pool and persistent volume claim (PVC) using either [Azure Disks](use-container-storage-with-managed-disks.md) or [ephemeral disk (local storage)](use-container-storage-with-local-disk.md). Azure Elastic SAN Preview doesn't support resizing volumes. |
| 21 | + |
| 22 | +## Expand a volume |
| 23 | + |
| 24 | +Follow these instructions to resize a persistent volume. A built-in storage class supports volume expansion, so be sure to reference a PVC previously created by an Azure Container Storage storage class. For example, if you created the PVC for Azure Disks, it might be called `azurediskpvc`. |
| 25 | + |
| 26 | +1. Run the following command to expand the PVC by increasing the `spec.resources.requests.storage` field. Replace `<pvc-name>` with the name of your PVC. Replace `<size-in-Gi>` with the new size, for example 100Gi. |
| 27 | + |
| 28 | + ```azurecli-interactive |
| 29 | + kubectl patch pvc <pvc-name> --type merge --patch '{"spec": {"resources": {"requests": {"storage": "<size-in-Gi>"}}}}' |
| 30 | + ``` |
| 31 | + |
| 32 | +1. Check the PVC to make sure the volume is expanded: |
| 33 | + |
| 34 | + ```azurecli-interactive |
| 35 | + kubectl describe pvc <pvc-name> |
| 36 | + ``` |
| 37 | + |
| 38 | +The output should reflect the new size. |
| 39 | + |
| 40 | +## See also |
| 41 | + |
| 42 | +- [What is Azure Container Storage?](container-storage-introduction.md) |
0 commit comments