200 Failed: operation cannot be completed..

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

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

Post Reply
BCS
Posts: 1
Joined: Sun Nov 03, 2024 5:47 pm

Mon Nov 04, 2024 12:35 am

Dear,
I'm trying to set a POC but looks like it's not that easy, or maybe I'm just tired.

Already faced several errors but with this forum I was able to solve them, but not now, I'm stuck with the one below.
"
Request to *****.***.** ( 192.168.0.2 ) : 3261
-
control ImageFile -CreateImage:"My computer\E\VSAN\test2.img" -Size:"1024" -Flat:"True" -DeferredInit:"True" -Password:"****"
-
200 Failed: operation cannot be completed..
"

I'm using CreateHA_2.ps1

param($addr="192.168.0.2", $port=3261, $user="root", $password="******",
$addr2="192.168.0.3", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="syncFromFirst",
$size=1024,
$sectorSize=512,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="My computer\E\VSAN",
$imageName="test2",
$createImage=$true,
$storageName="",
$targetAlias="targetha21",
$poolName="",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=0,
$syncInterface="#p2=192.168.0.3:3260" -f $addr2,
$hbInterface="#p2=192.168.0.19",
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="My computer\E\VSAN",
$imageName2="test2",
$createImage2=$true,
$storageName2="",
$targetAlias2="partnerha22",
$poolName2="",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.0.2:3260" -f $addr,
$hbInterface2="#p1=192.168.0.18",
$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()
}

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

Mon Nov 04, 2024 4:57 am

Welcome to StarWind Forum! Check this out
viewtopic.php?f=5&t=6852&p=37208&hilit=HINT8#p37208
Post Reply