Hi yaroslav,yaroslav (staff) wrote: ↑Thu Jul 31, 2025 2:49 pmYou are right, yet the device will be misconfigured.
It means that the HA device was created. Please review the HA device header and remove the replication partner. Once removed, log to the destination node (i.e., where you intend replicating the drvices to) remove the swdsk files from /headers and underlying storage and img devices from the underlying of the destination node. Please make sure to do it only on the destination node.
Once done, run addHA partner.
I ran the CreateHA_2.ps1 script, and got this result from enumDevice for both Node 2 and Node 1.
I can see HAImage1 and imagefile1, it seems the LUN in Node 1 reassigns the device to HAImage1, and imagefile1 shows NoheaderFile for its state.
Node 2
Code: Select all
PS C:\Users\Administrator\Desktop> .\enumDevicesTargets.ps1
Target:
Name : iqn.2008-08.com.starwindsoftware:192.168.30.201-vlab
Id : 0x0000000001201B80
Alias : vlab
IsClustered : True
Devices :Code: Select all
PS C:\Users\Administrator\Desktop> .\enumDevicesTargets.ps1
Target:
Name : iqn.2008-08.com.starwindsoftware:192.168.30.101-vlab
Id : 0x00000000011761C0
Alias : vlab
IsClustered : True
Devices : HAImage1
Device:
Name : imagefile1
Id : 0x0000000001175A40
TargetName : empty
TargetId : empty
State : NoHeaderFile
Size : 0
Device:
Name : HAImage1
Id : 0x00000000011D2A40
TargetName : iqn.2008-08.com.starwindsoftware:192.168.30.101-vlab
TargetId : 0x00000000011761C0
DeviceType : HA Image
State : NonActive
Size : 0
NodeType : 0
IsSnapshotsSupported : 0
SectorSize : -1
Priority : 0
SyncStatus : 4294967295
SyncTrafficShare : 0
DeviceLUN :
Header : Headers\vlab\vlab_HA.swdsk
IsWaitingAutosync : False
FailoverStrategy : 0
MaintenanceMode : 0
BitmapStrategy : 0Code: Select all
PS C:\Users\Administrator\Desktop> .\AddHaPartner.ps1
Method invocation failed because [System.__ComObject] does not contain a method named 'AddPartner'.Code: Select all
param($addr="192.168.30.101", $port=3261, $user="root", $password="starwind", $deviceName="imagefile1",
$addr2="192.168.30.201", $port2=$port, $user2=$user, $password2=$password,
#secondary node
$imagePath2="/mnt/md0/vol1",
$imageName2="vlab",
$createImage2=$true,
$targetAlias2="vlab",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$true,
$syncInterface2="#p2=192.168.35.201:3260,192.168.40.201:3260",
$hbInterface2="#p2=192.168.45.201:3260,192.168.30.201:3260",
$bmpType=1,
$bmpStrategy=0,
$bmpFolderPath="",
$selfSyncInterface="#p1=192.168.35.101:3260,192.168.40.101:3260",
$selfHbInterface="#p1=192.168.45.101:3260,192.168.30.101:3260"
)
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer $addr $port $user $password
$server.Connect()
$device = Get-Device $server -name $deviceName
if( !$device )
{
Write-Host "Device not found" -foreground red
return
}
$node = new-Object Node
$node.HostName = $addr2
$node.HostPort = $port2
$node.Login = $user2
$node.Password = $password2
$node.ImagePath = $imagePath2
$node.ImageName = $imageName2
$node.CreateImage = $createImage2
$node.TargetAlias = $targetAlias2
$node.SyncInterface = $syncInterface2
$node.HBInterface = $hbInterface2
$node.AutoSynch = $autoSynch2
$node.SyncSessionCount = $syncSessionCount2
$node.ALUAOptimized = $aluaOptimized2
$node.PoolName = $poolName2
$node.BitmapStoreType = $bmpType
$node.BitmapStrategy = $bmpStrategy
$node.BitmapFolderPath = $bmpFolderPath
Add-HAPartner $device $node $selfSyncInterface $selfHbInterface $selfBmpFolderPath
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}