VSAN Free question regarding my configuration

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

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

monodroid
Posts: 2
Joined: Wed Jun 26, 2024 6:02 pm

Thu Jun 27, 2024 12:20 pm

Good afternoon, so first of all, I have done quite a bit of delving, but not of the things I have come across seem to work. There are a few questions in this post, but probably easier just to make it as one, in case there is any overall advice.

So a bit of background:
I am building a two node hyper-v cluster, using two CVM's as discussed in the link in the email, all of this has been going fine, and I have volumes showing up, so yay. BUT I'm now at the part where I move to powershell and command line. I have a few issues here, but I'll start with the smallest and then on to the larger config file issue.

so specs are:
server 2022 x 2
ample networking, and multiples of, so that side is all fine

server one
management 10.27.0.27
data 172.16.10.11
Sync 172.16.20.11

Server two
management 10.27.0.25
data 172.16.10.12
sync 172.16.20.12

both are directly connected to each other (no switch), and verified in the HA networking section.

right so problem 1:
I'm unable to login to the VM interface, or via SSH (I've turned on SSH), I've tried root/starwind, and also user/rds123RDS, neither of which seem to work. I haven't changed the root account, but I did setup an account on the web interface called cvm_admin, but this doesn't seem to work either. So I'm only able to access logs by doing a support dump at the moment, which is a pain for troubleshooting config.

problem 2
I'm using the HA2 node powershell file, and I've filled it in, as best to my knowledge, but I'm getting the following:

Code: Select all

PS C:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell> C:\temp\CreateHA_2.ps1
Request to  10.27.0.27 ( 10.27.0.27 ) : 3261
-
control ImageFile -CreateImage:"VSA Storage\mnt\crypted1\quorum.img" -Size:"1200" -Flat:"True" -DeferredInit:"True" -Password:"starwind"
-
200 Failed: operation cannot be completed.. 
I don't really know what's causing this, and with no decent real time logs to access it's tricky, hence why I'm here. I've attached my full ps1 script below. It might be obvious to someone, and again, sorry if I've missed something really basic.

So in this script, I really just want to provision a basic quorum LUN for HV Failover cluster manager, I have two other luns to create, both at around 2.9tb each, and these are separate volumes in starwind. I'm not sure if I need to modify this script for each lun, or if I can create them all in one go.

Any help/suggestions would be massively appreciated :)

Code: Select all

param($addr="10.27.0.27", $port=3261, $user="root", $password="starwind",
	$addr2="10.27.0.26", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=1200,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\crypted1",
	$imageName="quorum",
	$createImage=$true,
	$storageName="",
    $autosynch=$true,
	$targetAlias="quorum",
	$poolName="sda1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$syncInterface="#p1=172.16.20.11:3260" -f $addr,
	$hbInterface="#p1=172.16.10.11:3260" -f $addr,
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\crypted1",
	$imageName2="quorum2",
	$createImage2=$true,
	$storageName2="",
    $autosynch2=$true,
	$targetAlias2="quorum2",
	$poolName2="sdc1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2="none",
	$cacheSize2=0,
	$syncInterface2="#p2=172.16.20.12:3260" -f $addr2,
	$hbInterface2="#p2=172.16.10.12:3260" -f $addr2,
	$createTarget2=$true,
	$bmpFolderPath2=""
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog

	$server = New-SWServer -host $addr -port $port -user $user -password $password

	$server.Connect()

	$firstNode = new-Object Node

	$firstNode.HostName = $addr
	$firstNode.HostPort = $port
	$firstNode.Login = $user
	$firstNode.Password = $password
	$firstNode.ImagePath = $imagePath
	$firstNode.ImageName = $imageName
	$firstNode.Size = $size
	$firstNode.CreateImage = $createImage
	$firstNode.StorageName = $storageName
	$firstNode.TargetAlias = $targetAlias
	$firstNode.SyncInterface = $syncInterface
	$firstNode.HBInterface = $hbInterface
	$firstNode.PoolName = $poolName
	$firstNode.SyncSessionCount = $syncSessionCount
	$firstNode.ALUAOptimized = $aluaOptimized
	$firstNode.CacheMode = $cacheMode
	$firstNode.CacheSize = $cacheSize
	$firstNode.FailoverStrategy = $failover
	$firstNode.CreateTarget = $createTarget
	$firstNode.BitmapStoreType = $bmpType
	$firstNode.BitmapStrategy = $bmpStrategy
	$firstNode.BitmapFolderPath = $bmpFolderPath
    
	#
	# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. 
	#
	$firstNode.SectorSize = $sectorSize
    
	$secondNode = new-Object Node

	$secondNode.HostName = $addr2
	$secondNode.HostPort = $port2
	$secondNode.Login = $user2
	$secondNode.Password = $password2
	$secondNode.ImagePath = $imagePath2
	$secondNode.ImageName = $imageName2
	$secondNode.CreateImage = $createImage2
	$secondNode.StorageName = $storageName2
	$secondNode.TargetAlias = $targetAlias2
	$secondNode.SyncInterface = $syncInterface2
	$secondNode.HBInterface = $hbInterface2
	$secondNode.SyncSessionCount = $syncSessionCount2
	$secondNode.ALUAOptimized = $aluaOptimized2
	$secondNode.CacheMode = $cacheMode2
	$secondNode.CacheSize = $cacheSize2
	$secondNode.FailoverStrategy = $failover
	$secondNode.CreateTarget = $createTarget2
	$secondNode.BitmapFolderPath = $bmpFolderPath2
        
	$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
    
	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()
}
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Thu Jun 27, 2024 1:14 pm

