Software-based VM-centric and flash-friendly VM storage + free version
Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)
-
pbosley1322
- Posts: 5
- Joined: Fri Jan 19, 2018 4:07 pm
Fri Jan 19, 2018 4:10 pm
I just recently installed Starwind VSAN 8 and I do not the GetHASyncStatus Powershell script that is mentioned throughout the documentation and support forums. Where can I get it?
Thanks,
Patrick
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Fri Jan 19, 2018 8:31 pm
It is a part of your StarWind installation.
The default path is "C:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell\GetHASyncState.ps1"
-
pbosley1322
- Posts: 5
- Joined: Fri Jan 19, 2018 4:07 pm
Fri Jan 19, 2018 8:52 pm
I am looking in that path, it is not there. I even downloaded the installer and installed on another test host to see if the script would be present. It was not. Here is an LS of my powershell script sample directory.
Directory: C:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11/20/2017 2:04 PM 840 AddVirtualTape.ps1
-a---- 11/20/2017 2:04 PM 5076 CreateHA(three nodes).ps1
-a---- 11/20/2017 2:04 PM 4234 CreateHA(two nodes).ps1
-a---- 11/20/2017 2:04 PM 4316 CreateHA_LSFS.ps1
-a---- 11/22/2017 6:01 PM 608 CreateImageFile.ps1
-a---- 11/20/2017 2:04 PM 1446 CreateLSFS.ps1
-a---- 11/20/2017 2:04 PM 928 CreateRam.ps1
-a---- 11/20/2017 2:04 PM 1598 CreateSnapshot.ps1
-a---- 11/20/2017 2:04 PM 3088 CreateVirtualTapeLibrary.ps1
-a---- 11/20/2017 2:04 PM 409 enumDevicesTargets.ps1
-a---- 11/20/2017 2:04 PM 1192 ExtendDevice.ps1
-a---- 11/20/2017 2:04 PM 762 FlushCache.ps1
-a---- 12/1/2017 8:54 PM 1384 FlushCacheAll.ps1
-a---- 11/20/2017 2:04 PM 301 getNumaNodes.ps1
-a---- 11/22/2017 6:01 PM 669 haSyncPriority.ps1
-a---- 11/20/2017 2:04 PM 934 InsertVirtualTape.ps1
-a---- 12/1/2017 8:54 PM 424 InstallLicense.ps1
-a---- 11/20/2017 2:04 PM 574 RemoveDevice.ps1
-a---- 11/20/2017 2:04 PM 382 RemoveHAPartner.ps1
-a---- 11/20/2017 2:04 PM 1572 RemoveSnapshot.ps1
-a---- 11/20/2017 2:04 PM 596 RemoveTarget.ps1
-a---- 11/20/2017 2:04 PM 920 RemoveVirtualTape.ps1
-a---- 12/1/2017 8:54 PM 1548 runall.ps1
-a---- 11/20/2017 2:04 PM 2509 Samples.pssproj
-a---- 11/20/2017 2:04 PM 659 SyncHaDevice.ps1
-a---- 11/20/2017 2:04 PM 2997 SyncHaDeviceAdvanced.ps1
-a---- 1/14/2018 3:34 PM 579 SyncStatus.ps1
Patrick
-
tig_jeff
- Posts: 36
- Joined: Fri Apr 07, 2017 6:18 pm
Fri Jan 19, 2018 9:23 pm
Have you looked at the script names "SyncStatus.ps1"?
Hope this helps.
- Jeff Morlen
Follow me on Twitter (@tig_jeff)
-
pbosley1322
- Posts: 5
- Joined: Fri Jan 19, 2018 4:07 pm
Fri Jan 19, 2018 9:35 pm
LOL, that is a script that I wrote based off one of the other ones. The date stamp gives it away. I thought I moved all of my modified scripts to another directory, I obviously missed one. - Patrick
-
Boris (staff)
- Staff
- Posts: 805
- Joined: Fri Jul 28, 2017 8:18 am
Sat Jan 20, 2018 3:48 pm
Here is the script from the StarWindX samples:
Code: Select all
#
# This following example shows how to get synchronization status of specified HA device and
# if there is a need run synchronization
#
Import-Module StarWindX
try
{
#
# connect to the server
#
$server = New-SWServer -host 192.168.1.155 -port 3261 -user root -password starwind
$server.Connect()
#
# Try to find specified device
#
$deviceName = "HAImage1"
$partnerTargetName = "iqn.2008-08.com.starwindsoftware:192.168.1.156-partnerha1"
$deviceFound = $false
foreach($device in $server.devices)
{
if ($device.name -eq $deviceName)
{
Write-Host "$($deviceName)" -foreground yellow
Write-Host ""
$deviceFound = $true
$syncState = $device.GetPropertyValue("ha_synch_status")
while ($syncState -ne "1")
{
#
# Device not synchronized. Maybe it waiting for autosynchronization ?
#
$waitForAutoSync = $device.GetPropertyValue("ha_wait_on_autosynch")
if ( $waitForAutoSync -eq "1" )
{
Write-Host "Waiting for autosynchronization..." -foreground yellow
}
else
{
if ( $syncState -eq "2" )
{
#
# Device is synchronizing. Get synchronization percent and show it
#
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
}
if ( $syncState -eq "3" )
{
#
# Device not synchronized. Synchronize current node from partner
#
Write-Host "Device not synchronized. Synchronize current node from partner '$($partnerTargetName)'" -foreground yellow
$params = new-object -ComObject StarWindX.Parameters
$params.AppendParam("deviceID",$device.DeviceId)
$params.AppendParam("partnetTargetName",$partnerTargetName)
$server.ExecuteCommand( 0, "restoreHAPartnerNode", $params)
#
# If you want to synchronize partners from current node you can comment out code above and uncomment section below
#
#
# Device not synchronized. Mark current node as 'Synchronized'.
# WARNING, Command changes Device Status to "Synchronized" without Data Synchronization with HA (High Availability) Partner,
# Device will start processing Client Requests immediately and will be used as Data Synchronization Source for Partner Device.
#
#Write-Host "Device not synchronized. Mark current node as 'Synchronized'. " -foreground yellow
#$params = new-object -ComObject StarWindX.Parameters
#$params.AppendParam("deviceID",$device.DeviceId)
#$server.ExecuteCommand( 0, "restoreCurrentHANode", $params)
Start-Sleep -m 5000
}
}
#
# Refresh device info
#
$device.Refresh()
Start-Sleep -m 1000
$syncState = $device.GetPropertyValue("ha_synch_status")
}
Write-Host "Synchronization Status: Synchronized" -foreground yellow
break;
}
}
if ( $deviceFound -ne $true )
{
Write-Host "$($deviceName) not found" -foreground red
}
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect( )
-
tig_jeff
- Posts: 36
- Joined: Fri Apr 07, 2017 6:18 pm
Sat Jan 20, 2018 5:30 pm
Here is mine...
--- START ---
#
# This following example shows how to get synchronization status of specified HA device and
# if there is a need run synchronization
#
Import-Module StarWindX
try
{
#
# connect to the server
#
# YOUR IP ADDRESS WOULD REPLACE X.X.X.X...
$server = New-SWServer -host X.X.X.X -port 3261 -user root -password starwind
$server.Connect()
#
# Try to find specified device
#
# YOUR DEVICE NAME GOES HERE...
$deviceName = "HAImage1"
# YOUR iSCSI PARTNER TARGET GOES HERE...
$partnerTargetName = "iqn.2008-08.com.starwindsoftware:192.168.64.40-partnerha1"
$deviceFound = $false
foreach($device in $server.devices)
{
if ($device.name -eq $deviceName)
{
Write-Host "$($deviceName)" -foreground yellow
Write-Host ""
$deviceFound = $true
$syncState = $device.GetPropertyValue("ha_synch_status")
while ($syncState -ne "1")
{
#
# Device not synchronized. Maybe it waiting for autosynchronization ?
#
$waitForAutoSync = $device.GetPropertyValue("ha_wait_on_autosynch")
if ( $waitForAutoSync -eq "1" )
{
Write-Host "Waiting for autosynchronization..." -foreground yellow
}
else
{
if ( $syncState -eq "2" )
{
#
# Device is synchronizing. Get synchronization percent and show it
#
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
}
if ( $syncState -eq "3" )
{
#
# Device not synchronized. Synchronize current node from partner
#
Write-Host "Device not synchronized. Synchronize current node from partner '$($partnerTargetName)'" -foreground yellow
$params = new-object -ComObject StarWindX.Parameters
$params.AppendParam("deviceID",$device.DeviceId)
$params.AppendParam("partnetTargetName",$partnerTargetName)
$server.ExecuteCommand( 0, "restoreHAPartnerNode", $params)
#
# If you want to synchronize partners from current node you can comment out code above and uncomment section below
#
#
# Device not synchronized. Mark current node as 'Synchronized'.
# WARNING, Command changes Device Status to "Synchronized" without Data Synchronization with HA (High Availability) Partner,
# Device will start processing Client Requests immediately and will be used as Data Synchronization Source for Partner Device.
#
#Write-Host "Device not synchronized. Mark current node as 'Synchronized'. " -foreground yellow
#$params = new-object -ComObject StarWindX.Parameters
#$params.AppendParam("deviceID",$device.DeviceId)
#$server.ExecuteCommand( 0, "restoreCurrentHANode", $params)
Start-Sleep -m 5000
}
}
#
# Refresh device info
#
$device.Refresh()
Start-Sleep -m 1000
$syncState = $device.GetPropertyValue("ha_synch_status")
}
Write-Host "Synchronization Status: Synchronized" -foreground yellow
break;
}
}
if ( $deviceFound -ne $true )
{
Write-Host "$($deviceName) not found" -foreground red
}
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect( )
--- END ---
If you look at one of my other threads you will see me use this script (or a modified version of it) to show status.
You can see an image of it, in action, in my HOW-TO.
Hope this helps.
Hope this helps.
- Jeff Morlen
Follow me on Twitter (@tig_jeff)