Forum Discussion
ShaneCal_162988
Oct 27, 2016Altocumulus
I've written a PowerShell function myself to carry out this operation, as I could not find anything online and no one here seems to have done the same:
function Is-DeviceInSync
{
<
.SYNOPSIS
Gets the sync status of the F5 device groups
>
[CmdletBinding(HelpURI="https://devcentral.f5.com/wiki/iControl.Management__DeviceGroup__SyncStatus.ashx")]
param
()
$syncStatus = (Get-F5.iControl).ManagementDeviceGroup.get_sync_status_overview()
if ($syncStatus.member_state -eq "MEMBER_STATE_STANDALONE")
{
write-host "This F5 device is standalone, no sync is required"
return $true
}
elseif ($syncStatus.member_state -eq "MEMBER_STATE_IN_SYNC")
{
write-host "This F5 device is in sync with members of its device group, no sync is required"
return $true
}
elseif ($syncStatus.member_state -eq "MEMBER_STATE_NEED_MANUAL_SYNC")
{
write-host "This F5 device is not standalone and changes have been made to this device that have not been synced to the device group"
return $false
}
elseif ($syncStatus.member_state -eq "MEMBER_STATE_SYNCING")
{
write-host "This F5 device is currently synching with devices in it's group, waiting 10 seconds before checking again..."
Start-Sleep -Seconds 10
Is-DeviceInSync
}
else
{
throw "This F5 device is not in a stable sync state with devices in it's group, please manually verify the sync state of this device before running this script again"
}
}