The machines are the same as when I did it with the GUI, the only thing I changed is that I unmade the NIC-team on Sync and Hearthbeat as was suggested to me on ServerFault so there are 2 connections instead of one. FYI it didn't work with only one so that didn't help.
Here's an image of the Nodes and Nics, sorry for the very simple stuff, I don't know what would be needed to help more.

Here's the creation scripts, with some changes (and comments) added from someone on the forum here (Jeff I think ?) for the witness, the storage has the same scripts with changes to size, names and cachemode.
Code: Select all
Import-Module StarWindX
try
{
$server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind
$server.Connect()
# Define the object $firstNode using "new-Object Node"
$firstNode = new-Object Node
# IP address (below) is the address of Host 1.
$firstNode.HostName = "192.168.1.41"
# The ImagePath is written in a sudo-linux style. # Whereas "C:\VSAN" = "My Computer\C\VSAN" or "D:\Data" = "My Computer\D\Data"
$firstNode.ImagePath = "My computer\V\VSAN"
$firstNode.ImageName = "Witness"
# 102400 = 100GB; 51200 = 50GB; 20480 = 20GB; 1024 = 1GB (based on 1024=1GB)
$firstNode.Size = 1024
# Sets the active command to create the image upon running of script. (DUH)
$firstNode.CreateImage = $true
# Sets the "TargetAlias" to "targetha1"
$firstNode.TargetAlias = "Witness"
# Sets the Sync to "AUTO" (DUH)
$firstNode.AutoSynch = $true
# SyncInterface (below) is the target interface on the 2nd system, Host 2.
$firstNode.SyncInterface = "#p2=10.0.0.2:3260,10.0.0.12:3260;#p3=10.0.0.3:3260,10.0.0.13:3260"
# HBInterface (below) is the target interface on the 2nd system, Host 2.
$firstNode.HBInterface = "#p2=10.0.0.130:3260,10.0.0.140:3260;#p3=10.0.0.131:3260,10.0.0.141:3260"
$firstNode.CacheSize = 128 # CacheMode: wb = write back; wt = write through # If you are going to store virtual machines on this SAN, use WT. $firstNode.CacheMode = "wb"
$firstNode.PoolName = ""
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true # Device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. # For Hyper-V use 4096 sector size. (suggested by Starwind) $firstNode.SectorSize = 512
$secondNode = new-Object Node
# IP address (below) is the address of Host 2.
$secondNode.HostName = "192.168.1.42"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\V\VSAN"
$secondNode.ImageName = "Witness"
$secondNode.Size = 1024
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "Witness"
$secondNode.AutoSynch = $true
# SyncInterface (below) is the target interface on the 1st system, Host 1.
$secondNode.SyncInterface = "#p1=10.0.0.1:3260,10.0.0.11:3260;#p3=10.0.0.3:3260,10.0.0.13:3260"
# HBInterface (below) is the target interface on the 1st system, Host 1.
$secondNode.HBInterface = "#p1=10.0.0.129:3260,10.0.0.139:3260;#p3=10.0.0.131:3260,10.0.0.141:3260"
$secondNode.ALUAOptimized = $true
$thirdNode = new-Object Node
$thirdNode.HostName = "192.168.1.43"
$thirdNode.HostPort = "3261"
$thirdNode.Login = "root"
$thirdNode.Password = "starwind"
$thirdNode.ImagePath = "My computer\V\VSAN"
$thirdNode.ImageName = "Witness"
$thirdNode.Size = 1024
$thirdNode.CreateImage = $true
$thirdNode.TargetAlias = "Witness"
$thirdNode.AutoSynch = $true
$thirdNode.SyncInterface = "#p1=10.0.0.1:3260,10.0.0.11:3260;#p2=10.0.0.2:3260,10.0.0.12:3260"
$thirdNode.HBInterface = "#p1=10.0.0.129:3260,10.0.0.139:3260;#p2=10.0.0.130:3260,10.0.0.140:3260"
$thirdNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -thirdNode $thirdNode -initMethod "Clear"
$syncState = $device.GetPropertyValue("ha_synch_status")
while ($syncState -ne "1")
{
#
# Refresh device info
#
$device.Refresh()
$syncState = $device.GetPropertyValue("ha_synch_status")
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Start-Sleep -m 2000
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
After creating second device I get an error message that says :
Code: Select all
Request to SRVR-DATA01.EXAMPLE.COM ( 127.0.0.1 ) : 3261
-
control 0x00000131E3AC2F80 -InitSynchronize: -SynchronizationType:"3"
-
200 Failed: can't establish connection with the partner(s)..
Code: Select all
Targets:
Name : iqn.2008-08.com.starwindsoftware:192.168.1.41-witness
Id : 0x00000131E3A9E340
Alias : Witness
IsClustered : True
Devices : System.__ComObject
Permissions : System.__ComObject
type :
Devices:
Name : HAImage1
DeviceType : HA Image
DeviceId : 0x00000131E3AC2F80
File : My computer\V\VSAN\Witness_HA.swdsk
TargetName : iqn.2008-08.com.starwindsoftware:192.168.1.41-witness
TargetId : 0x00000131E3A9E340
Size : 1073741824
CacheMode : wb
CacheSize : 128
CacheBlockExpiryPeriod : 5000
Exists : True
DeviceLUN : 0
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Partners : System.__ComObject
SynchronizationChannels : System.__ComObject
HeartbeatChannels : System.__ComObject
SyncStatus : 1
SyncTrafficShare : 50
Name : imagefile1
DeviceType : Image file
DeviceId : 0x00000131E390E5C0
File : My computer\V\VSAN\Witness.img
TargetName : empty
TargetId : empty
Size : 1073741824
CacheMode : wb
CacheSize : 128
CacheBlockExpiryPeriod : 5000
Exists : True
DeviceLUN :
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Code: Select all
Targets:
Name : iqn.2008-08.com.starwindsoftware:192.168.1.41-witness
Id : 0x00000131E3A9E340
Alias : Witness
IsClustered : True
Devices : System.__ComObject
Permissions : System.__ComObject
type :
Name : iqn.2008-08.com.starwindsoftware:192.168.1.41-storage
Id : 0x00000131E3BF1480
Alias : Storage
IsClustered : True
Devices : System.__ComObject
Permissions : System.__ComObject
type :
Devices:
Name : HAImage1
DeviceType : HA Image
DeviceId : 0x00000131E3AC2F80
File : My computer\V\VSAN\Witness_HA.swdsk
TargetName : iqn.2008-08.com.starwindsoftware:192.168.1.41-witness
TargetId : 0x00000131E3A9E340
Size : 1073741824
CacheMode : wb
CacheSize : 128
CacheBlockExpiryPeriod : 5000
Exists : True
DeviceLUN : 0
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Partners : System.__ComObject
SynchronizationChannels : System.__ComObject
HeartbeatChannels : System.__ComObject
SyncStatus : 1
SyncTrafficShare : 50
Name : imagefile2
DeviceType : Image file
DeviceId : 0x00000131E3AE7000
File : My computer\V\VSAN\Storage.img
TargetName : empty
TargetId : empty
Size : 1610612736000
CacheMode : wt
CacheSize : 128
CacheBlockExpiryPeriod : 5000
Exists : True
DeviceLUN :
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Name : imagefile1
DeviceType : Image file
DeviceId : 0x00000131E390E5C0
File : My computer\V\VSAN\Witness.img
TargetName : empty
TargetId : empty
Size : 1073741824
CacheMode : wb
CacheSize : 128
CacheBlockExpiryPeriod : 5000
Exists : True
DeviceLUN :
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
192.168.1.41 to iqn.2008-08.com.starwindsoftware:192.168.1.41-witness
Code: Select all
HAImage1.
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.41-witness'
Exception Request to DATA01.EXAMPLE.COM ( 192.168.1.41 ) : 3261
-
control 0x00000131E3AC2F80 -RestorePartnerNode:"iqn.2008-08.com.starwindsoftware:192.168.1.41-witness"
-
200 Failed: can't find partner node..
Code: Select all
HAImage1.
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.42-witness'
Exception Request to DATA01.EXAMPLE.COM ( 192.168.1.41 ) : 3261
-
control 0x00000131E3AC2F80 -RestorePartnerNode:"iqn.2008-08.com.starwindsoftware:192.168.1.42-witness"
-
200 Failed: connection with partner node is invalid..
Code: Select all
HAImage1.
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.43-witness'
Exception Request to DATA01.EXAMPLE.COM ( 192.168.1.41 ) : 3261
-
control 0x00000131E3AC2F80 -RestorePartnerNode:"iqn.2008-08.com.starwindsoftware:192.168.1.43-witness"
-
200 Failed: connection with partner node is invalid..
Code: Select all
HAImage1.
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.41-witness'
Exception Request to DATA02.EXAMPLE.COM ( 192.168.1.42 ) : 3261
-
control 0x00000131E3AC2F80 -RestorePartnerNode:"iqn.2008-08.com.starwindsoftware:192.168.1.41-witness"
-
200 Failed: connection with partner node is invalid..
Code: Select all
HAImage1.
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.42-witness'
Exception Request to DATA02.EXAMPLE.COM ( 192.168.1.42 ) : 3261
-
control 0x00000131E3AC2F80 -RestorePartnerNode:"iqn.2008-08.com.starwindsoftware:192.168.1.42-witness"
-
200 Failed: can't find partner node..
Code: Select all
HAImage1.
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.43-witness'
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.43-witness'
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.43-witness'
Device not synchronized. Synchronize current node from partner 'iqn.2008-08.com.starwindsoftware:192.168.1.43-witness'
over and over
Code: Select all
HAImage1.
Synchronization Status: Synchronized
Code: Select all
HAImage1.
Synchronization Status: Synchronized
Code: Select all
HAImage1.
Synchronization Status: Synchronized
I continue and take care of the ISCSI initiator/MPIO, I should be able to connect but MPIO would not work for the second device made. There is only one HAImage1 made and it is for the first target (in this case witness) and I am wondering if this is why the second one cannot be configurared ?
Here's my walkthrough after the not synchronized part :
I configured MPIO for iscsi devices on each nodes, server rebooted afterwards.
Add targets on each node :
DATA01
Code: Select all
127.0.0.1:3260 Microsoft ISCSI Initiator Defaut
10.0.0.2:3260 Microsoft ISCSI Initiator 10.0.0.1
10.0.0.3:3260 Microsoft ISCSI Initiator 10.0.0.1
10.0.0.12:3260 Microsoft ISCSI Initiator 10.0.0.11 (failed until I did the other servers before creating storage)
10.0.0.13:3260 Microsoft ISCSI Initiator 10.0.0.11 (idem)
Code: Select all
127.0.0.1:3260 Microsoft ISCSI Initiator Defaut
10.0.0.1:3260 Microsoft ISCSI Initiator 10.0.0.2
10.0.0.3:3260 Microsoft ISCSI Initiator 10.0.0.2
10.0.0.11:3260 Microsoft ISCSI Initiator 10.0.0.12
10.0.0.13:3260 Microsoft ISCSI Initiator 10.0.0.12
Code: Select all
127.0.0.1:3260 Microsoft ISCSI Initiator Defaut
10.0.0.1:3260 Microsoft ISCSI Initiator 10.0.0.3
10.0.0.2:3260 Microsoft ISCSI Initiator 10.0.0.3
10.0.0.11:3260 Microsoft ISCSI Initiator 10.0.0.13
10.0.0.12:3260 Microsoft ISCSI Initiator 10.0.0.13
So my connections are :
DATA01 iqn.2008-08.com.starwindsoftware:192.168.1.41-witness default/127.0.0.1
DATA01 iqn.2008-08.com.starwindsoftware:192.168.1.42-witness 10.0.0.1/10.0.0.2 10.0.0.11/10.0.0.2
DATA01 iqn.2008-08.com.starwindsoftware:192.168.1.43-witness 10.0.0.1/10.0.0.3 10.0.0.11/10.0.0.3
DATA02 iqn.2008-08.com.starwindsoftware:192.168.1.41-witness 10.0.0.2/10.0.0.1 10.0.0.12/10.0.0.1
DATA02 iqn.2008-08.com.starwindsoftware:192.168.1.42-witness default/127.0.0.1
DATA02 iqn.2008-08.com.starwindsoftware:192.168.1.43-witness 10.0.0.2/10.0.0.3 10.0.0.12/10.0.0.3
DATA03 iqn.2008-08.com.starwindsoftware:192.168.1.41-witness 10.0.0.3/10.0.0.1 10.0.0.13/10.0.0.1
DATA03 iqn.2008-08.com.starwindsoftware:192.168.1.42-witness 10.0.0.3/10.0.0.2 10.0.0.13/10.0.0.2
DATA03 iqn.2008-08.com.starwindsoftware:192.168.1.43-witness default/127.0.0.1
Switch witness to storage for its connections.
I now have to configure MPIO for the devices (failover on 127.0.0.1) works for the first one (witness in this case) but it's not available for the second one (storage).
So the configuration I end up with is :
DATA01 iqn.2008-08.com.starwindsoftware:192.168.1.41-witness MPIO -> failover
DATA02 iqn.2008-08.com.starwindsoftware:192.168.1.42-witness MPIO -> failover
DATA03 iqn.2008-08.com.starwindsoftware:192.168.1.43-witness MPIO -> failover
No devices available for storage.
I tried doing both witness and storage at the same time and then only witness and adding storage later but still the same problems.
If I continue I can configure (in disk management) the witness but not the storage (since I couldn't configure MPIO).
I think I wrote it all, but if there is something missing ask away!
This is not the first time I have redone it. To do that I delete the targets and devices and make sure that I have no files leftover. I have tried reinstalling the OS but it didn't change naything so I have not redone it in a while.