I'm trying to test 2-node Hyper-V 2012 R2 cluster with SW vSAN Free.
Without SW console.
I have several problems:
1. I cannot create HA imagefile device with sector size 4096. This parameter just ignored. And device gets 512 bytes sector.
Code: Select all
Import-Module StarWindX
try
{
$server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = "testcluster1"
$firstNode.ImagePath = "My computer\E\Storage1"
$firstNode.ImageName = "Storage1"
$firstNode.Size = 5000
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "storage1"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=192.168.12.2:3260"
$firstNode.HBInterface = "#p2=192.168.11.2:3260"
$firstNode.PoolName = "pool1"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$firstNode.CacheSize = 128
$firstNode.CacheMode = "wb"
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = 4096
#
# 'SerialID' should be between 16 and 31 symbols. If it not specified StarWind Service will generate it.
# Note: Second node always has the same serial ID. You do not need to specify it for second node
#
#$firstNode.SerialID = "050176c0b535403ba3ce02102e33eac"
$secondNode = new-Object Node
$secondNode.HostName = "testcluster2"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\E\Storage1"
$secondNode.ImageName = "Storage1"
$secondNode.Size = 5000
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "storage1"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=192.168.12.1:3260"
$secondNode.HBInterface = "#p1=192.168.11.1:3260"
$secondNode.SyncSessionCount = 1
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "clear"
while ($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
{
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
Start-Sleep -m 2000
$device.Refresh()
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
Is sequence
Code: Select all
Remove-Device "imagefile1"
Remove-Device "HAImage1"
Remove-Target
3. MPIO enabled, and it worked before, when I tested via GUI.
One HAdevice. iSCSI targets connected, one to 127.0.0.1, second to partner's target via heartbeat channel 192.168.11.0.
iScsiDiscoveryListInterfaces set to 1 on both nodes.
But now after I create device via Powershell I cannot set MPIO policy because there is only one path listed in "Device details" per iSCSI target. And I see two identical disk devices in disk management instead of single disk.
I've tried to solve this several days.
Today I've rebooted whole system after device creation and connection. And suddenly I've got two paths! And at last I can set MPIO policy.
Is it necessary to reboot system when work via powershell in this case?
But something is still wrong. MPIO does not work yet.
In iscscpl-Targets-select_local_target-Devices I see two disks instead of one and still have two disk copies in disk management
What do I do wrong?