Welcome to StarWind Forum and thanks for your feedback!
right so problem 1:
I'm unable to login to the VM interface, or via SSH (I've turned on SSH), I've tried root/starwind, and also user/rds123RDS, neither of which seem to work. I haven't changed the root account, but I did setup an account on the web interface called cvm_admin, but this doesn't seem to work either. So I'm only able to access logs by doing a support dump at the moment, which is a pain for troubleshooting config.
Try user/rds123RDS!
The user is created while deploying the VM and walking through the wizard. Make sure it has Administrator privileges. Use it to connect over SSH.
root/starwind does not work for the shell access.
problem 2
I'm using the HA2 node powershell file, and I've filled it in, as best to my knowledge, but I'm getting the following:
Try setting the IPs the other way around. The primary node should list the second node's IPs, while the second node should list the primary node's
Also, try commenting out everything in the script that relates to bitmap.
You can run the script twice to create two volumes. Make sure to change their names and see if there is anything on the underlying storage.
Speaking of the script, there are a bunch of ready-to-go instance on forum.

P.s. Just a friendly advice, set management and heartbeat as redundant links and make sure your systems meet https://www.starwindsoftware.com/system-requirements. Also, make sure that you are running the latest StarWindX (it is typically installed as a component of the *.exe file).
thomas_lt
Posts: 10
Joined: Sat Jun 15, 2024 3:41 pm

Wed Jul 03, 2024 6:54 am

Hi,
I'm having the same issues here. Did you get a chance to finish your setup ?
HA networking is verified (FYI, had to disable VM Queues in the NIC advanced settings to make it work)

I've copied/pasted the script as in the resource library. The only differences are the IP addresses for the nodes (192.168.10.220 , 192.168.10.221)
Deleted the lines related with BMP in the script.

But same error message :

Code: Select all

PS C:\temp> .\createHA_2.ps1
Request to  192.168.10.220 ( 192.168.10.220 ) : 3261
-
control ImageFile -CreateImage:"VSA Storage\mnt\crypted1\testha02.img" -Size:"2048" -Flat:"True" -DeferredInit:"True" -Password:"starwind"
-
200 Failed: operation cannot be completed..
PS C:\temp>
Also, when I tried to figure out why HA networking could not be verified, I was not able to connect to the SSH console with root/starwind and user/rds123RDS!

Can you help please ?
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Wed Jul 03, 2024 7:00 am

Can I see your script please?
monodroid
Posts: 2
Joined: Wed Jun 26, 2024 6:02 pm

Wed Jul 03, 2024 7:26 am

