Skip to content

Commit 198804c

Browse files
authored
remove outdated snapshot example
1 parent 65eb260 commit 198804c

File tree

1 file changed

+1
-112
lines changed

1 file changed

+1
-112
lines changed

articles/aks/azure-csi-disk-storage-provision.md

Lines changed: 1 addition & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Kubernetes Service
44
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)
55
ms.topic: article
66
ms.custom: devx-track-azurecli
7-
ms.date: 03/23/2023
7+
ms.date: 04/11/2023
88
---
99

1010
# 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
203203

204204
To use Azure ultra disk, see [Use ultra disks on Azure Kubernetes Service (AKS)][use-ultra-disks].
205205

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
220-
azure-managed-disk Bound pvc-faf0f176-8b8d-11e8-923b-deb28c58d242 5Gi RWO managed-premium 3m
221-
```
222-
223-
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
227-
228-
/subscriptions/<guid>/resourceGroups/MC_MYRESOURCEGROUP_MYAKSCLUSTER_EASTUS/providers/MicrosoftCompute/disks/kubernetes-dynamic-pvc-faf0f176-8b8d-11e8-923b-deb28c58d242
229-
```
230-
231-
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.
232-
233-
```azurecli
234-
az snapshot create \
235-
--resource-group MC_myResourceGroup_myAKSCluster_eastus \
236-
--name pvcSnapshot \
237-
--source /subscriptions/<guid>/resourceGroups/MC_myResourceGroup_myAKSCluster_eastus/providers/MicrosoftCompute/disks/kubernetes-dynamic-pvc-faf0f176-8b8d-11e8-923b-deb28c58d242
238-
```
239-
240-
### Restore and use a snapshot
241-
242-
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*:
255-
256-
```yaml
257-
kind: Pod
258-
apiVersion: v1
259-
metadata:
260-
name: mypodrestored
261-
spec:
262-
containers:
263-
- name: mypodrestored
264-
image: mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine
265-
resources:
266-
requests:
267-
cpu: 100m
268-
memory: 128Mi
269-
limits:
270-
cpu: 250m
271-
memory: 256Mi
272-
volumeMounts:
273-
- mountPath: "/mnt/azure"
274-
name: volume
275-
volumes:
276-
- name: volume
277-
azureDisk:
278-
kind: Managed
279-
diskName: pvcRestored
280-
diskURI: /subscriptions/<guid>/resourceGroups/MC_myResourceGroupAKS_myAKSCluster_eastus/providers/Microsoft.Compute/disks/pvcRestored
281-
```
282-
283-
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)
308-
DiskName: pvcRestored
309-
DiskURI: /subscriptions/19da35d3-9a1a-4f3b-9b9c-3c56ef409565/resourceGroups/MC_myResourceGroupAKS_myAKSCluster_eastus/providers/Microsoft.Compute/disks/pvcRestored
310-
Kind: Managed
311-
FSType: ext4
312-
CachingMode: ReadWrite
313-
ReadOnly: false
314-
[...]
315-
```
316-
317206
### Using Azure tags
318207

319208
For more information on using Azure tags, see [Use Azure tags in Azure Kubernetes Service (AKS)][use-tags].

0 commit comments

Comments
 (0)