Forum Discussion

Mike_Thompson_9's avatar
Mike_Thompson_9
Icon for Nimbostratus rankNimbostratus
Mar 30, 2007

Active Passive Member Problem

For some reason, when I call the get_failover_state method from the System module, I am getting the same result for each device.

 

 

I always get FAILOVER_STATE_STANDBY. However, if I login in to the UI on each device, there is clearly a device in STANDBY and a device in ACTIVE.

 

 

Here is my code. Not sure what I could be doing wrong, this should be a simple call:

 

 

Dim URL As String = "https://" & inDeviceName & "/iControl/iControlPortal.cgi"

 

 

_F5System.Url = URL

 

_F5System.Credentials = CredentialBuilder(URL)

 

_F5System.AllowAutoRedirect = False

 

_F5System.PreAuthenticate = True

 

_F5System.Timeout = 20000

 

 

Public Function GetFailoverState() As F5System.SystemFailoverFailoverState

 

_F5System.get_failover_state()

 

End Function

 

 

Any help would be appreciated.

3 Replies

  • Obvious question first: are you sure you are updating the URL to each server and all requests aren't going through a shared management address? You can tell this by looking at the apache logs (/var/log/http/access_log) on each server.

     

     

    If that isn't the case then here's some background:

     

     

    The implementation for this method does a database lookup for the following key: "failover.bigipunitmask". If the db key does not exist -or- the value is 0 (or access to the db fails), the returned value from the method will be FAILOVER_STATE_STANDBY, otherwise it will return FAILOVER_STATE_ACTIVE.

     

     

    If you have access to your BIG-IP, you can run the following command to from the CLI to get that db key

     

     

    $ b db failover.bigipunitmask

     

     

     

    If you find that the values are different for your separate systems, but the iControl interface is still returning FAILOVER_STATE_STANDBY, you'll likely need to open a support ticket with Product Support to find out what is going on. If the dbkey for each system is 0 or non-existant, then something is amiss with your configuration.

     

     

    -Joe
  • Thanks Joe. I ran the query on each device with the following results:

     

     

    Failover.BigipUnitMask = 0

     

    Failover.BigipUnitMask = 3

     

     

    Yes, I am fairly sure I have the URL correct and I am not going through a shared management address. I was not expecting a return value of 3 from the second device. Your thoughts? Should I open a support ticket for further investigation.
  • Those are the correct DB values. 0 for standby, 3 for active. I just checked the source for that interface and the logic goes like this

    set dbval = dblookup("Failover.BigipUnitMask")
    if dblookup failed or dbval eq 0 then return FAILOVER_STATE_STANDBY
    else return FAILOVER_STATE_ACTIVE

    The logic is fairly straight forward. The only loophole I can see is if the dblookup fails for some reason, then it will return a state of standby. You can test this out by adding the Management.DBVariable interface to your project and trying to extract the db key that way. If that method succeeds then the dblookup isn't the problem.

    If I were you, here's what I'd first check the apache logs for each system after you make the method call to make sure that the call is going to the correct system. If you find that they are, then I'd try to test out the DBVariable methods to try to extract the key manually. If that succeeds, then I'm not sure where to go from there. You'll likely have to open a support ticket.

    -Joe