I am creating a 2 node Hyper-V cluster with an SMB Witness using the CreateHASmbWitness.ps1 script. However it seems to have created both sides with the same target name/IQN. This seems to be causing problems with cross connecting iscsi between the two nodes. How do I change the iqn name? Do I edit the HA.swdsk file under resources>storage for the current node and under the "<node id="2"... for the partner node?
This is the script CreateHASmbWitness script I used. Not sure how to specify the target names/IQNs in it. I tried setting the $storageName parameter but that gave a connection error when I ran the script.
param($addr="192.168.254.24", $port=3261, $user="root", $password="starwind",
$addr2="192.168.254.23", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1024,
$sectorSize=4096,
$bmpType=1,
$bmpStrategy=0,
$smbWitnessFilePath="\\nas1.hamilton.local\witness\Starwind\vSANVM_witness.dat",
$smbWitnessUsername="witness",
$smbWitnessPassword="xxxxx",
#primary node
$imagePath="My computer\E\vSAN",
$imageName="vSANVM",
$createImage=$true,
$storageName="",
$targetAlias="vSANVM",
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="wb",
$cacheSize=1024,
$syncInterface="#p2=192.168.252.132:3260" -f $addr2,
$bmpFolderPath="",
$createTarget=$true,
#secondary node
$imagePath2="My computer\E\vSAN",
$imageName2="vSANVM",
$createImage2=$true,
$storageName2="",
$targetAlias2="vSANVM",
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.252.133:3260" -f $addr,
$bmpFolderPath2="",
$createTarget2=$true
)
Here is the HA.swdsk file for the HV1 node.
<system>
<resources>
<storages>
<storage id="1" name="RAM" type="RAM">
<interval size="1" units="GB"/>
</storage>
<storage id="2" name="imagefile1" type="device" lun="0x0">
<interval size="1" units="GB"/>
</storage>
<storage id="3" name="\\nas1.hamilton.local\witness\Starwind\vSANVM_witness.dat" type="smb_witness">
<authentication type="basic">
<basic login="witness" passwd="0b6DtlS5XJeHWTZYIi1ENUHg=="/>
</authentication>
</storage>
<storage id="4" name="iqn.2008-08.com.starwindsoftware:spf03-hv1.hamilton.local-vsanvm" type="remote" lun="0x0">
<!-- iqn.2008-08.com.starwindsoftware:spf03-hv1.hamilton.local-vsanvm -->
<transport type="iSCSI">
<links>
<link id="1" type="data" priority="1" connections="1">
<peer ip="192.168.252.132" port="3260"/>
</link>
</links>
</transport>
</storage>
</storages>
<network/>
</resources>
</system>
<node id="1" name="HAImage" shut="false" active="true" flags="0">
<storages>
<storage_ref id="2"/>
</storages>
<parameters>
<type>1</type>
<priority>0</priority>
<auto_sync>true</auto_sync>
<sync_status>1</sync_status>
<sync_delay>50</sync_delay>
<sync_traffic_share>50</sync_traffic_share>
<failover_conf>1</failover_conf>
<witness_type>1</witness_type>
<last_sync_snap_id>0</last_sync_snap_id>
<alua_access_state>0</alua_access_state>
</parameters>
</node>
<node id="2" name="iqn.2008-08.com.starwindsoftware:spf03-hv1.hamilton.local-vsanvm" shut="false" active="true">
<storages>
<storage_ref id="4"/>
</storages>
<parameters>
<type>1</type>
<priority>1</priority>
<sync_status>1</sync_status>
<alua_access_state>0</alua_access_state>
<type_bitmap>RAM</type_bitmap>
</parameters>
</node>
</header>
This is the script CreateHASmbWitness script I used. Not sure how to specify the target names/IQNs in it. I tried setting the $storageName parameter but that gave a connection error when I ran the script.
param($addr="192.168.254.24", $port=3261, $user="root", $password="starwind",
$addr2="192.168.254.23", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1024,
$sectorSize=4096,
$bmpType=1,
$bmpStrategy=0,
$smbWitnessFilePath="\\nas1.hamilton.local\witness\Starwind\vSANVM_witness.dat",
$smbWitnessUsername="witness",
$smbWitnessPassword="xxxxx",
#primary node
$imagePath="My computer\E\vSAN",
$imageName="vSANVM",
$createImage=$true,
$storageName="",
$targetAlias="vSANVM",
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="wb",
$cacheSize=1024,
$syncInterface="#p2=192.168.252.132:3260" -f $addr2,
$bmpFolderPath="",
$createTarget=$true,
#secondary node
$imagePath2="My computer\E\vSAN",
$imageName2="vSANVM",
$createImage2=$true,
$storageName2="",
$targetAlias2="vSANVM",
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.252.133:3260" -f $addr,
$bmpFolderPath2="",
$createTarget2=$true
)
Here is the HA.swdsk file for the HV1 node.
<system>
<resources>
<storages>
<storage id="1" name="RAM" type="RAM">
<interval size="1" units="GB"/>
</storage>
<storage id="2" name="imagefile1" type="device" lun="0x0">
<interval size="1" units="GB"/>
</storage>
<storage id="3" name="\\nas1.hamilton.local\witness\Starwind\vSANVM_witness.dat" type="smb_witness">
<authentication type="basic">
<basic login="witness" passwd="0b6DtlS5XJeHWTZYIi1ENUHg=="/>
</authentication>
</storage>
<storage id="4" name="iqn.2008-08.com.starwindsoftware:spf03-hv1.hamilton.local-vsanvm" type="remote" lun="0x0">
<!-- iqn.2008-08.com.starwindsoftware:spf03-hv1.hamilton.local-vsanvm -->
<transport type="iSCSI">
<links>
<link id="1" type="data" priority="1" connections="1">
<peer ip="192.168.252.132" port="3260"/>
</link>
</links>
</transport>
</storage>
</storages>
<network/>
</resources>
</system>
<node id="1" name="HAImage" shut="false" active="true" flags="0">
<storages>
<storage_ref id="2"/>
</storages>
<parameters>
<type>1</type>
<priority>0</priority>
<auto_sync>true</auto_sync>
<sync_status>1</sync_status>
<sync_delay>50</sync_delay>
<sync_traffic_share>50</sync_traffic_share>
<failover_conf>1</failover_conf>
<witness_type>1</witness_type>
<last_sync_snap_id>0</last_sync_snap_id>
<alua_access_state>0</alua_access_state>
</parameters>
</node>
<node id="2" name="iqn.2008-08.com.starwindsoftware:spf03-hv1.hamilton.local-vsanvm" shut="false" active="true">
<storages>
<storage_ref id="4"/>
</storages>
<parameters>
<type>1</type>
<priority>1</priority>
<sync_status>1</sync_status>
<alua_access_state>0</alua_access_state>
<type_bitmap>RAM</type_bitmap>
</parameters>
</node>
</header>
Statistics: Posted by FireMedic — Fri Apr 11, 2025 2:45 pm