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
Copy file name to clipboardExpand all lines: articles/aks/azure-csi-disk-storage-provision.md
+1-112Lines changed: 1 addition & 112 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Kubernetes Service
4
4
description: Learn how to create a static or dynamic persistent volume with Azure Disks for use with multiple concurrent pods in Azure Kubernetes Service (AKS)
5
5
ms.topic: article
6
6
ms.custom: devx-track-azurecli
7
-
ms.date: 03/23/2023
7
+
ms.date: 04/11/2023
8
8
---
9
9
10
10
# Create and use a volume with Azure Disks in Azure Kubernetes Service (AKS)
@@ -203,117 +203,6 @@ Once the persistent volume claim has been created and the disk successfully prov
203
203
204
204
To use Azure ultra disk, see [Use ultra disks on Azure Kubernetes Service (AKS)][use-ultra-disks].
205
205
206
-
### Back up a persistent volume
207
-
208
-
To back up the data in your persistent volume, take a snapshot of the managed disk for the volume. You can then use this snapshot to create a restored disk and attach to pods as a means of restoring the data.
209
-
210
-
1. Get the volume name with the [kubectl get][kubectl-get] command, such as for the PVC named *azure-managed-disk*:
211
-
212
-
```bash
213
-
kubectl get pvc azure-managed-disk
214
-
```
215
-
216
-
The output of the command resembles the following example:
217
-
218
-
```console
219
-
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
2. This volume name forms the underlying Azure disk name. Query for the disk ID with [az disk list][az-disk-list] and provide your PVC volume name, as shown in the following example:
224
-
225
-
```azurecli
226
-
az disk list --query '[].id | [?contains(@,`pvc-faf0f176-8b8d-11e8-923b-deb28c58d242`)]' -o tsv
3. Use the disk ID to create a snapshot disk with [az snapshot create][az-snapshot-create]. The following example creates a snapshot named *pvcSnapshot* in the same resource group as the AKS cluster *MC_myResourceGroup_myAKSCluster_eastus*. You may encounter permission issues if you create snapshots and restore disks in resource groups that the AKS cluster doesn't have access to. Depending on the amount of data on your disk, it may take a few minutes to create the snapshot.
1. To restore the disk and use it with a Kubernetes pod, use the snapshot as a source when you create a disk with [az disk create][az-disk-create]. This operation preserves the original resource if you then need to access the original data snapshot. The following example creates a disk named *pvcRestored* from the snapshot named *pvcSnapshot*:
243
-
244
-
```azurecli
245
-
az disk create --resource-group MC_myResourceGroup_myAKSCluster_eastus --name pvcRestored --source pvcSnapshot
246
-
```
247
-
248
-
2. To use the restored disk with a pod, specify the ID of the disk in the manifest. Get the disk ID with the [az disk show][az-disk-show] command. The following example gets the disk ID for *pvcRestored* created in the previous step:
249
-
250
-
```azurecli
251
-
az disk show --resource-group MC_myResourceGroup_myAKSCluster_eastus --name pvcRestored --query id -o tsv
252
-
```
253
-
254
-
3. Create a pod manifest named `azure-restored.yaml` and specify the disk URI obtained in the previous step. The following example creates a basic NGINX web server, with the restored disk mounted as a volume at */mnt/azure*:
4. Create the pod with the [kubectl apply][kubectl-apply] command, as shown in the following example:
284
-
285
-
```bash
286
-
kubectl apply -f azure-restored.yaml
287
-
```
288
-
289
-
The output of the command resembles the following example:
290
-
291
-
```console
292
-
pod/mypodrestored created
293
-
```
294
-
295
-
5. You can use `kubectl describe pod mypodrestored` to view details of the pod, such as the following condensed example that shows the volume information:
296
-
297
-
```bash
298
-
kubectl describe pod mypodrestored
299
-
```
300
-
301
-
The output of the command resembles the following example:
302
-
303
-
```console
304
-
[...]
305
-
Volumes:
306
-
volume:
307
-
Type: AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
0 commit comments