Add RAM Cache and several sync channels via powershell

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Fri Aug 31, 2018 7:52 am

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
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Fri Aug 31, 2018 9:26 am

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.
Sekkmer
Posts: 29
Joined: Thu Mar 08, 2018 12:11 pm

Fri Aug 31, 2018 10:16 am

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
Oleg(staff)
Staff
Posts: 568
Joined: Fri Nov 24, 2017 7:52 am

Mon Sep 03, 2018 9:08 am

Hello Sekkmer,
Thank you for your reply and community help.
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Wed Sep 05, 2018 7:51 am

Sekkmer wrote:well you can edit Sync/HB channels after creation
...
It's working well, thanx =]
Michael (staff)
Staff
Posts: 317
Joined: Thu Jul 21, 2016 10:16 am

Mon Oct 08, 2018 8:36 am

Great!
Post Reply