Forum Discussion
kittH_118525
Nimbostratus
Feb 28, 2013Determining primary device in HA cluster
Hello, I have several powershell scripts that perform operations and pull statistics from F5 using iControl. We have two devices in Active/Standby configuration, and I am having trouble determining which device I should connect to programmatically. Is there a class or property I can look at to determine which device is active?
2 Replies
- Tim_K_92675
Cirrostratus
You'll have to log into the device and get it's failover state:
$failoverState = (Get-F5.iControl).SystemFailover.get_failover_state()
if($failoverState -eq 'FAILOVER_STATE_ACTIVE')
.............. - kittH_118525
Nimbostratus
Thanks Tim, that worked perfectly.
Here is how I ended up implementing it:
While (!$F5Connection){
$Credentials = Get-Credential -Message "Please enter F5 credentials"
$F5Connection = Initialize-F5.iControl -HostName $F5Server -Credentials $Credentials}
If((Get-F5.iControl).SystemFailover.get_failover_state() -eq 'FAILOVER_STATE_STANDBY'){Initialize-F5.iControl -HostName $F5Backup -Credentials $Credentials}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
