cannot create device on nodes with the scripts

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

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

yaroslav (staff)
Staff
Posts: 3599
Joined: Mon Nov 18, 2019 11:11 am

Mon Nov 04, 2024 4:50 am

That's not quite my script: There is no line with {0}'s in my script.
$syncInterface="#p2={0}:3260" -f $addr2,
I did it on purpose so you can see how you can set the IPs there.
It uses what you've set for $addr2 as the IP, causing it to conflict with the heartbeat address below.
msgabler
Posts: 13
Joined: Tue Oct 29, 2024 4:09 pm

Mon Nov 04, 2024 2:03 pm

OK, thanks, but where is "your script"?

I took the ones from C:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell that came with the actual starwind vsan installation.

You mean that "{0}" should be replaced with the IP from the second node in the first node declarations and with the IP from the first node in the second node declarations like this:


param($addr="192.168.10.10", $port=3261, $user="root", $password="starwind",
$addr2="192.168.10.191", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1848576,
$sectorSize=4096,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="My computer\D\VSAN",
$imageName="masterImg3",
$createImage=$true,
$storageName="",
$targetAlias="targetha3",
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=0,
$syncInterface="#p2=192.168.10.191:3260" -f $addr2,
$hbInterface="#p4=192.168.10.67:3260,192.168.10.144:3260",
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="My computer\D\VSAN",
$imageName2="partnerImg3",
$createImage2=$true,
$storageName2="",
$targetAlias2="partnerha3",
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.10.10:3260" -f $addr,
$hbInterface2="#p3=192.168.10.66:3260,192.168.10.79:3260",
$createTarget2=$true,
$bmpFolderPath2=""
)

Again, it does create imagefile1, but nothing happens on node 2...
msgabler
Posts: 13
Joined: Tue Oct 29, 2024 4:09 pm

Mon Nov 04, 2024 2:14 pm

This does also only create imagefile1 on node1. What is missing that it will work also for node2?:

param($addr="192.168.10.10", $port=3261, $user="root", $password="starwind",
$addr2="192.168.10.191", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1848576,
$sectorSize=4096,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="My computer\D\VSAN",
$imageName="masterImg4",
$createImage=$true,
$storageName="",
$targetAlias="targetha4",
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=0,
$syncInterface="#p2=192.168.10.191:3260",
$hbInterface="#p2=192.168.10.67:3260,192.168.10.144:3260",
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="My computer\D\VSAN",
$imageName2="partnerImg4",
$createImage2=$true,
$storageName2="",
$targetAlias2="partnerha4",
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.10.10:3260",
$hbInterface2="#p1=192.168.10.66:3260,192.168.10.79:3260",
$createTarget2=$true,
$bmpFolderPath2=""
)
yaroslav (staff)
Staff
Posts: 3599
Joined: Mon Nov 18, 2019 11:11 am

Mon Nov 04, 2024 2:43 pm

Could you check if the iSCSI Target Server role is installed on your hosts? If so, uninstall it.
by "my script" I was referring to the script form here viewtopic.php?f=5&t=6852&p=37208&hilit=HINT8#p37208 (the last script you shared does not look like one I provided $initMethod is different)
I will just repost the entire thread here.

Code: Select all

param($addr="172.27.31.198", $port=3261, $user="root", $password="starwind",
	$addr2="172.27.31.199", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="NotSynchronize",
	$size=1024,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="/mnt/sdb1/volume1",
	$imageName="test2",
	$createImage=$true,
	$storageName="",
	$targetAlias="test2",
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2=172.16.20.231:3260,172.27.21.231:3260",
	$hbInterface="#p2=172.16.10.231:3260,172.27.31.199:3260",
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="/mnt/sdb1/volume1",
	$imageName2="test2",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="test2",
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.16.20.230:3260,172.27.21.230:3260",
	$hbInterface2="#p1=172.16.10.230:3260,172.27.31.198:3260",
	$createTarget2=$true,
	$bmpFolderPath2=""
	)
