Closed spuder closed 6 years ago
@jordangillespie This is the only thing preventing the final F5-Rest transition.
Hi, Spencer,
When checking the status of a pool member, there are two values to consider to determine the status: the Session and the State. When you disable a pool member, it changes the Session to 'user-disabled'. In the UI, this shows as a black circle. If you want to forced-disable a pool member, then you must use the -Force switch when calling Disable-PoolMember. That changes the State to 'down' as well as the Session to 'user-disabled.'
Below are the possible permutations and the corresponding symbols displayed in the UI:
Red diamond: session: monitor-enabled state: down
Green circle: session: monitor-enabled state: up
Black circle: session: user-disabled state: up
Black diamond: session: user-disabled state: down
Hope this helps clarify things. -Joel
That does help. Thank you. I implemented it like so:
$Member = Get-PoolMember -PoolName $Pool -Partition $Partition -F5Session $global:F5session | ? { $_.Name -match $VMName }
if (($Member.Session -eq 'monitor-enabled') -and ($Member.State -eq 'down')) {
# Red Diamond
return 'offline'
}
elseif (($Member.Session -eq 'monitor-enabled') -and ($Member.State -eq 'up')) {
# Green Circle
return 'enabled'
}
elseif (($Member.Session -eq 'user-disabled') -and ($Member.State -eq 'up')) {
# Black Circle
return 'disabled'
}
elseif (($Member.Session -eq 'user-disabled') -and ($Member.State -eq 'down')) {
# Black Diamond (forced offline)
return 'disabled'
}
else {
Write-Host "Invalid state for $VMName $($Member.State): $($Member.Session)" -ForegroundColor Red
break
}
If you attempt to use
Get-PoolMember
to get the state of the server, it returns 'UP' regardless if the server is actually up or not.There does not appear to be a way to query if a server is 'enabled', 'disabled' or 'forced offline'