After a session with Yaroslav, we finally found the problem. And in the meantime, he also shared some tips regarding ... everything!
The problem was that $storagename should be left empty. The default template has a pre-defined name, which i didn't bother to change and that was our problem.
So the fix is $storageName="",
Tip #1
I followed this guide (
https://www.starwindsoftware.com/resour ... rver-2016/) which has the option to enable jumbo frames for all NIC's. In reality, one shouldn't enable jumbo frames for Management interface.
Tip #2
This guide also works in Hyper-V Server 2019 - I tested also Hyper-V Server 2016 just for my sake!
Tip #3
The $size=1200, is calculated in MB and not GB, so 1200 is around 1.2GB.
Tip #4
Sometimes when we retried to run the ps1 script, we got a message that we were already logged in with credentials. With a host restart, the session expired, so the message was not displayed again.
Tip #5
Always add a second heartbeat for redundancy.
The final script of mine is in the end of this post, for reference.
Thank you so much for your time and help!
Code: Select all
param($addr="192.168.128.21", $port=3261, $user="root", $password="starwind",
$addr2="192.168.128.22", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1200,
$sectorSize=512,
$failover=0,
#primary node
$imagePath="My computer\E",
$imageName="masterImg21",
$createImage=$true,
$storageName="",
$targetAlias="targetha21",
$autoSynch=$true,
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="wb",
$cacheSize=128,
$syncInterface="#p2=10.10.10.12:3260" -f $addr2,
$hbInterface="#p2=11.11.11.12:3260,192.168.128.22:3260" -f $addr2,
$createTarget=$true,
#secondary node
$imagePath2="My computer\E",
$imageName2="partnerImg22",
$createImage2=$true,
$storageName2="",
$targetAlias2="partnerha22",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$true,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=10.10.10.11:3260" -f $addr,
$hbInterface2="#p1=11.11.11.11:3260,192.168.128.21:3260" -f $addr,
$createTarget2=$true
)