Good morning Yaroslav,

I managed to get some time to look at this yesterday and was able to get it working, spinning up 3 fault tolerant luns across the two nodes. There were a few areas where I made some mistakes

1:
I had mapped port 1 on server one, to port 1 on server 2, or so I thought. Unfortunately I fell into the age old trap of windows assigning and adapter number at whichever one it sees first, and so I had the ip's flipped. What made this worse was that I had used a /16 mask for some reason, and so host 2 iscsi could ping host 1 iscsi, and host 2 cvm_iscsi, however it could not ping the cvm IP on host one. So yes, user error! I'm working on this unit from another site, so not having it physically in front of me threw me a little too I guess. In terms of my working config, I commented out the areas mentioned, and I also changed the image path to reflect that shown in the webui - code shown below.

Over a 25gbps link, with NVME u2 drives on a Dell S150 (software raid), performance is good, and pretty much where I expected it. Hitting around 1.4 GB/s on read, and around 1GB/s writes. This is not a high-performance client, so I am more than happy with those numbers, and have been able to fail a host and have the cluster still stand. I am aware of the best practices for DC's too, so good with that. All I probably need to do is add additional links (as you mentioned), just to allow for some redundancy.

Code: Select all

param($addr="10.27.0.27", $port=3261, $user="root", $password="starwind",
	$addr2="10.27.0.26", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=2800000,
	$sectorSize=512,
	$failover=0,
#	$bmpType=1,
#	$bmpStrategy=0,
#primary node
	$imagePath="/mnt/sdc1/csv2",
	$imageName="csv2",
	$createImage=$true,
	$storageName="",
    $autosynch=$true,
	$targetAlias="csv2",
	$poolName="sdc1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$syncInterface="#p1=172.16.20.12:3260" -f $addr,
	$hbInterface="#p1=172.16.10.12:3260" -f $addr,
	$createTarget=$true,
#	$bmpFolderPath="",
#secondary node
	$imagePath2="/mnt/sdd1/csv2",
	$imageName2="csv2",
	$createImage2=$true,
	$storageName2="",
    $autosynch2=$true,
	$targetAlias2="csv22",
	$poolName2="sdd1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2="none",
	$cacheSize2=0,
	$syncInterface2="#p2=172.16.20.11:3260" -f $addr2,
	$hbInterface2="#p2=172.16.10.11:3260" -f $addr2,
	$createTarget2=$true
#	$bmpFolderPath2=""
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog

	$server = New-SWServer -host $addr -port $port -user $user -password $password

	$server.Connect()

	$firstNode = new-Object Node

	$firstNode.HostName = $addr
	$firstNode.HostPort = $port
	$firstNode.Login = $user
	$firstNode.Password = $password
	$firstNode.ImagePath = $imagePath
	$firstNode.ImageName = $imageName
	$firstNode.Size = $size
	$firstNode.CreateImage = $createImage
	$firstNode.StorageName = $storageName
	$firstNode.TargetAlias = $targetAlias
	$firstNode.SyncInterface = $syncInterface
	$firstNode.HBInterface = $hbInterface
	$firstNode.PoolName = $poolName
	$firstNode.SyncSessionCount = $syncSessionCount
	$firstNode.ALUAOptimized = $aluaOptimized
	$firstNode.CacheMode = $cacheMode
	$firstNode.CacheSize = $cacheSize
	$firstNode.FailoverStrategy = $failover
	$firstNode.CreateTarget = $createTarget
	$firstNode.BitmapStoreType = $bmpType
	$firstNode.BitmapStrategy = $bmpStrategy
	$firstNode.BitmapFolderPath = $bmpFolderPath
    
	#
	# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. 
	#
	$firstNode.SectorSize = $sectorSize
    
	$secondNode = new-Object Node

	$secondNode.HostName = $addr2
	$secondNode.HostPort = $port2
	$secondNode.Login = $user2
	$secondNode.Password = $password2
	$secondNode.ImagePath = $imagePath2
	$secondNode.ImageName = $imageName2
	$secondNode.CreateImage = $createImage2
	$secondNode.StorageName = $storageName2
	$secondNode.TargetAlias = $targetAlias2
	$secondNode.SyncInterface = $syncInterface2
	$secondNode.HBInterface = $hbInterface2
	$secondNode.SyncSessionCount = $syncSessionCount2
	$secondNode.ALUAOptimized = $aluaOptimized2
	$secondNode.CacheMode = $cacheMode2
	$secondNode.CacheSize = $cacheSize2
	$secondNode.FailoverStrategy = $failover
	$secondNode.CreateTarget = $createTarget2
	$secondNode.BitmapFolderPath = $bmpFolderPath2
        
	$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
    
	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()
}
thomas_lt
Posts: 10
Joined: Sat Jun 15, 2024 3:41 pm