and the comments to it
That's the top section of the script. This one is for creating a 2-node HA device, still same applies to CreateHA_3.ps1 and devices created with a heartbeat failover strategy.
Parameters description can be found here https://www.starwindsoftware.com/resour ... chine-cvm/

HINT1
initMethod can be
NotSynchronize - skips synchronization (works ONLY IF THERE IS NO DATA TO SKIP THE ORIGINAL SYNCHRONIZATION).
Clear - default
SyncFromFirst or SyncFromSecond or SyncFromThird - runs full synchronization from the specific node. Use it for recreating replicas.

HINT2
Size is in MB.

HINT3
Check more on bitmap types here https://knowledgebase.starwindsoftware. ... a-devices/.
If you are not sure which one to choose or if there is no faster storage than the DATA disk connected, leave it as is.

HINT4
/ and \ in imagePath are not the same :)

HINT5
imageName can be whatever you like and aligns with ASCII. I always use the same name for simplicity.

HINT6
storageName is used only if you plan adding the partner to the existing device. For CreateHA_2.ps1 use, leave it as is.

HINT7
Do not change poolName.

HINT8
Before turning on the cache read these KBs
How cache works https://knowledgebase.starwindsoftware. ... rinciples/
How to remove RAM cache https://knowledgebase.starwindsoftware. ... -l1-cache/ and SSD cache
Full synchronization causes https://knowledgebase.starwindsoftware. ... may-start/
What to do in case of blackout (sync may not start automatically after power failures/restart mishandles when the write-back cache is on) https://knowledgebase.starwindsoftware. ... -blackout/

HINT9
Make sure that at least one StarWind comm goes over a different NIC to avoid split-brain https://www.starwindsoftware.com/blog/w ... -avoid-it/
More at https://www.starwindsoftware.com/system-requirements
You are welcome to add multiple $syncInterface= and $hbInterface= IPs (yes, you need to type the IP address of the partner as a value).

HINT10
root/starwind are the default credentials to communicate with the service. They stay the same regardless of the CVM credentials (we plan to align them in the future)
msgabler
Posts: 13
Joined: Tue Oct 29, 2024 4:09 pm

Mon Nov 04, 2024 6:49 pm

Thanks, adoptd it to your script, creates test1.img and test1.swdsk.bak under D:\VSAN on node1

iSCSI target service was installed, removed it on both servers.

Also changed IPs of sync adapters to the other 10G NIC Ports to be sure, cause they are not shared with Hyper-V Virtual Adapters.

But still, on node 2, nothing happens...
msgabler
Posts: 13
Joined: Tue Oct 29, 2024 4:09 pm

Mon Nov 04, 2024 6:51 pm

here´s the script used (declaration part):

param($addr="192.168.10.9", $port=3261, $user="root", $password="starwind",
$addr2="192.168.10.179", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="NotSynchronize",
$size=1848576,
$sectorSize=4096,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="My computer\D\VSAN",
$imageName="test1",
$createImage=$true,
$storageName="",
$targetAlias="test1",
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=0,
$syncInterface="#p2=192.168.10.179:3260",
$hbInterface="#p2=192.168.10.67:3260,192.168.10.144:3260",
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="My computer\D\VSAN",
$imageName2="test1",
$createImage2=$true,
$storageName2="",
$targetAlias2="test1",
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.10.9:3260",
$hbInterface2="#p1=192.168.10.66:3260,192.168.10.79:3260",
$createTarget2=$true,
$bmpFolderPath2=""
)
yaroslav (staff)
Staff
Posts: 3599
Joined: Mon Nov 18, 2019 11:11 am

Tue Nov 05, 2024 8:09 am

Log a call with StarWind Support (please use 1238533 and link to this thread as your reference https://www.starwindsoftware.com/support-form).
Post Reply