Software-based VM-centric and flash-friendly VM storage + free version
Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)
-
hljsec
- Posts: 3
- Joined: Wed Jan 03, 2018 7:48 am
Wed Jan 03, 2018 7:55 am
Hi StarWind
When creating a number of HA (LSFS) devices and targets, with the sample script, it works on the first device, but any subsequent devices that I try to create through the script fails.
Through trial and error, I have found out the it seems that your library does NOT name the HA device correctly. I.e. the first HA device is named HAImage1 automatically. The next device should have been named HAImage2, but your library tries to use the name HAImage1. Therefore the creation fails.
There does not seem to be any method of naming the HA device manually, hence no workaround.
Is there any plans on fixing this bug in the near future?
BR
HLJ
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Wed Jan 03, 2018 9:19 am
Can you post the script you used for creating multiple devices? I suspect you did not rename every next device properly throughout the script, but just used the same name (HAimage1) multiple times...
-
hljsec
- Posts: 3
- Joined: Wed Jan 03, 2018 7:48 am
Wed Jan 03, 2018 10:03 am
Hi Boris
Thanks for the reply.
I have made sure that any subsequent runs does not have duplicate values. Furthermore, there is NO way to assign a name for the HA device (as far as I can see). StarWind MUST assign this automatically.
So, again, I have no idea how to fix this - other than StarWind fixing their bug in the library.
But anyway, here is the script for reference:
Import-Module StarWindX
$error.Clear()
$node1 = "hv01.xgate.dk"
$node2 = "hv02.xgate.dk"
$node1PartnerSyncInterface = "#p2=192.168.201.4:3260"
$node1PartnerHBInterface = "#p2=192.168.100.4:3260"
$node2PartnerSyncInterface = "#p1=192.168.201.2:3260"
$node2PartnerHBInterface = "#p1=192.168.100.2:3260"
$node1ImageName = ""
$node2ImageName = ""
$Node1SwRootfolder = "My Computer\C\StarWind"
$Node1WinRootfolder = "c:\StarWind"
$Node2SwRootfolder = "My Computer\C\StarWind"
$Node2WinRootfolder = "c:\StarWind"
$Size = 1024
$SectorSize = 512
$Cachemode = "wt"
$Cachesize = 16
$targetAlias = "CLU10"
$targetAlias = $TargetAlias.ToLower()
$node1targetName = "iqn.2008-08.com.starwindsoftware:$node1-$targetAlias"
$node2targetName = "iqn.2008-08.com.starwindsoftware:$node2-$targetAlias"
$ImageName = $targetAlias
$PoolName = ""
$filesubfolder = $targetAlias
$targetAlias = $targetAlias.ToLower()
if($filesubfolder.length -gt 0) {
$Node1SwFullpath = $Node1SwRootfolder + "\" + $filesubfolder
$Node1WinFullpath = $Node1WinRootfolder + "\" + $filesubfolder
$Node2SwFullpath = $Node2SwRootfolder + "\" + $filesubfolder
$Node2WinFullpath = $Node2WinRootfolder + "\" + $filesubfolder
} else {
$Node1SwFullpath = $Node1SwRootfolder
$Node1WinFullpath = $Node1WinRootfolder
$Node2SwFullpath = $Node2SwRootfolder
$Node2WinFullpath = $Node2WinRootfolder
}
$Node1WinFullpath = "\\"+$node1+"\"+$Node1WinFullpath.Replace(":", "$")
$Node2WinFullpath = "\\"+$node2+"\"+$Node2WinFullpath.Replace(":", "$")
new-item -type directory -path $Node1WinFullpath -force | Out-Null
new-item -type directory -path $Node2WinFullpath -force | Out-Null
$Node1SwFullpath
$Node1WinFullpath
$Node2SwFullpath
$Node2WinFullpath
try
{
$server = New-SWServer -host $node1 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = $node1
$firstnode.CreateImage = $true
$firstNode.ImagePath = $Node1SwFullpath
$firstNode.ImageName = "AA"
$firstNode.Size = $Size
$firstNode.TargetName = $node1targetName
$firstNode.TargetAlias = $targetAlias
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = $node1PartnerSyncInterface
$firstNode.HBInterface = $node1PartnerHBInterface
#$firstNode.PoolName = $PoolName
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$firstNode.CacheMode = $Cachemode
$firstnode.CacheSize = $Cachesize
$firstNode.StorageType = [StarWindFileType]::STARWIND_DD_FILE
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = $SectorSize
#
# '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 = "050176a0b535403cb3ce02102a33bae"
$secondNode = new-Object Node
$secondNode.HostName = $node2
#$secondNode.CreateImage = $true
#$secondNode.PoolName = $PoolName
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = $Node2SwFullpath
$secondNode.ImageName = "BB"
$secondNode.Size = $Size
$secondNode.TargetName = $node2targetName
$secondNode.TargetAlias = $targetAlias
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = $node2PartnerSyncInterface
$secondNode.HBInterface = $node2PartnerHBInterface
$secondNode.ALUAOptimized = $true
$secondNode.CacheMode = $Cachemode
$secondNode.CacheSize = $Cachesize
$secondNode.StorageType = [StarWindFileType]::STARWIND_DD_FILE
$error.Count
ForEach($e in $error) {
$e.Exception
$e.ErrorDetails
}
$error.Clear()
Try {
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
} Catch {
If((Get-Service -Name "StarWindService" -ComputerName $node1).Status -ne "Running") {
Start-Service -InputObject $(Get-Service -Name "StarWindService" -ComputerName $node1)
}
If((Get-Service -Name "StarWindService" -ComputerName $node2).Status -ne "Running") {
Start-Service -InputObject $(Get-Service -Name "StarWindService" -ComputerName $node2)
}
}
$error.Count
ForEach($e in $error) {
$e.Exception
$e.ErrorDetails
}
If((Get-Service -Name "StarWindService" -ComputerName $node1).Status -ne "Running") {
Start-Service -InputObject $(Get-Service -Name "StarWindService" -ComputerName $node1)
}
If((Get-Service -Name "StarWindService" -ComputerName $node2).Status -ne "Running") {
Start-Service -InputObject $(Get-Service -Name "StarWindService" -ComputerName $node2)
}
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()
}
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Thu Jan 04, 2018 2:40 pm
I have done some investigation and here are the results.
I do not confirm the library has got a bug in terms of HA devices order naming. I tried creating new HA LSFS device on my test nodes that had already had 3 HA device by that time and the two subsequent runs gave me HAimage4 and HAimage5 respectively. Yet, for this test runs I used the sample script from the StarWindX examples. As far as your script is concerned, it kept giving me an error, which I was not able to trace for some reason. So, the easiest way for you would be taking the sample script CreateHA_LSFS.ps1 and take the relevant part into yours with certain amendments like IPs etc.
Let me know it that works better for you. If not, I will try to investigate your script deeper.
-
hljsec
- Posts: 3
- Joined: Wed Jan 03, 2018 7:48 am
Sat Jan 06, 2018 5:28 pm
Hi Boris
Thanks for the reply.
As part of my own troubleshooting, I have already done this at its most simple way that can possibly be done; I.e. take the sample script and ONLY changing the parameters relevant. Same result. The first time it's run, the HA device is created just fine. Second run (with minor changes to avoid duplicates in naming etc.), it fails the same way as with my script. That's why my conclusion was that this must be some sort of bug that has gone unnoticed.
My guess is that the bug has been introduced through simple regression; i.e. the scripts has been working just fine with prior versions of the software, but a minor change to the code in a recent version of either the library or the product has made the things fail.
As a sidenote. Errorhandling in generalt is not that, uhm, pretty. Through my testing and development of scripts, I have successfully caused the StarWind Service itself crash numerous times. That should never be possible. Instead the library (or the product itself) should simply through an exception gracefully and continue on its way. Usually the crashes have been caused by some minor mistakes on my part (wrong parameter/input, etc), but still, the service itself should never crash like that...
-
madmongoose
- Posts: 16
- Joined: Mon Aug 21, 2017 8:05 am
Wed Feb 07, 2018 3:22 pm
Hello!
I have some problem in version V8 build 11818 . I cannot create a 2, 3,.. HAImage. I use img, not LSFS.
This is my script of first device:
Code: Select all
Import-Module StarWindX
try
{
$server = New-SWServer -host 10.131.1.61 -port 3261 -user svc -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = "10.131.1.61"
$firstNode.ImagePath = "My computer\d\ais-vsan\ais-iscsi-quorum"
$firstNode.ImageName = "ais-iscsi-quorum"
$firstNode.Size = 20480
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "ais-iscsi-quorum"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=172.31.1.62:3260"
$firstNode.HBInterface = "#p2=10.131.1.62:3260"
$firstNode.PoolName = ""
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = 512
#
# '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 = "050176c0b535403ba3ce02102e33eab"
$secondNode = new-Object Node
$secondNode.HostName = "10.131.1.62"
$secondNode.HostPort = "3261"
$secondNode.Login = "svc"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\d\ais-vsan\ais-iscsi-quorum"
$secondNode.ImageName = "ais-iscsi-quorum"
$secondNode.Size = 20480
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "ais-iscsi-quorum"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=172.31.1.61:3260"
$secondNode.HBInterface = "#p1=10.131.1.61: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()
}
and second device:
Code: Select all
Import-Module StarWindX
try
{
$server = New-SWServer -host 10.131.1.61 -port 3261 -user svc -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = "10.131.1.61"
$firstNode.ImagePath = "My computer\d\ais-vsan\ais-iscsi-fs"
$firstNode.ImageName = "ais-iscsi-fs"
$firstNode.Size = 1024
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "ais-iscsi-fs"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=172.31.1.62:3260"
$firstNode.HBInterface = "#p2=10.131.1.62:3260"
$firstNode.PoolName = ""
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = 512
#
# '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 = "160287c0b535403ba4ce02102e33eab"
$secondNode = new-Object Node
$secondNode.HostName = "10.131.1.62"
$secondNode.HostPort = "3261"
$secondNode.Login = "svc"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\d\ais-vsan\ais-iscsi-fs"
$secondNode.ImageName = "ais-iscsi-fs"
$secondNode.Size = 1024
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "ais-iscsi-fs"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=172.31.1.61:3260"
$secondNode.HBInterface = "#p1=10.131.1.61: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()
}
As a result, I get only one HA device:
Code: Select all
enumDevicesTargets.ps1
Targets:
Name : iqn.2008-08.com.starwindsoftware:10.131.1.62-ais-iscsi-quorum
Id : 0x0000013D8B6D71C0
Alias : ais-iscsi-quorum
IsClustered : True
Devices : System.__ComObject
Permissions : System.__ComObject
type :
Name : iqn.2008-08.com.starwindsoftware:10.131.1.62-ais-iscsi-slow
Id : 0x0000013D8B6DD180
Alias : ais-iscsi-slow
IsClustered : True
Devices : System.__ComObject
Permissions : System.__ComObject
type :
Name : iqn.2008-08.com.starwindsoftware:10.131.1.62-ais-iscsi-fs
Id : 0x0000013D8B6DCA80
Alias : ais-iscsi-fs
IsClustered : True
Devices : System.__ComObject
Permissions : System.__ComObject
type :
Devices:
Name : HAImage1
DeviceType : HA Image
DeviceId : 0x0000013D8B40E2C0
File : My computer\d\ais-vsan\ais-iscsi-quorum\ais-iscsi-quorum_HA.swdsk
TargetName : iqn.2008-08.com.starwindsoftware:10.131.1.62-ais-iscsi-quorum
TargetId : 0x0000013D8B6D71C0
Size : 21474836480
CacheMode : none
CacheSize : 0
CacheBlockExpiryPeriod : 0
Exists : True
DeviceLUN : 0
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Partners : System.__ComObject
SynchronizationChannels : System.__ComObject
HeartbeatChannels : System.__ComObject
SyncStatus : 3
SyncTrafficShare : 50
Name : imagefile3
DeviceType : Image file
DeviceId : 0x0000013D8B6CB4C0
File : My computer\d\ais-vsan\ais-iscsi-slow\ais-iscsi-slow.img
TargetName : empty
TargetId : empty
Size : 1073741824
CacheMode : none
CacheSize : empty
CacheBlockExpiryPeriod : empty
Exists : True
DeviceLUN :
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Name : imagefile2
DeviceType : Image file
DeviceId : 0x0000013D8B6BB000
File : My computer\d\ais-vsan\ais-iscsi-fs\ais-iscsi-fs.img
TargetName : empty
TargetId : empty
Size : 1073741824
CacheMode : none
CacheSize : empty
CacheBlockExpiryPeriod : empty
Exists : True
DeviceLUN :
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Name : imagefile1
DeviceType : Image file
DeviceId : 0x0000013D8B451480
File : My computer\d\ais-vsan\ais-iscsi-quorum\ais-iscsi-quorum.img
TargetName : empty
TargetId : empty
Size : 21474836480
CacheMode : none
CacheSize : empty
CacheBlockExpiryPeriod : empty
Exists : True
DeviceLUN :
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512
State : 0
Pls. I need your help!
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Wed Feb 07, 2018 4:01 pm
Unfortunately, I confirm there is an issue with build 11818 in terms of creating more than 1 HA device from PowerShell. This has already been fixed by StarWind developers and will be included into the next build that is expected to arrive this month.
-
madmongoose
- Posts: 16
- Joined: Mon Aug 21, 2017 8:05 am
Thu Feb 08, 2018 9:20 am
Thanks for the reply.
In the samples scripts to create HA device removed the lines specifying the cache. Does this mean that StarWind recommends that you create a device without cache? Or no? We have 1Gb cache on the RAID controller and we have a lot of free RAM.
In the 4 HA flat device:
Quorum 20 GB with wb cache 128 Mb;
FS 1,5 Tb with wb cache 2048 Mb;
CSV1 2 Tb with wb cache 4096 Mb;
CSV2 1 Tb with wb cache 2048 Mb.
Do you think the cache is enough? Is the configuration ok?
-
madmongoose
- Posts: 16
- Joined: Mon Aug 21, 2017 8:05 am
Thu Feb 08, 2018 12:00 pm
Unfortunately, after installing version 11818, I reinstall 11456 and now the HA device creation does not work in the old version. I cleaned the registry, deleted all the files of StarWinds - it did not help.
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Thu Feb 08, 2018 1:29 pm
As for cache usage, I would recommend avoiding cache on the Witness disk. Apart of that, the rest looks pretty good and reasonable.
Unfortunately, after installing version 11818, I reinstall 11456 and now the HA device creation does not work in the old version. I cleaned the registry, deleted all the files of StarWinds - it did not help.
Please do a clean reinstall of the StarWind VSAN software. Before that uninstall the previous version, check for any files related to StarWind as well as registry keys associated with it. That should work.
-
madmongoose
- Posts: 16
- Joined: Mon Aug 21, 2017 8:05 am
Thu Feb 08, 2018 1:43 pm
Yes, it worked out. Total Uninstaller helped me) While will have to stay on 11456 build.
Thank you, Boris.
-
vladimir@ngsoft.com
- Posts: 4
- Joined: Tue Mar 06, 2018 4:53 pm
Thu Mar 29, 2018 12:05 pm
Boris (staff) wrote:Unfortunately, I confirm there is an issue with build 11818 in terms of creating more than 1 HA device from PowerShell. This has already been fixed by StarWind developers and will be included into the next build that is expected to arrive this month.
Boris, can you please publish the PowerShell fix? We're already at the end of March, and the next version isn't released yet...
Is this safe to manage cluster based on version v8_build_11818 by StarWindX PowerShell library from release v8_build_11456?
Thanks,
Vladimir.
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Thu Mar 29, 2018 1:45 pm
Vladimir,
Unfortunately, the issue is mostly related not to the PowerShell scripts themselves, but rather to the StarWindX library, this is why a separate fix cannot be published otherwise than as a part of the new StarWind VSAN build.
According to the information I have the library got considerable changes in 11818 compared to 11456. I would recommend you downgrading to 11456 if you want to use any PowerShell samples included into the build.