Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article explains how to connect to an Elastic SAN volume from an individual Windows client. For details on connecting from a Linux client, see Connect to Elastic SAN volumes - Linux.
In this article, you configure your volume group to allow connections from your subnet and then you configure your client environment to connect to an Elastic SAN volume and establish an iSCSI connection. For best performance, ensure that your VM and your Elastic SAN are in the same zone.
You must use a cluster manager when connecting an individual Elastic SAN volume to multiple clients. For details, see Use clustered applications on Azure Elastic SAN.
Prerequisites
- Use either the latest Azure CLI or install the latest Azure PowerShell module
- Deploy an Elastic SAN
- Either configure private endpoints or configure service endpoints
Enable iSCSI Initiator
To create iSCSI connections from a Windows client, confirm the iSCSI service is running. If it's not, start the service, and set it to start automatically.
# Confirm iSCSI is running
Get-Service -Name MSiSCSI
# If it's not running, start it
Start-Service -Name MSiSCSI
# Set it to start automatically
Set-Service -Name MSiSCSI -StartupType Automatic
Install Multipath I/O
To achieve higher IOPS and throughput to a volume and reach its maximum limits, you need to create multiple-sessions from the iSCSI initiator to the target volume based on your application's multi-threaded capabilities and performance requirements. You need Multipath I/O to aggregate these multiple paths into a single device, and to improve performance by optimally distributing I/O over all available paths based on a load balancing policy.
Install Multipath I/O, enable multipath support for iSCSI devices, and set a default load balancing policy.
# Install Multipath-IO
Add-WindowsFeature -Name 'Multipath-IO'
# Verify if the installation was successful
Get-WindowsFeature -Name 'Multipath-IO'
# Enable multipath support for iSCSI devices
Enable-MSDSMAutomaticClaim -BusType iSCSI
# Set the default load balancing policy based on your requirements. In this example, we set it to round robin
# which should be optimal for most workloads.
mpclaim -L -M 2
Attach volumes to the client
Use the following script to create your connections. To execute it, collect or determine the following parameters:
- $rgname: Resource Group Name
- $esanname: Elastic SAN Name
- $vgname: Volume Group Name
- $vol1: First Volume Name
- $vol2: Second Volume Name and other volume names that you might require
- 32: Number of sessions to each volume
Copy the script from here and save it as a .ps1 file, for example, connect.ps1. Then execute it with the required parameters. The following is an example of how to run the script:
./connect.ps1 $rgname $esanname $vgname $vol1,$vol2,$vol3 32
Set session number
Before you run the script, determine how many sessions your volume needs. To be able to reach a volume's highest IOPS and throughput capacities, you'll need 32 sessions. But, because Windows iSCSI initiator has a maximum of 256 sessions, you may need to use fewer than 32 sessions if you're connecting more than eight volumes to a Windows client.
Note
Use the -NumSession
parameter to set the number of sessions. The parameter accepts values from 1 to 32, and has a default value of 32.
.\connect.ps1 `
-ResourceGroupName "<resource-group>" `
-ElasticSanName "<esan-name>" `
-VolumeGroupName "<volume-group>" `
-VolumeName "<volume1>", "<volume2>" `
-NumSession “<value>”
Verify the number of sessions your volume has with either iscsicli SessionList
or mpclaim -s -d