Wed Jul 03, 2024 4:27 pm

Hi,
Here is a copy of the script

Code: Select all

param($addr="192.168.10.220", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.10.221", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=2048,
	$sectorSize=512,
	$failover=0,
#	$bmpType=1,
#	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage/mnt/nvme01n1p1/Volume0",
	$imageName="csv1",
	$createImage=$true,
	$storageName="",
	$targetAlias="csv1",
	$autoSynch=$true,
	$poolName="nvme0n1p1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2={0}:3260" -f "172.16.20.10",
	$hbInterface="#p2={0}:3260" -f "172.16.10.10",
	$createTarget=$true,
#	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage/mnt/nvme01n1p1/Volume0",
	$imageName2="csv1",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="csv1",
	$autoSynch2=$true,
	$poolName2="nvme0n1p1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1={0}:3260" -f "172.16.20.20",
	$hbInterface2="#p1={0}:3260" -f "172.16.10.20",
	$createTarget2=$true
#	$bmpFolderPath2=""
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog

	$server = New-SWServer -host $addr -port $port -user $user -password $password

	$server.Connect()

	$firstNode = new-Object Node

	$firstNode.HostName = $addr
	$firstNode.HostPort = $port
	$firstNode.Login = $user
	$firstNode.Password = $password
	$firstNode.ImagePath = $imagePath
	$firstNode.ImageName = $imageName
	$firstNode.Size = $size
	$firstNode.CreateImage = $createImage
	$firstNode.StorageName = $storageName
	$firstNode.TargetAlias = $targetAlias
	$firstNode.AutoSynch = $autoSynch
	$firstNode.SyncInterface = $syncInterface
	$firstNode.HBInterface = $hbInterface
	$firstNode.PoolName = $poolName
	$firstNode.SyncSessionCount = $syncSessionCount
	$firstNode.ALUAOptimized = $aluaOptimized
	$firstNode.CacheMode = $cacheMode
	$firstNode.CacheSize = $cacheSize
	$firstNode.FailoverStrategy = $failover
	$firstNode.CreateTarget = $createTarget
	$firstNode.BitmapStoreType = $bmpType
	$firstNode.BitmapStrategy = $bmpStrategy
	$firstNode.BitmapFolderPath = $bmpFolderPath
    
	#
	# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. 
	#
	$firstNode.SectorSize = $sectorSize
    
	$secondNode = new-Object Node

	$secondNode.HostName = $addr2
	$secondNode.HostPort = $port2
	$secondNode.Login = $user2
	$secondNode.Password = $password2
	$secondNode.ImagePath = $imagePath2
	$secondNode.ImageName = $imageName2
	$secondNode.CreateImage = $createImage2
	$secondNode.StorageName = $storageName2
	$secondNode.TargetAlias = $targetAlias2
	$secondNode.AutoSynch = $autoSynch2
	$secondNode.SyncInterface = $syncInterface2
	$secondNode.HBInterface = $hbInterface2
	$secondNode.SyncSessionCount = $syncSessionCount2
	$secondNode.ALUAOptimized = $aluaOptimized2
	$secondNode.CacheMode = $cacheMode2
	$secondNode.CacheSize = $cacheSize2
	$secondNode.FailoverStrategy = $failover
	$secondNode.CreateTarget = $createTarget2
#$secondNode.BitmapFolderPath = $bmpFolderPath2
        
	$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
    
	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()
}
I'm probably doing something wrong with the image path or name (or an other variable). Unfortunately I couldn't find some much information about it. (also, it is not possible to search for terms in the forum, so we have to browse every discussion, trying to find some useful information which has already been discussed)

