Configure Shared Storage for Microsoft Failover Clusters with PowerShell

In this tutorial we will access the storage via iSCSI protocol. We will use the remoting capabilities of PowerShell to manage the server remotely.

  1. Open a new PowerShell Remote Session to the server
    1. enter-pssession server name (you should see the server name at the beginning of the PowerShell command line)

Change MSISCSI Service to Automatic

By default the ISCSI service is not started. You will have to start the service.

  1. Configure the service to start automatically. Set-Service MSISCSI -StartUpType Automatic
  2. Check the status of the service. Get-Service MSISCSI
  3. Start the MS ISCSI Service. Start-Service MSISCSI
  4. Check Status of the service again. Get-Service MSISCSI

  5. Check the startup parameters for the MSISCSI service. Get-WMIObject Win32_Service | Where-Object {$_.Name -eq “MSISCSI”}

Configure ISCSI Portal

Let's configure the ISCSI portal that will provide us access to the storage.

  1. New-ISCSITargetPortal -TargetPortalAddress

Connect to ISCSI Targets

Let's connect to the ISCSI Portal and get all the allocated disks

  1. To the the list of devices. Get-IscsiTarget

  2. Make a permanent connection to the disks. Get-IscsiTarget | Select NodeAddress | Connect-IscsiTarget -IsPersistent $true . You should see a similar output for each disk assigned from your ISCSI server.

  3. To get a list of your new ISCSI disk you can use the Get-Disk commandlet.

Configure Cluster Disks

  1. Get-Disk
  2. Bring disk 3 online:

    Set-disk –number 3 –IsOffline 0

  3. Make disk 3 writable:

    Set-disk –number 3 –isReadOnly 0

  4. Initialize the disk 3:

    Initialize-Disk -Number 3 -PartitionStyle MBR

  5. Create a partition on disk 3 (To avoid a format volume popup in Windows Explorer, let's not assign a drive letter at this time. We will do that after the volume is formatted)

    New-Partition -DiskNumber 3 -UseMaximumSize -AssignDriveLetter:$False

  6. Format volume:

    Get-Partition –DiskNumber 3 | Format-Volume

  7. Repeat the steps 1 – 6 for each disk

Configure MPIO

In order to provide multiple paths to your ISCSI server you will need to configure the MPIO feature. This is required to pass the Failover Cluster Validation report with out errors.

  1. Get-WindowsOptionalFeature –Online –FeatureName MultiPathIO

  2. If you need to enable your feature execute. Enable-WindowsOptionalFeature –Online –FeatureName MultiPathIO
  3. Set the Automatic Claim rule for the ISCSI Bus. Enable-MSDSMAutomaticClaim –BusType ISCSI. You will need to reboot your host for this to take effect.

  4. Reboot your server with the Restart-Computer commandlet.
  5. Enter into a new PowerShell Session again . Enter-PSsession servername
  6. Set Round Robin Policy. Set-MSDSMGlobalDefaultLoadBalancePolicy –Policy RR
  7. Set the Windows Disk Time Out Value. Set-MPIOSetting –NewDiskTimeOut 60
  8. Restart the server again. Restart-Computer.

Subscribe For Latest Updates

Sign up for best of digital marketing, livestream and technology opinions on what matters to you.

Invalid email address
We promise not to spam you. You can unsubscribe at any time.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: