Page 1 of 1

Add RAM Cache and several sync channels via powershell

Posted: Fri Aug 31, 2018 7:52 am
by serhiogo
Hello collegues,
I'm trying to use sample "CreateHA(two nodes).ps1" script to create a cluser storages. It's working fine as is.
But I need some "advanced" features not covered by this script.
Is it possible to
- add some RAM cache (with different caching policy options - wb, wt) while creating device as I can do it via GUI? Is it "CacheMode" and "CacheSize" parameters of a "new-Object" call or something else?
- use more than one sync and HB channel if I run MPIO over several IP subnets? Assume I use two iSCSI subnets for HB and other two subnets for sync.

WBR, SerhioGo

Re: Add RAM Cache and several sync channels via powershell

Posted: Fri Aug 31, 2018 9:26 am
by serhiogo
serhiogo wrote:- add some RAM cache (with different caching policy options - wb, wt) while creating device as I can do it via GUI? Is it "CacheMode" and "CacheSize" parameters of a "new-Object" call or something else?
Self answer is YES =]

Some code need to be added...

Code: Select all

        $firstNode.CacheMode = "wb"              # "wb" for write-back or "wt" for write-through
        $firstNode.CacheSize = 1024               # cache size in Megabytes
...for the first node and...

Code: Select all

        $secondNode.CacheMode = "wb"              # "wb" for write-back or "wt" for write-through
        $secondNode.CacheSize = 1024               # cache size in Megabytes
...for the second one.

It was found by starwind.cfg content analyzing.

The question about additional sync and HB channels is still actual.

WBR, SerhioGo.

Re: Add RAM Cache and several sync channels via powershell

Posted: Fri Aug 31, 2018 10:16 am
by Sekkmer
well you can edit Sync/HB channels after creation

$server (StarWind Server)
$device (HADevice)

$params = new-object -ComObject StarWindX.Parameters

$params.AppendParam("AddRemovePartnerInterface","")
$params.AppendParam("sendTo",$device.DeviceId)
$params.AppendParam("action","add") // "add", "remove"
$params.AppendParam("PartnerTargetName",$device.GetPropertyValue("ha_partner_node1_target_name")) // node2 for the third node (partner target name)
$params.AppendParam("ChannelType","sync") // "sync", "heartbeat"
$params.AppendParam("IP","192.168.73.62") // interface ip
$params.AppendParam("Port","3260") // port for starwind (it might be 3261 i am not sure sould be the same as all other)
$params.AppendParam("Priority","0")

$server.ExecuteCommand(1, "", $params)

I work with C# and so my PowerShell implementation might be wrong and my implementation there a bit different so you can look into that if you are interested

Here is the function for the interface edit (RemovePartnerInterface, AddPartnerInterface)
https://github.com/Sekkmer/StarWindXExt ... viceExt.cs

and here is the class which implements the parameters mentioned above:
https://github.com/Sekkmer/StarWindXExt ... eEditor.cs

Re: Add RAM Cache and several sync channels via powershell

Posted: Mon Sep 03, 2018 9:08 am
by Oleg(staff)
Hello Sekkmer,
Thank you for your reply and community help.

Re: Add RAM Cache and several sync channels via powershell

Posted: Wed Sep 05, 2018 7:51 am
by serhiogo
Sekkmer wrote:well you can edit Sync/HB channels after creation
...
It's working well, thanx =]

Re: Add RAM Cache and several sync channels via powershell

Posted: Mon Oct 08, 2018 8:36 am
by Michael (staff)
Great!