Delete an Elastic SAN
Your Elastic storage area network (SAN) resources can be deleted at different resource levels. This article covers the overall deletion process, starting from disconnecting iSCSI connections to volumes, deleting the volumes themselves, deleting a volume group, and deleting an elastic SAN itself. Before you delete your elastic SAN, make sure it's not being used in any running workloads.
Disconnect volumes from clients
Windows
You can use the following script to delete your connections. To execute it, you require the following parameters:
- $ResourceGroupName: Resource Group Name
- $ElasticSanName: Elastic SAN Name
- $VolumeGroupName: Volume Group Name
- $VolumeName: List of Volumes to be disconnected (comma separated)
Copy the script from here and save it as a .ps1 file, for example, disconnect.ps1. Then execute it with the required parameters. The following is an example of how to run the script:
./disconnect.ps1 $ResourceGroupName $ElasticSanName $VolumeGroupName $VolumeName
Linux
You can use the following script to create your connections. To execute it, you'll require the following parameters:
- subscription: Subscription ID
- g: Resource Group Name
- e: Elastic SAN Name
- v: Volume Group Name
- n <vol1, vol2, ...>: Names of volumes 1 and 2 and other volume names that you might require, comma separated
Copy the script from here and save it as a .py file, for example, disconnect.py. Then execute it with the required parameters. The following is an example of how you'd run the script:
./disconnect.py --subscription <subid> -g <rgname> -e <esanname> -v <vgname> -n <vol1, vol2>
Delete a SAN
You can delete your SAN by using the Azure portal, Azure PowerShell, or Azure CLI. If you delete a SAN or a volume group, the corresponding child resources are deleted along with it. The delete commands for each of the resource levels are below.
The following commands delete your volumes. These commands use ForceDelete false
, -DeleteSnapshot false
, --x-ms-force-delete false
, and --x-ms-delete-snapshots false
parameters for PowerShell and CLI, respectively. If you set ForceDelete
or --x-ms-force-delete
to true
, it causes volume deletion to succeed even if you have active iSCSI connections. If you set -DeleteSnapshot
or --x-ms-delete-snapshots
to true
, it deletes all snapshots associated with the volume, and the volume itself.
Remove-AzElasticSanVolume -ResourceGroupName $resourceGroupName -ElasticSanName $sanName -VolumeGroupName $volumeGroupName -Name $volumeName -ForceDelete false -DeleteSnapshot false
To delete volume groups, run the following commands.
Remove-AzElasticSanVolumeGroup -ResourceGroupName $resourceGroupName -ElasticSanName $sanName -Name $volumeGroupName
To delete the Elastic SAN itself, run the following commands.
Remove-AzElasticSan -ResourceGroupName $resourceGroupName -Name $sanName