The physical disks (one per appliance) are named nvme0n1
The storage pools (one per appliance) are named nvme0n1p1
The volumes (one per appliance) are named Volume0 , so mount point is /mnt/nvme0n1p1/Volume0

The error message I get now with this script is
Request to 192.168.10.220 ( 192.168.10.220 ) : 3261
-
control ImageFile -CreateImage:"VSA Storage\mnt\nvme0n1p1\Volume0\csv1.img" -Size:"2048" -Flat:"True" -DeferredInit:"True" -Password:"starwind"
-
200 Failed: file already exists.

Changing the imagename and targetalias to something else gives this error message :
Request to 192.168.10.220 ( 192.168.10.220 ) : 3261
-
control HAImage -CreateHeader:"Headers\csv01\csv01_HA.swdsk" -pathDirHeaderBackup:"VSA Storage\mnt\nvme0n1p1\Volume0" -file:"imagefile2" -size:"2048" -Priority:"#p0=0;#p1=1" -nodeType:"#p0=1;#p1=1" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoftware:192.168.10.221-csv01" -PartnerIP:"#p1=172.16.20.10:sync:3260:1,172.16.10.10:heartbeat:3260:1" -IsAutoSynchEnabled:"1" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p1=0b" -AuthMChapSecret:"#p1=0b" -AuthChapType:"#p1=none" -Offset:"0" -CacheMode:"none" -CacheSizeMB:"0" -serial:"ECD7AA419F4347FE" -eui64:"ECD7AA419F4347FE" -revision:"0001" -product:"STARWIND" -vendor:"STARWIND" -Replicator:"#p0=0" -WitnessType:"0" -AluaAccessState:"#p0=0;#p1=1"
-
200 Failed: invalid partner info..
Hope you can help !
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Wed Jul 03, 2024 5:09 pm

Thanks for the script!
Try initMethod=syncFromFirst
Also please make sure that the first node has IPs of the second, while the second refers to the IPs of the first.
Also, not all bitmap entries are commented on. Please see the entries under the Import-Module call.
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Wed Jul 03, 2024 5:36 pm

Thanks for sharing the script!
Yeah, networking can be tricky.
Speaking of the script, please comment on all the entries about bmp out. try also using initMethod=SyncFromFirst.

Let me know if more assistance is needed.
thomas_lt
Posts: 10
Joined: Sat Jun 15, 2024 3:41 pm

Thu Jul 04, 2024 5:09 am

Hi,
Thank you for your help so far.
Still having issues creating the LUN.
Here is the updated script, with the correct (I hope) IP settings, and commented Bitmap entries :

Code: Select all

