Skip to content

Commit d2b2cc2

Browse files
committed
Adding export commands.
1 parent a5206ee commit d2b2cc2

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

articles/storage/elastic-san/elastic-san-snapshots.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: roygara
55
ms.service: azure-elastic-san-storage
66
ms.custom: devx-track-azurepowershell
77
ms.topic: conceptual
8-
ms.date: 02/13/2024
8+
ms.date: 03/11/2024
99
ms.author: rogarana
1010
---
1111

@@ -149,8 +149,6 @@ az elastic-san volume snapshot delete -g "resourceGroupName" -e "san_name" -v "v
149149

150150
Elastic SAN volume snapshots are automatically deleted when the volume is deleted. If you need your snapshot's data to persist beyond deletion, export them to managed disk snapshots. The export process will take time and will depend on the size of the snapshot. You can check how much is left before completion by checking the CompletionPercentage property of the managed disk snapshot. Once you export an elastic SAN snapshot to a managed disk snapshot, the managed disk snapshot begins to incur billing charges. Elastic SAN snapshots don't have any extra billing associated with them, they only consume your elastic SAN's capacity.
151151

152-
Currently, you can only export snapshots using the Azure portal. The Azure PowerShell module and the Azure CLI can't be used to export snapshots.
153-
154152
# [Portal](#tab/azure-portal)
155153

156154
1. Navigate to your elastic SAN and select **Volume snapshots**.
@@ -159,24 +157,38 @@ Currently, you can only export snapshots using the Azure portal. The Azure Power
159157

160158
# [PowerShell](#tab/azure-powershell)
161159

160+
Replace the variables in the following script, then run it:
161+
162162
```azurepowershell
163-
$elasticSanVolumeSnapshotResourceId = "<yourSnapshotResourceID>"
163+
$elasticSanName = <nameHere>
164+
$volGroupName = <nameHere>
164165
$region = <yourRegion>
165166
$rgName = <yourResourceGroupName>
167+
$elasticSanSnapshotName = <ElasticSanSnapshotName>
166168
$newSnapName = <NameOfNewSnapshot>
167169
170+
$elasticSanVolumeSnapshotResourceId = (Get-AzElasticSanVolumeSnapshot -ElasticSanName $elasticSanName -ResourceGroupName $rgName -VolumeGroupName $volGroupName -name $elasticSanSnapshotName).Id
171+
168172
$snapshotconfig = New-AzSnapshotConfig -Location $region -AccountType Standard_LRS -CreateOption CopyFromSanSnapshot -ElasticSanResourceId $elasticSanVolumeSnapshotResourceId
169173
New-AzSnapshot -ResourceGroupName $rgName -SnapshotName $newSnapName -Snapshot $snapshotconfig;
170174
```
171175

172176

173177
# [Azure CLI](#tab/azure-cli)
174178

179+
Replace the variables in the following script, then run it:
180+
175181
```azurecli
182+
region=<yourRegion>
183+
rgName=<ResourceGroupName>
184+
sanName=<yourElasticSANName>
185+
vgName=<yourVolumeGroupName>
186+
sanSnapName=<yourElasticSANSnapshotName>
187+
diskSnapName=<nameForNewDiskSnapshot>
176188
177-
snapID=$(az elastic-san volume snapshot show -g "rg" -e "san_name" -v "vg_name" -n "snapshot_name")
189+
snapID=$(az elastic-san volume snapshot show -g $rgName -e $sanName -v $vgName -n $sanSnapName --query 'id' | tr -d \"~)
178190
179-
az snapshot create -g "resourceGroupName" -n "snapshotName" --elastic-san-id <yourElasticSANSnapshotURI>
191+
az snapshot create -g $rgName --name $diskSnapName --elastic-san-id $snapID --location $region
180192
```
181193

182194

@@ -186,15 +198,7 @@ az snapshot create -g "resourceGroupName" -n "snapshotName" --elastic-san-id <yo
186198

187199
Currently, you can only use the Azure portal to create Elastic SAN volumes from managed disks snapshots. The Azure PowerShell module and the Azure CLI can't be used to create Elastic SAN volumes from managed disk snapshots. Managed disk snapshots must be in the same region as your elastic SAN to create volumes with them.
188200

189-
# [Portal](#tab/azure-portal)
190-
191201
1. Navigate to your SAN and select **volumes**.
192202
1. Select **Create volume**.
193203
1. For **Source type** select **Disk snapshot** and fill out the rest of the values.
194204
1. Select **Create**.
195-
196-
# [PowerShell](#tab/azure-powershell)
197-
198-
# [Azure CLI](#tab/azure-cli)
199-
200-
---

0 commit comments

Comments
 (0)