Get Pool Members

Currently I am using

Pool.CommonIPPortDefinition[][] members = Pool.get_member(pool_list);

to return a list of all pool members so I can duplicate the list that I see when logged into the F5 through putty. Well it appears that this array only returns the ip address and the port number. It does not contain information about its availability. Is it possible that im looking in the wrong place for this data?

Nevermind I found it in the LocalLBPoolMember namespace and used

PoolMember.LocalLBPoolMemberMemberStatistics[] member_stat_list = PoolMember.get_all_statistics(pool_list);

It works great.

When logged into the Big-IP administration console, if you go to view pool members, it is going to show their domain (machinename.domain.com) in the address field however when using

using PoolMember;
private LocalLBPoolMember PoolMember = new LocalLBPoolMember();
PoolMember.LocalLBPoolMemberMemberObjectStatus[][] objStatus = PoolMember.get_object_status(pool_list);

it returns an IP address in the objStatus[j].member.address element. Is there a way for me to get the machine name instead of an IP address?

I believe that is an option in the GUI Preferences to display hostnames when possible. The GUI is doing a DNS lookup on the actual address and changing the presentation. iControl uses the same underlying framework as the GUI and CLI (bigpipe) but does not have the DNS lookup capabilities. Pool members are stored by address in the configuration and that is what iControl is pulling the data from. If you want the DNS names for your pool members, you’ll have to do a DNS lookup in your calling app.

-Joe

We also have the following methods in the System.Inet interface that you can make use:

- ip_to_hostname

- hostname_to_ip

- service_number_to_service_name

- service_name_to_service_number

Regards,

Loc

I am almost done with my application, I just would like to know how to do a simple console.write on a command like this

PoolMember.LocalLBPoolMemberMemberObjectStatus[][] objStatus = PoolMember.get_object_status(pool_list);

That way I can just output the names of the members for testing. Thanks!

Nevermind! I figured it out i think

Glad to hear it! Keep us updated on how your project is going…

-Joe

I have a similar question, so instead of creating a new thread I thought to continuing it.

When we configure pool members, I am creating nodes and adding those nodes as the pool members. Initially I created nodes using IP address, and it works. But instead of creating nodes with IP address I want to create using machine names.

Say my IP is 10.100.170.10 and my machine name is LK-LT5678, I want to create a node using the machine name, instead of creating it with IP address.

Thanks,

Unfortunately, the BIG-IP stores PoolMember by it’s address and port. You can configure user friendly names at the Node Address level but that is just a convenience feature in the GUI and is displayed in the Pool Member statistics/state pages. There currently is no way to configure a pool member other than by it’s IP Address and port. This is true in the GUI as well as iControl.

The bottom line on features requests like this is: If you can do it in the GUI, then odds are you can with iControl. But, on the other hand, if you can’t do it in the GUI, it’s a very good chance you can’t in iControl as well…

-Joe

[ BIG-IP stores its node with address and port ],

I want that address part to be fully qualified name, instead of IP address {Is there a way}

In our application we have to write a fully qualified names like

LT-KM3456.us.f5.com, and to access the web page, http://LT-KM3456.us.f5.com/index.htm (say). Now I have two boxes which are running the application (LT-KM3456.us.f5.com, LT-KM3478.us.f5.com) and they are pointing to the same Database.

I want to load balance my web application.

client ------->

→ F5 machine -----> LT-KM3456.us.f5.com

