Mount iSCSI LUNS on Microsoft Windows
This tutorial guides you through how to mount an IBM Cloud® Block Storage for Classic volume on a server with the Windows 2019 operating system. You're going to create two connections from one network interface of your host to two target IP addresses of the storage array.
Before you begin
If multiple hosts mount the same Block Storage for Classic volume without being cooperatively managed, your data is at risk for corruption. Volume corruption can occur if changes are made to the volume by multiple hosts at the same time. You need a cluster-aware, shared-disk file system to prevent data loss such as Microsoft Cluster Shared Volumes (CSV), Red Hat Global File System (GFS2), VMware® VMFS, and others. For more information, see your host's OS Documentation.
It's best to run storage traffic on a VLAN, which bypasses the firewall. Running storage traffic through software firewalls increases latency and adversely affects storage performance. For more information about routing storage traffic to its own VLAN interface, see the FAQs.
Before you begin, make sure that the host that is to access the Block Storage for Classic volume is authorized. For more information, see Authorizing the host in the consoleAuthorizing the host from the CLIAuthorizing the host with Terraform.
The following activities are prerequisites on the iSCSI client:
- Installation of Multipath-IO services
- Setting the iSCSI initiator service to start automatically
- Enabling support for multipath MPIO to iSCSI
- Enabling automatic claiming of all iSCSI volumes
It is important to restart the Windows client after installation of these prerequisites. The MPIO load-balancing policy requires a restart so that it can be set.
Installing the MPIO feature
-
Start the Server Manager and browse to Manage, Add Features.
-
Click Next to open the Features menu.
-
Scroll down and check Multipath I/O.
-
Click Next and Install to install MPIO on the host server.
-
Restart the server.
Adding iSCSI support for MPIO devices
-
Open the MPIO Properties window by clicking Start, pointing to Administrative Tools, and clicking MPIO.
-
Click Discover Multi-Paths.
-
Select Add support for iSCSI devices, and click Add.
-
If you're prompted to restart the server, click Yes. Otherwise, continue to the next step.
Configuring the iSCSI Initiator to discover the Target
-
From the Server Manager, start iSCSI Initiator, and select Tools, iSCSI Initiator.
-
Click the Configuration tab.
-
The Initiator Name field might already be populated with an entry similar to
iqn.2024-07.com.ibm:
. -
Click Change to replace existing values with your iSCSI Qualified Name (IQN)[1].
-
Click Discovery, and click Discover Portal.
-
Input the IP address of your iSCSI target and leave the Port at the default value of 3260.
-
Click Advanced to open the Advanced Settings window.
-
On the Local adapter list, select Microsoft iSCSI Initiator.
-
On the Initiator IP list, select the IP address of the host.
-
On the Target Portal IP list, select the IP of one of the storage interfaces.
-
Select Enable CHAP log-on to turn on CHAP authentication.
-
In the Name field, delete any existing entries and input the username from the IBM Cloud console. This field is case-sensitive.
-
In the Target secret field, enter the password from the IBM Cloud console. This field is case-sensitive.
-
Click OK on Advanced Settings and Discover Target Portal windows to get back to the main iSCSI Initiator Properties screen. If you receive authentication errors, check the username and password entries.
-
-
The name of your target appears in the Discovered targets section with an
Inactive
status. Click Connect to connect to the target. -
Select Enable multi-path checkbox to enable multi-path IO to the target.
-
Click Advanced, and select Enable CHAP log-on.
-
Enter the username in the Name[2] field, and enter the password in the Target secret[3] field.
-
Click OK until the iSCSI Initiator Properties window is displayed. The status of the target in the Discovered Targets section changes from Inactive to Connected.
Adding and configuring multiple MPIO sessions
-
Start the iSCSI Initiator, and on the Targets tab, click Properties.
-
Click Add Session on the Properties window.
-
In the Connect to Target dialog box, select Enable multi-path checkbox, and click Advanced.
-
In the Advanced Settings window, update the following fields.
- On the Local adapter list, select Microsoft iSCSI Initiator.
- On the Initiator IP list, select the IP address of the host.
- On the Target Portal IP list, select the IP of one of the storage interfaces.
- Click Enable CHAP log-on checkbox.
- Enter the Name and Target secret values that were obtained from the console and click OK.
- Click OK on the Connect To Target window to go back to the Properties window.
-
Click Properties. In the Properties dialog box, click Add Session again to add the second path.
-
In the Connect to Target window, select the checkbox to Enable multi-path. Click Advanced.
-
In the Advanced Settings window,
- On the Local adapter list, select Microsoft iSCSI Initiator.
- On the Initiator IP list, select the IP address that corresponds to the host. In this case, you are connecting two network interfaces on the storage array to a single network interface on the host. Therefore, this interface is the same as the one that was provided for the first session.
- On the Target Portal IP list, select the IP address for the second interface[4] that is enabled on the storage array.
- Click Enable CHAP log-on checkbox.
- Enter the Name and Target secret values that were obtained from the console and click OK.
- Click OK on the Connect To Target window to go back to the Properties window.
-
Now the Properties window displays more than one session within the Identifier pane. It means that you have more than one session into the iSCSI storage.
If your host has multiple interfaces that you want to connect to the storage, you can set up another connection with the address of the second NIC in the Initiator IP field. However, be sure to authorize the second initiator IP address in the IBM Cloud® console before you attempt to make the connection.
-
In the Properties window, click Devices to open the Devices window. The device interface name start with
mpio
. -
Click MPIO to open the Device Details window. You can choose load balance policies for MPIO in this window and it shows you the paths to the iSCSI. In this example, two paths are shown as available for MPIO.
- Click OK several times to exit the iSCSI Initiator.
Initializing and formatting the Block Storage for Classic volume
- Press the Windows Logo key + X, and then click Run.
- In the Run dialog box, type
Diskmgmt.msc
. Click OK, and the Disk Management dialog box appears. The side pane shows the drives that are attached to your host. - In the Disk Management window, right-click the discovered LUN's name, and then click Online.
- Right-click and select Initialize Disk.
- In the dialog box, select the disk to initialize, and then click OK.
- The New Simple Volume wizard starts. Select a disk size, and then click Next.
- Assign a drive letter to the LUN, and then click Next.
- Enter the parameters to format the LUN.
- On a Windows Server, only NTFS is supported.
- Set the allocation unit size to 64 K.
- Provide a label for your Storage volume.
- Click Next.
- Check the values for your volume, and then click Finish. On the Disk Management page, the volume now appears as Online.
Verifying whether MPIO is configured correctly
It's possible to attach Block Storage for Classic with only a single path, but it is important that connections are established on both paths to ensure no disruption of service. To verify whether Windows MPIO is configured, you must first ensure that the MPIO Add-on is enabled and then restart the server.
After the restart is complete, take the following steps to view all of the active paths.
-
On the desktop, click Start.
-
In the Start Search field, type
diskmgmt.msc
. -
In the Programs list, click
diskmgmt
. -
Right-click each disk for which you want to verify the multiple paths and then click Properties.
-
On the MPIO tab, in the Select the MPIO policy list, click all the paths that are active.
To verify multipathing by using the command line, complete the following steps.
- Open the command prompt.
- Run
mpclaim.exe –v c:\multipathconfig.txt
to capture the multipath configuration. - Review the contents of the
multipathconfig.txt
. Confirm that each of the two paths that are listed for the LUN contain distinct TPG_Id values.
If MPIO isn't configured correctly, your storage device might disconnect and appear offline when a network outage occurs or when IBM Cloud® teams perform maintenance. MPIO ensures an extra level of connectivity during those events, and keeps an established session to the LUN with active read/write operations.
On rare occasions, a LUN is provisioned and attached while the second path is down. In such instances, the host might see one single path when the discovery scan is run. If you encounter this phenomenon, check the IBM Cloud® status page to see whether a current event might impact your host's ability to access the storage. If no events are reported, perform the discovery scan again to ensure that all paths are properly discovered. If an event is in progress, the storage can be attached with a single path. However, it's essential that paths are rescanned after the event is completed. If both paths are not discovered after the rescan, create a support case so it can be properly investigated.
Unmounting Block Storage for Classic volumes
To disconnect an iSCSI LUN from a Windows-based IBM Cloud® Compute instance, complete the following steps.
Disconnect the volume from the iSCSI Initiator
- In Server Manager, click Storage > iSCSI.
- Right-click the volume and take it Offline.
- In iSCSI Initiator, click Targets.
- Select the target that you want to remove and click Disconnect.
Removing targets
This step is optional, for when you no longer need to access the iSCSI targets.
- Click Discovery in the iSCSI Initiator.
- Highlight the target portal that is associated with your storage volume and click Remove.
-
The IQN name can be obtained from the Block Storage for Classic Detail screen in the IBM Cloud console. ↩︎
-
The Name and Target secret field values can be obtained from the Block Storage for Classic Detail screen. ↩︎
-
The Name and Target secret field values can be obtained from the Block Storage for Classic Detail screen. ↩︎
-
You can find the second IP address in the Block Storage for Classic Detail screen in the IBM Cloud console. ↩︎