Hi everyone,
For everyone else who may run into this problem. I wrote this to help out
When one of the nodes failed this is what I did to bring it back on line
I first had to configure my new server and install starwind
0. I had some old *.swdsk, *_HA.swdsk files from some other images. Maybe by copying these files from the working node to the new rebuilt node and then modifying them would have worked but I would have to test this in the future.
1. Disable the StarWind Virtual SAN service
2. Modify the old *.swdsk, *_HA.swdsk, because the ones I had they were pointing to some images I no longer had.
structure of *.swdsk
I noticed this file has the properties of the *.img the important thing to note here is the
<interval size="must be the same as *.swdsk from working node" units="GB"/>
<serial_id>a unique 16 character hex number</serial_id>
<eui_64>same number as serial_id</eui_64>
<storage id="1" name="path to the image file" example "My computer\C\VHD\witness.img" type="file">
structure of *_HA.swdsk
This file has the sync info.
<interval size="must be the same as *_HA.swdsk from working node" units="GB"/> this field is listed twice in the file. Make sure all fileds match
<serial_id>must be the same as *_HA.swdsk from working node and must match in StarWind.cfg</serial_id>
<eui_64>same as serial </eui_64>
<storage id="2" name="iqn.2008-08.com.starwindsoftware:working node target" type="remote" lun="0x0"> this line must contain the partner node target
<link id="1" type="data" priority="1" connections="1"> this is the data link
<peer ip="192.168.251.251" port="3260"/> this is the working node Sync IP aka partner node
<link id="2" type="control" priority="1" connections="1"> this is the heartbeat link
<peer ip="192.168.250.251" port="3260"/> this is the working node heartbeat IP aka partner node
structure of StarWind.cfg
Towards the end of the file are some lines which specify image files, HAImages, Targets, and ACLs.
<device name="imagefile1" file="My Computer\C\VHD\Witness.swdsk" node="-1"/>
name filed is the name of image file in this node. Example imagefile1 or imagefile2, etc.
file field is the location of the *.swdsk
<device name="HAImage1" OwnTargetName="iqn.2008-08.com.starwindsoftware:vmhost1.aveon.local-witness" file="My Computer\D\VHD\witness_HA.swdsk" serialId="this must match serial from *_HA.swdsk" " asyncmode="yes" readonly="no" highavailability="yes" buffering="no" header="65536" reservation="no" CacheMode="none" CacheSizeMB="64" AluaNodeGroupStates="0,0" Storage="imagefile1"/>
name field is HAImage name in this node.
OwnTargetName field as the name implies is the target assiged to this HA Image. THIS IS NOT THE TARGET FROM THE PARTNER NODE.
file field location of the *_HA.swdsk
serialId field must match serial from *_HA.swdsk
storage field must match name field from image file fields
<target name="iqn.2008-08.com.starwindsoftware:vmhost1.aveon.local-witness" devices="HAImage1" alias="witness"/>
name field is the target assiged to an HA Image. THIS IS NOT THE TARGET FROM THE PARTNER NODE.
devices field is the HAImage this target should be attached to allias is the last portion of the target name
<aclrecord name="allow for partner(s) of iqn.2008-08.com.starwindsoftware:vmhost1.aveon.local-witness" source="iqn.2008-08.com.starwindsoftware:vmhost2.aveon.local-witness" destination="iqn.2008-08.com.starwindsoftware:vmhost1.aveon.local-witness" interface="" action="allow"/>
allows access from partner node.
Source is the partner node target
Destination is the local node target
3. Copy the configuration files to appropriate locations
4. Started to copy the *.img file from working node to rebuit node, waited 5 minutes then cancelled. When I cancelled the *.img file stayed which was great
5. set service StarWind Virtual SAN back to automatic and started the service
6. On the rebuilt node I run the following script
Code: Select all
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer 192.168.253.250 3261 root starwind
$server.Connect()
$device = Get-Device $server -name "HAImage1"
if( !$device )
{
Write-Host "Device not found" -foreground red
return
}
if($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
{
Write-Host "Synchronize device $($device.name)" -foreground yellow
$device.Synchronize([SwHaSyncType]::SW_HA_SYNC_FULL, "")
#$device.MarkAsSynchronized()
}
else
{
Write-Host "Device $($device.name) is synchronized" -foreground yellow
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
7. After that it started doing a full sync