param($addr="192.168.10.220", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.10.221", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="syncFromFirst",
	$size=2048,
	$sectorSize=512,
	$failover=0,
#	$bmpType=1,
#	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\nvme0n1p1\Volume0",
	$imageName="csv2",
	$createImage=$true,
	$storageName="",
	$targetAlias="csv2",
	$autoSynch=$true,
	$poolName="nvme0n1p1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2={0}:3260" -f "172.16.20.20",
	$hbInterface="#p2={0}:3260" -f "172.16.10.20",
	$createTarget=$true,
#	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\nvme0n1p1\Volume0",
	$imageName2="csv2",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="csv2",
	$autoSynch2=$true,
	$poolName2="nvme0n1p1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1={0}:3260" -f "172.16.20.10",
	$hbInterface2="#p1={0}:3260" -f "172.16.10.10",
	$createTarget2=$true
#	$bmpFolderPath2=""
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog

	$server = New-SWServer -host $addr -port $port -user $user -password $password

	$server.Connect()

	$firstNode = new-Object Node

	$firstNode.HostName = $addr
	$firstNode.HostPort = $port
	$firstNode.Login = $user
	$firstNode.Password = $password
	$firstNode.ImagePath = $imagePath
	$firstNode.ImageName = $imageName
	$firstNode.Size = $size
	$firstNode.CreateImage = $createImage
	$firstNode.StorageName = $storageName
	$firstNode.TargetAlias = $targetAlias
	$firstNode.AutoSynch = $autoSynch
	$firstNode.SyncInterface = $syncInterface
	$firstNode.HBInterface = $hbInterface
	$firstNode.PoolName = $poolName
	$firstNode.SyncSessionCount = $syncSessionCount
	$firstNode.ALUAOptimized = $aluaOptimized
	$firstNode.CacheMode = $cacheMode
	$firstNode.CacheSize = $cacheSize
	$firstNode.FailoverStrategy = $failover
	$firstNode.CreateTarget = $createTarget
#	$firstNode.BitmapStoreType = $bmpType
#	$firstNode.BitmapStrategy = $bmpStrategy
#	$firstNode.BitmapFolderPath = $bmpFolderPath
    
	#
	# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. 
	#
	$firstNode.SectorSize = $sectorSize
    
	$secondNode = new-Object Node

	$secondNode.HostName = $addr2
	$secondNode.HostPort = $port2
	$secondNode.Login = $user2
	$secondNode.Password = $password2
	$secondNode.ImagePath = $imagePath2
	$secondNode.ImageName = $imageName2
	$secondNode.CreateImage = $createImage2
	$secondNode.StorageName = $storageName2
	$secondNode.TargetAlias = $targetAlias2
	$secondNode.AutoSynch = $autoSynch2
	$secondNode.SyncInterface = $syncInterface2
	$secondNode.HBInterface = $hbInterface2
	$secondNode.SyncSessionCount = $syncSessionCount2
	$secondNode.ALUAOptimized = $aluaOptimized2
	$secondNode.CacheMode = $cacheMode2
	$secondNode.CacheSize = $cacheSize2
	$secondNode.FailoverStrategy = $failover
	$secondNode.CreateTarget = $createTarget2
#$secondNode.BitmapFolderPath = $bmpFolderPath2
        
	$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
    
	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()
}
Still getting the same kind of error message :
Request to 192.168.10.220 ( 192.168.10.220 ) : 3261
-
control HAImage -CreateHeader:"Headers\csv2\csv2_HA.swdsk" -pathDirHeaderBackup:"VSA Storage\mnt\nvme0n1p1\Volume0" -file:"imagefile4" -size:"2048" -Priority:"#p0=0;#p1=1" -nodeType:"#p0=1;#p1=1" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoftware:192.168.10.221-csv2" -PartnerIP:"#p1=172.16.20.20:sync:3260:1,172.16.10.20:heartbeat:3260:1" -IsAutoSynchEnabled:"1" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p1=0b" -AuthMChapSecret:"#p1=0b" -AuthChapType:"#p1=none" -Offset:"0" -CacheMode:"none" -CacheSizeMB:"0" -serial:"0D2F57B613953A57" -eui64:"0D2F57B613953A57" -revision:"0001" -product:"STARWIND" -vendor:"STARWIND" -Replicator:"#p0=0" -WitnessType:"0" -AluaAccessState:"#p0=0;#p1=1"
-
200 Failed: invalid partner info..

Any idea ?
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Thu Jul 04, 2024 8:34 am

Please leave poolname values blank.
thomas_lt
Posts: 10
Joined: Sat Jun 15, 2024 3:41 pm

Fri Jul 05, 2024 2:58 pm

Hi,
Thank you for your message.
Went back today to my test environment. I updated the script but still getting an error message.

Appliance 1
IP 192.168.10.220
SYNC 172.16.20.10
HB 172.16.10.10
Applicance 2
IP 192.168.10.221
SYNC 172.16.20.20
HB 172.16.10.20

Here is the current script started on Appliance 1 :

Code: Select all

