Wednesday, March 4, 2009

ECP and IP address retrieval

The Enomaly Elastic Computing Platform has to retrieve the IP address of the host in which it is running. There are several reasons for this but this isn't the reason for this entry. The concern here is how the IP address is actually obtained from the host machine. This must be accomplished in Python since that is what ECP is written in.

There are several Python recipies available for obtaining the IP address of a given machine. However, on Linux, you must know the which network interface you are retrieving the address from. In the current release of ECP, the default network interface to check is virbr0 since this is the interface that is setup when ECP is started. There are a few problems with this approach.

First, I noticed that there is no real way to change which network interface ECP will use as a basis for IP address retrieval. However, this has been addressed in the ECP trunk. Users may now specify a specific interface in the configuration by providing a enomalism2.ip_interface value. If this value is provided, ECP will check this interface for the machine IP address. One thing that hasn't changed about the host IP address retrieval in ECP is the fact that when all else fails, 127.0.0.1 is returned. This is a good thing since we can always identify a machine IP address as opposed to an empty string.

Secondly, ECP hosts may have several active network interfaces. What then? This deficiency was pointed out here. This is a very valid concern for some people. What would be needed here is a way to associate network interfaces with users in ECP. This results in a new database abstraction that could have some potential in a future ECP release. For the time being, users are restricted to a single network interface that is at least configurable now.