Skip to content

Commit f993489

Browse files
authored
Merge pull request #265332 from adarshv98/patch-10
Update elastic-san-delete.md
2 parents a92a52c + fb52ea4 commit f993489

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

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

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,32 @@ Your Elastic storage area network (SAN) resources can be deleted at different re
1717

1818
### Windows
1919

20-
To delete iSCSI connections to volumes, you'll need to get **StorageTargetIQN**, **StorageTargetPortalHostName**, and **StorageTargetPortalPort** from your Azure Elastic SAN volume.
21-
22-
Run the following commands to get these values:
23-
24-
```azurepowershell
25-
# Get the target name and iSCSI portal name to connect a volume to a client
26-
$connectVolume = Get-AzElasticSanVolume -ResourceGroupName $resourceGroupName -ElasticSanName $sanName -VolumeGroupName $searchedVolumeGroup -Name $searchedVolume
27-
$connectVolume.storagetargetiqn
28-
$connectVolume.storagetargetportalhostname
29-
$connectVolume.storagetargetportalport
30-
```
31-
32-
Note down the values for **StorageTargetIQN**, **StorageTargetPortalHostName**, and **StorageTargetPortalPort**, you'll need them for the next commands.
33-
34-
In your compute client, retrieve the sessionID for the Elastic SAN volumes you'd like to disconnect using `iscsicli SessionList`.
35-
36-
Replace **yourStorageTargetIQN**, **yourStorageTargetPortalHostName**, and **yourStorageTargetPortalPort** with the values you kept, then run the following commands from your compute client to disconnect an Elastic SAN volume.
20+
You can use the following script to delete your connections. To execute it, you require the following parameters:
21+
- $ResourceGroupName: Resource Group Name
22+
- $ElasticSanName: Elastic SAN Name
23+
- $VolumeGroupName: Volume Group Name
24+
- $VolumeName: List of Volumes to be disconnected (comma separated)
3725

26+
Copy the script from [here](https://github.com/Azure-Samples/azure-elastic-san/blob/main/PSH%20(Windows)%20Multi-Session%20Connect%20Scripts/ElasticSanDocScripts0523/disconnect.ps1) 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:
3827
```
39-
iscsicli RemovePersistentTarget ROOT\ISCSIPRT\0000_0 $yourStorageTargetIQN -1 $yourStorageTargetPortalPort $yourStorageTargetPortalHostName
40-
41-
iscsicli LogoutTarget <sessionID>
28+
./disconnect.ps1 $ResourceGroupName $ElasticSanName $VolumeGroupName $VolumeName
4229
4330
```
4431

4532
### Linux
4633

47-
To delete iSCSI connections to volumes, you'll need to get **StorageTargetIQN**, **StorageTargetPortalHostName**, and **StorageTargetPortalPort** from your Azure Elastic SAN volume.
48-
49-
Run the following command to get these values:
50-
51-
```azurecli
52-
az elastic-san volume-group list -e $sanName -g $resourceGroupName -v $searchedVolumeGroup -n $searchedVolume
53-
```
34+
You can use the following script to create your connections. To execute it, you will require the following parameters:
5435

55-
Note down the values for **StorageTargetIQN**, **StorageTargetPortalHostName**, and **StorageTargetPortalPort**, you'll need them for the next commands.
36+
- subscription: Subscription ID
37+
- g: Resource Group Name
38+
- e: Elastic SAN Name
39+
- v: Volume Group Name
40+
- n <vol1, vol2, ...>: Names of volumes 1 and 2 and other volume names that you might require, comma separated
5641

57-
Replace **yourStorageTargetIQN**, **yourStorageTargetPortalHostName**, and **yourStorageTargetPortalPort** with the values you kept, then run the following commands from your compute client to connect an Elastic SAN volume.
42+
Copy the script from [here](https://github.com/Azure-Samples/azure-elastic-san/blob/main/CLI%20(Linux)%20Multi-Session%20Connect%20Scripts/disconnect_for_documentation.py) 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:
5843

5944
```
60-
iscsiadm --mode node --target **yourStorageTargetIQN** --portal **yourStorageTargetPortalHostName**:**yourStorageTargetPortalPort** --logout
45+
./disconnect.py --subscription <subid> -g <rgname> -e <esanname> -v <vgname> -n <vol1, vol2>
6146
```
6247

6348
## Delete a SAN

0 commit comments

Comments
 (0)