Software-based VM-centric and flash-friendly VM storage + free version
Moderators: anton (staff), art (staff), Anatoly (staff), Max (staff)
-
starwinduser
- Posts: 3
- Joined: Fri Oct 03, 2014 4:28 am
Fri Oct 03, 2014 4:38 am
There is complete lack of documentation in using StarWind powershell module.
Im getting very informative error when creating HA target:
Exception Exception calling "CreateDevice" with "4" argument(s): "Error:
200 Failed: operation cannot be completed.. "
I suppose node.Size parameter in GB and node.CacheSize in MB?
Code: Select all
try
{
$server = New-SWServer -host 172.17.4.4 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\C\CLUSTER\QUORUM\"
$firstNode.ImageName = "QuorumComp4"
$firstNode.Size = 24
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "quorum4"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=172.17.4.4:3260"
$firstNode.HBInterface = "#p2=192.168.203.4:3260"
$firstNode.CacheSize = 64
$firstNode.CacheMode = "wb"
$firstNode.PoolName = "pool1"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$secondNode = new-Object Node
$secondNode.HostName = "172.17.5.5"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\C\CLUSTER\QUORUM\"
$secondNode.ImageName = "QuorumComp5"
$secondNode.Size = 24
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "quorum5"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=172.17.5.5:3260"
$secondNode.HBInterface = "#p1=192.168.203.5:3260"
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect()
-
Anatoly (staff)
- Staff
- Posts: 1675
- Joined: Tue Mar 01, 2011 8:28 am
-
Contact:
Fri Oct 03, 2014 1:49 pm
Hi!
First of all I`d like to apologize for the lack of documentation. We are working on get it ready.
Currently you can use
get-help. PoSh command to get help information.
In your case it is possible to run one of the following commands:
or
Please take into account that
size is using megabytes by default.
Also we suspect that there is missocnfiguration on the interfaces. If we understound correctly, here is how it should be configured:
Code: Select all
$firstNode.SyncInterface = "#p2=172.17.5.5:3260"
$firstNode.HBInterface = "#p2=192.168.203.5:3260"
...
$secondNode.SyncInterface = "#p1=172.17.4.4:3260"
$secondNode.HBInterface = "#p1=192.168.203.4:3260"
I hope that makes sense.
Best regards,
Anatoly Vilchinsky
Global Engineering and Support Manager
www.starwind.com
av@starwind.com
-
starwinduser
- Posts: 3
- Joined: Fri Oct 03, 2014 4:28 am
Fri Oct 03, 2014 4:34 pm
I swapped nodes IP as you suggested but that didn't help. I created HA target manually using Management Console, but unfortunately I could not find Get-HADevice powershell function. Is there such a function?
-
Tarass (Staff)
- Staff
- Posts: 113
- Joined: Mon Oct 06, 2014 10:40 am
Mon Oct 06, 2014 11:26 am
Hi!
You can use the following code to get the list of devices and their properties:
Code: Select all
$server = New-SWServer -host XX.XX.XX.XX -user root -password starwind -port 3261
$server.Connect()
if ( $server.Connected )
{
write-host "Devices:"
foreach($device in $server.Devices)
{
$device
}
$server.Disconnect()
}
Or this one to get the list of device names only:
Code: Select all
$server = New-SWServer -host XX.XX.XX.XX -user root -password starwind -port 3261
$server.Connect()
if ( $server.Connected )
{
write-host "Devices:"
foreach($device in $server.Devices)
{
$device.name
}
$server.Disconnect()
}
Let me know if it does not work for you.
Senior Technical Support Engineer
StarWind Software Inc.
-
Tarass (Staff)
- Staff
- Posts: 113
- Joined: Mon Oct 06, 2014 10:40 am
Mon Oct 06, 2014 1:51 pm
Hi again,
In order to create an HA target you need to use the script like in sample below. Please take notes below the code into account, otherwise you will continue getting errors:
Code: Select all
Import-Module StarWindX
try
{
$server = New-SWServer -host XX.XX.XX.XX -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\S"
$firstNode.ImageName = "masterImg1"
$firstNode.Size = 256
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "targetha1"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=XX.XX.XX.XX:3260"
$firstNode.HBInterface = "#p2=XX.XX.XX.XX:3260"
$firstNode.CacheSize = 64
$firstNode.CacheMode = "wb"
$firstNode.PoolName = "pool1"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$secondNode = new-Object Node
$secondNode.HostName = "XX.XX.XX.XX"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\S"
$secondNode.ImageName = "partnerImg1"
$secondNode.Size = 256
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "partnerha1"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=XX.XX.XX.XX:3260"
$secondNode.HBInterface = "#p1=XX.XX.XX.XX:3260"
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect()
Notes:
- sync and HB interfaces should be not partner server ip's, but the ip's of the node you are editing
- ImagePath should not contain trailing slash
- ImageName should not contain extension
- TargetAlias should not contain capital letters
Let me know about the result.
Senior Technical Support Engineer
StarWind Software Inc.
-
starwinduser
- Posts: 3
- Joined: Fri Oct 03, 2014 4:28 am
Mon Oct 06, 2014 8:41 pm
finally I made it work by
setting sync and HB interfaces to partner server ip, and
setting same target alias name for both nodes
Code: Select all
try
{
$server = New-SWServer -host 172.17.4.4 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\C\CLUSTER\QUORUM"
$firstNode.ImageName = "quorum"
$firstNode.Size = 1024
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "quorum"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=172.17.5.5:3260"
$firstNode.HBInterface = "#p2=192.168.203.5:3260"
$firstNode.CacheSize = 64
$firstNode.CacheMode = "none"
$firstNode.PoolName = "poolquorum"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$secondNode = new-Object Node
$secondNode.HostName = "172.17.5.5"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\C\CLUSTER\QUORUM"
$secondNode.ImageName = "quorum"
$secondNode.Size = 1024
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "quorum"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=172.17.4.4:3260"
$secondNode.HBInterface = "#p1=192.168.203.4:3260"
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
-
johnk
- Posts: 2
- Joined: Fri Oct 10, 2014 5:02 pm
Fri Oct 10, 2014 7:27 pm
Found an example
Code: Select all
Import-Module StarWindX
try
{
$server = New-SWServer -host 10.1.6.161 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\C\hastorage4"
$firstNode.ImageName = "haimage4"
$firstNode.Size = 1024
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "hatarget4"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=172.16.110.2:3260;#p3=172.16.114.3:3260"
$firstNode.HBInterface = "#p2=172.16.1.2:3260;#p3=172.16.1.3:3260"
$firstNode.CacheSize = 1024
$firstNode.CacheMode = "wb"
$firstNode.PoolName = "pool1"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$secondNode = new-Object Node
$secondNode.HostName = "10.1.6.162"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\C\hastorage"
$secondNode.ImageName = "haimage4"
$secondNode.Size = 1024
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "hatarget4"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=172.16.110.1:3260;#p3=172.16.112.3:3260"
$secondNode.HBInterface = "#p1=172.16.1.1:3260;#p3=172.16.1.3:3260"
$secondNode.ALUAOptimized = $true
$thirdNode = new-Object Node
$thirdNode.HostName = "10.1.6.163"
$thirdNode.HostPort = "3261"
$thirdNode.Login = "root"
$thirdNode.Password = "starwind"
$thirdNode.ImagePath = "My computer\C\hastorage"
$thirdNode.ImageName = "haimage4"
$thirdNode.Size = 1024
$thirdNode.CreateImage = $true
$thirdNode.TargetAlias = "hatarget4"
$thirdNode.AutoSynch = $true
$thirdNode.SyncInterface = "#p1=172.16.114.1:3260;#p2=172.16.112.2:3260"
$thirdNode.HBInterface = "#p1=172.16.1.1:3260;#p2=172.16.1.2:3260"
$thirdNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -thirdNode $thirdNode -initMethod "Clear"
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect()
However I get an error:
Exception Exception calling "CreateDevice" with "4" argument(s): "Error:
200 Failed: operation cannot be completed.. "
Any ideas how to correct this ?
-
Tarass (Staff)
- Staff
- Posts: 113
- Joined: Mon Oct 06, 2014 10:40 am
Mon Oct 13, 2014 2:36 pm
Hi!
Could you please provide your network diagram with ip adresses reserved for sync and heartbeat included. Thank you
Senior Technical Support Engineer
StarWind Software Inc.
-
Tarass (Staff)
- Staff
- Posts: 113
- Joined: Mon Oct 06, 2014 10:40 am
Tue Oct 14, 2014 5:47 pm
Hi John,
A quick recap on our conversation: we have succeeded adding a third node replica by specifying the correct name for Starwind .swdsk header file.
If you have any further findings regarding StarwindX PowerShell module, post them here or send an e-mail directly to support. Thank you
Senior Technical Support Engineer
StarWind Software Inc.
-
ivan@webcluster.com
- Posts: 1
- Joined: Fri May 26, 2017 4:08 am
Tue May 30, 2017 5:16 am
Most likely you do not have the folder pre-created before you execute the command:
$firstNode.ImagePath = "My computer\C\hastorage4"
Make sure you have a folder called hastorage4 on the c:\ of your machine.