Skip to content

Commit 81be57e

Browse files
authored
Merge pull request #251964 from khdownie/kendownie091823
clone volume
2 parents 25226e5 + a1aac41 commit 81be57e

File tree

3 files changed

+112
-4
lines changed

3 files changed

+112
-4
lines changed

articles/storage/container-storage/TOC.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
- name: Use volume snapshot and restore
2323
href: volume-snapshot-restore.md
2424
- name: Expand a persistent volume
25-
href: resize-volume.md
25+
href: resize-volume.md
26+
- name: Clone a persistent volume
27+
href: clone-volume.md
2628
- name: Remove Azure Container Storage
2729
href: remove-container-storage.md
2830
- name: Concepts
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: Clone persistent volumes in Azure Container Storage Preview
3+
description: Clone persistent volumes in Azure Container Storage Preview. You can only clone volumes of the same size that are in the same storage pool.
4+
author: khdownie
5+
ms.service: azure-container-storage
6+
ms.topic: how-to
7+
ms.date: 09/18/2023
8+
ms.author: kendownie
9+
---
10+
11+
# Clone persistent volumes in Azure Container Storage Preview
12+
You can clone persistent volumes in [Azure Container Storage](container-storage-introduction.md). A cloned volume is a duplicate of an existing persistent volume. You can only clone volumes of the same size that are in the same storage pool.
13+
14+
## Prerequisites
15+
16+
- 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.
17+
- 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).
18+
- 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.
19+
20+
## Clone a volume
21+
22+
Follow the instructions below to clone a persistent volume.
23+
24+
1. Use your favorite text editor to create a YAML manifest file such as `code acstor-clonevolume.yaml`.
25+
26+
1. Paste in the following code and save the file. A built-in storage class supports volume cloning, so for **dataSource** be sure to reference a PVC previously created by the Azure Container Storage storage class. For example, if you created the PVC for Azure Disks, it might be called `azurediskpvc`. For **storage**, specify the size of the original PVC.
27+
28+
```yml
29+
apiVersion: v1
30+
kind: PersistentVolumeClaim
31+
metadata:
32+
name: pvc-acstor-cloning
33+
spec:
34+
accessModes:
35+
- ReadWriteOnce
36+
storageClassName: acstor-azuredisk
37+
resources:
38+
requests:
39+
storage: 100Gi
40+
dataSource:
41+
kind: PersistentVolumeClaim
42+
name: azurediskpvc
43+
```
44+
45+
1. Apply the YAML manifest file to clone the PVC.
46+
47+
```azurecli-interactive
48+
kubectl apply -f acstor-clonevolume.yaml
49+
```
50+
51+
You should see output similar to:
52+
53+
```output
54+
persistentvolumeclaim/pvc-acstor-cloning created
55+
```
56+
57+
1. Use your favorite text editor to create a YAML manifest file such as `code acstor-pod.yaml`.
58+
59+
1. Paste in the following code and save the file. For **claimName**, be sure to reference the cloned PVC.
60+
61+
```yml
62+
kind: Pod
63+
apiVersion: v1
64+
metadata:
65+
name: fiopod2
66+
spec:
67+
nodeSelector:
68+
acstor.azure.com/io-engine: acstor
69+
volumes:
70+
- name: azurediskpv
71+
persistentVolumeClaim:
72+
claimName: pvc-acstor-cloning
73+
containers:
74+
- name: fio
75+
image: nixery.dev/shell/fio
76+
args:
77+
- sleep
78+
- "1000000"
79+
volumeMounts:
80+
- mountPath: "/volume"
81+
name: azurediskpv
82+
```
83+
84+
1. Apply the YAML manifest file to deploy the new pod.
85+
86+
```azurecli-interactive
87+
kubectl apply -f acstor-pod.yaml
88+
```
89+
90+
You should see output similar to the following:
91+
92+
```output
93+
pod/fiopod2 created
94+
```
95+
96+
1. Check that the pod is running and that the persistent volume claim has been bound successfully to the pod:
97+
98+
```azurecli-interactive
99+
kubectl describe pod fiopod2
100+
kubectl describe pvc azurediskpvc
101+
```
102+
103+
104+
## See also
105+
106+
- [What is Azure Container Storage?](container-storage-introduction.md)

articles/storage/container-storage/container-storage-introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: An overview of Azure Container Storage Preview, a service built nat
44
author: khdownie
55
ms.service: azure-container-storage
66
ms.topic: overview
7-
ms.date: 09/07/2023
7+
ms.date: 09/18/2023
88
ms.author: kendownie
99
ms.custom: references_regions
1010
---
@@ -51,8 +51,8 @@ Azure Container Storage offers persistent volume support with ReadWriteOnce acce
5151

5252
Based on feedback from customers, we've included the following capabilities in the Azure Container Storage Preview update:
5353

54-
- Scale up by resizing volumes backed by Azure Disks and NVMe storage pools without downtime
55-
- Clone persistent volumes within a storage pool
54+
- Scale up by [resizing volumes](resize-volume.md) backed by Azure Disks and NVMe storage pools without downtime
55+
- [Clone persistent volumes](clone-volume.md) within a storage pool
5656

5757
For more information on these features, email the Azure Container Storage team at [email protected].
5858

0 commit comments

Comments
 (0)