`--> LT-KM3478.us.f5.com

this is what I am am looking at. Most of the time clients want it this way, so, there has to be a way to do this.

Thanks,

Someone above alluded to the best answer for you right now - use DNS to look up names.

.Net and Java both have DNS interfaces, and everything else can use DNS through an exec call, so you can do it this way.

The only real concern I would have is performance to the DNS server - if it degrades, your app will degrade by a large amount.

Don.

Bottom line is that the BIG-IP will have to resolve a name to an address anyway to be able to create the physical connection to the backend server.

Your example about load balancing from BIG-IP to two web servers (LT-KM3456.us.f5.com, and LT-KM3478.us.f5.com) is very very common. Typically the way this is configured is to create a DNS name for your exposed Virtual Server address (VIP). Then, configure your backend servers to accept that domain name in the Host HTTP request header. All of the HTTP headers (including the Host, the URI, etc) will be passed on to the backend server as they were passed into the Virtual Server.

BIGIP (Virtual Server LT-KMCommon.us.f5.com - 20.20.20.20)

→ Member (LT-KM3456.us.f5.com - 10.10.10.10)

→ Member (LT-KM3478.us.f5.com - 10.10.10.20)

Where 20.20.20.20 is the external Virtual Server address and the 10.* network is internal to your BIG-IP. Just configure your web apps to take LT-KMCommon.us.f5.com as a Host Header, and you should be all set. The pool members are completely hidden from the user and are masked by the virtual server address.

I guess, I’m missing why you are tying how BIG-IP stores it’s PoolMember configuration with how the client accesses your Virtual Server. Please let me know if I haven’t explained it clearly enough.

-Joe

Joe,

Thanks for the detailed explanation. You were right in the sense that “BIG-IP will have to resolve a name to an address anyway to be able to create the physical connection to the backend server”.

Finally, I have configured the Big-IP.

Virtual Server 20.20.20.20

- member = 10.10.10.10

- member = 10.10.10.20 (SAY) because though I saved typing LT-KM3478.us.f5.com, but it was saved as IP address).

Now, when I send a request to Virtual Server IP (say http://20.20.20.20:4343/ofr/index.jsp?app=om), typically it should forward it to http://10.10.10.10:4343/ofr/index.jsp?app=om. But client will see “http://20.20.20.20:4343/ofr/index.jsp?app=om” only.

Now problem is even if the request is forwarded to “http://10.10.10.10:4343/ofr/index.jsp?app=om” internally, “http://10.10.10.10:4343/ofr/index.jsp?app=om” does not work. because it has to be

“LT-KM3456.us.f5.com:4343/ofr/index.jsp?apps=om” this to work.

Thats the reason I was actually trying to save the pool members by their names rather than by IP.

Is there a way around it ? writing something like

if (request){

hostname = getHostName(getNextPoolMembersIP());

sendRequestToHostName and attach the browser session (hostName)

}

if (response){

convert hostName to IP of Virtual Server, and send back response to client.

Yea, we have to maintain the session so that every time that same client send request.

It should go to the same Pool Member.

}

---------------

I am not sure if that should be the approach, but this is what I am thinking. Let me know if you know the way around it.

Thanks,

I still think some things aren’t clear. If your external VIP is 20.20.20.20 and a client requests http://20.20.20.20:4343/foo, the following will be sent back to the backend server

GET /foo HTTP/1.1
Host: 20.20.20.20:4343
...

I’ve never heard of a scenario where a user is trying to virtualize websites behind a virtual server yet maintain the separate host names for each independent server. The most common scenario is to have a DNS entry for the service (in your case www.foo.com resolves to 20.20.20.20). Then the configuration for each web server is setup to accept “www.foo.com” as it’s host header (10.10.10.1, 10.10.10.2, …). This way no configuration is needed (outside of the additional host header setting) and each server can be configured identically easing deployment for additional servers down the road. If you don’t want to DNS’ify your VIP, you can still configure the backend servers to accept the Host header of the VIP (20.20.20.20) despite the fact that they are not listening on that address).

If you truly do need to virtualize multiple webservers while not configuring the servers in a virtualized manner, you can do some fun and games with tweaking the host headers. You’ll have to build a mapping layer in an iRule with a list of hostnames for each of your servers along with their ip addresses. Then, you could determine which pool member address was selected and then modify the host header.

Keep in mind that most web applications will build embedded links in the pages with links to the supplied hostname. In your case, you will have links for “http://LT-KM23456.us.f5.com:4343/…” is certain client connections and “http://LT-KM2367.us.f5.com:4343/…” in others. Then the client will click on those links and they won’t work unless you have them mapped to the VIP address as well. If you are using a DNS name or just the VIP address, the applications will return URLs in the form of “http://www.foo.com:4343/…” or “http://20.20.20.20:4343/…” that will correctly link back to the VIP.

If you really do need to virtualize non-virtualized applications, let me know and I’ll get you an iRule that will do it. But beware of the side effects with embedded links as mentioned above.

-Joe

Stefan, the ip_to_hostname() performs a local DNS lookup on the specified address and returns either the DNS resolved name (if one exists), or the source ip address (if the DNS lookup didn’t return a name).

The get_screen_name() method returns the internal configuration screen name alias stored in the BIG-IP’s configuration.

Odds are if ip_to_hostname() isn’t working, you don’t have your BIG-IP’s DNS settings setup correctly to the nameserver that handles your hostnames for your server farm. The get_screen_name() method will work as it is just pulling data from the internal configuration.

-Joe