param($addr="192.168.10.220", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.10.221", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="syncFromFirst",
	$size=2048,
	$sectorSize=512,
	$failover=0,
#	$bmpType=1,
#	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\nvme0n1p1\Volume0",
	$imageName="csv10",
	$createImage=$true,
	$storageName="",
	$targetAlias="csv2",
	$autoSynch=$true,
	$poolName="",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2={0}:3260" -f "172.16.20.20",
	$hbInterface="#p2={0}:3260" -f "172.16.10.20",
	$createTarget=$true,
#	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\nvme0n1p1\Volume0",
	$imageName2="csv2",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="csv10",
	$autoSynch2=$true,
	$poolName2="",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1={0}:3260" -f "172.16.20.10",
	$hbInterface2="#p1={0}:3260" -f "172.16.10.10",
	$createTarget2=$true
#	$bmpFolderPath2=""
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog

	$server = New-SWServer -host $addr -port $port -user $user -password $password

	$server.Connect()

	$firstNode = new-Object Node

	$firstNode.HostName = $addr
	$firstNode.HostPort = $port
	$firstNode.Login = $user
	$firstNode.Password = $password
	$firstNode.ImagePath = $imagePath
	$firstNode.ImageName = $imageName
	$firstNode.Size = $size
	$firstNode.CreateImage = $createImage
	$firstNode.StorageName = $storageName
	$firstNode.TargetAlias = $targetAlias
	$firstNode.AutoSynch = $autoSynch
	$firstNode.SyncInterface = $syncInterface
	$firstNode.HBInterface = $hbInterface
	$firstNode.PoolName = $poolName
	$firstNode.SyncSessionCount = $syncSessionCount
	$firstNode.ALUAOptimized = $aluaOptimized
	$firstNode.CacheMode = $cacheMode
	$firstNode.CacheSize = $cacheSize
	$firstNode.FailoverStrategy = $failover
	$firstNode.CreateTarget = $createTarget
#	$firstNode.BitmapStoreType = $bmpType
#	$firstNode.BitmapStrategy = $bmpStrategy
#	$firstNode.BitmapFolderPath = $bmpFolderPath
    
	#
	# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. 
	#
	$firstNode.SectorSize = $sectorSize
    
	$secondNode = new-Object Node

	$secondNode.HostName = $addr2
	$secondNode.HostPort = $port2
	$secondNode.Login = $user2
	$secondNode.Password = $password2
	$secondNode.ImagePath = $imagePath2
	$secondNode.ImageName = $imageName2
	$secondNode.CreateImage = $createImage2
	$secondNode.StorageName = $storageName2
	$secondNode.TargetAlias = $targetAlias2
	$secondNode.AutoSynch = $autoSynch2
	$secondNode.SyncInterface = $syncInterface2
	$secondNode.HBInterface = $hbInterface2
	$secondNode.SyncSessionCount = $syncSessionCount2
	$secondNode.ALUAOptimized = $aluaOptimized2
	$secondNode.CacheMode = $cacheMode2
	$secondNode.CacheSize = $cacheSize2
	$secondNode.FailoverStrategy = $failover
	$secondNode.CreateTarget = $createTarget2
#$secondNode.BitmapFolderPath = $bmpFolderPath2
        
	$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
    
	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 here is the error message :
Request to 192.168.10.220 ( 192.168.10.220 ) : 3261
-
control HAImage -CreateHeader:"Headers\csv10\csv10_HA.swdsk" -pathDirHeaderBackup:"VSA Storage\mnt\nvme0n1p1\Volume0" -file:"imagefile5" -size:"2048" -Priority:"#p0=0;#p1=1" -nodeType:"#p0=1;#p1=1" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoftware:192.168.10.221-csv10" -PartnerIP:"#p1=172.16.20.20:sync:3260:1,172.16.10.20:heartbeat:3260:1" -IsAutoSynchEnabled:"1" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p1=0b" -AuthMChapSecret:"#p1=0b" -AuthChapType:"#p1=none" -Offset:"0" -CacheMode:"none" -CacheSizeMB:"0" -serial:"71B9F5A80C2AA5EC" -eui64:"71B9F5A80C2AA5EC" -revision:"0001" -product:"STARWIND" -vendor:"STARWIND" -Replicator:"#p0=0" -WitnessType:"0" -AluaAccessState:"#p0=0;#p1=1"
-
200 Failed: invalid partner info..

Can you help ?
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Fri Jul 05, 2024 4:12 pm

Check the IP syntax (see viewtopic.php?f=5&t=5624&p=31505&hilit=tip+3#p31505 for a reference).
Make sure the path exists (i.e., you can create files there).
thomas_lt
Posts: 10
Joined: Sat Jun 15, 2024 3:41 pm

Fri Jul 05, 2024 4:37 pm

Still getting the same error message "Invalid partner info..."
I've updated the script as follows

Code: Select all

param($addr="192.168.10.220", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.10.221", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="syncFromFirst",
	$size=2048,
	$sectorSize=512,
	$failover=0,
#	$bmpType=1,
#	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\nvme0n1p1\Volume0",
	$imageName="csv4",
	$createImage=$true,
	$storageName="",
	$targetAlias="csv4",
	$autoSynch=$true,
	$poolName="",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2=172.16.20.20:3260" -f $addr2,
	$hbInterface="#p2=172.16.10.20:3260" -f $addr2,
	$createTarget=$true,
#	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\nvme0n1p1\Volume0",
	$imageName2="csv4",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="csv4",
	$autoSynch2=$true,
	$poolName2="",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.16.20.10:3260" -f $addr,
	$hbInterface2="#p1=172.16.10.10:3260" -f $addr,
	$createTarget2=$true
#	$bmpFolderPath2=""
	)
I suppose the path exists as, if I do not change the ImageName, I get an error "File already exists"
However, I cannot duly confirm this as I'm not able to login to the SSH console as root/starwind and user/rds123RDS! do not work...
yaroslav (staff)
Staff
Posts: 3465
Joined: Mon Nov 18, 2019 11:11 am

Fri Jul 05, 2024 5:11 pm

I noticed the slashes 😀 try different slashes.
thomas_lt
Posts: 10
Joined: Sat Jun 15, 2024 3:41 pm

Fri Jul 05, 2024 5:26 pm

Changed the \ to / , but still getting errors
1st try :
PS C:\temp> .\createHA_2.ps1
Connection to 192.168.10.220 ( 192.168.10.220 ) : 3261 has failed
-
login root starwind
-
104 You are authenticated already..
Error:
At C:\temp\CreateHA_2.ps1:125 char:2
+ $server.Disconnect()
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
So I waited a few seconds, and ran the script again, without any edits. 2nd try :
PS C:\temp> .\createHA_2.ps1
Request to 192.168.10.220 ( 192.168.10.220 ) : 3261
-
control ImageFile -CreateImage:"VSA Storage/mnt/nvme0n1p1/Volume0\csv10.img" -Size:"2048" -Flat:"True" -DeferredInit:"True" -Password:"starwind"
-
200 Failed: file already exists.
Not that the slashes in the path are not the same. The last one, added by the command, is a backslash

Changed the imagename with a new one. 3rd try :
PS C:\temp> .\createHA_2.ps1
Request to 192.168.10.220 ( 192.168.10.220 ) : 3261
-
control HAImage -CreateHeader:"Headers\csv11\csv11_HA.swdsk" -pathDirHeaderBackup:"VSA Storage/mnt/nvme0n1p1/Volume0" -file:"imagefile13" -size:"2048" -Priority:"#p0=0;#p1=1" -nodeType:"#p0=1;#p1=1" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoftware:192.168.10.221-csv11" -PartnerIP:"#p1=172.16.20.20:sync:3260:1,172.16.10.20:heartbeat:3260:1" -IsAutoSynchEnabled:"1" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p1=0b" -AuthMChapSecret:"#p1=0b" -AuthChapType:"#p1=none" -Offset:"0" -CacheMode:"none" -CacheSizeMB:"0" -serial:"63FA0319CA369B28" -eui64:"63FA0319CA369B28" -revision:"0001" -product:"STARWIND" -vendor:"STARWIND" -Replicator:"#p0=0" -WitnessType:"0" -AluaAccessState:"#p0=0;#p1=1"
-
200 Failed: invalid partner info..

I'm getting a light headache...
Post Reply