Monday, May 30, 2011

lc-tools 0.5.0.0 released!

A lot of time passed since the latest lc-tools release, and now it's almost summer, so it's time for updates!

The first news is that libcloud is now an Apache Top Level Project (TLP) and new version 0.5.0 has been released with some new features, bug fixes and new support for working with storage and load balancers. And it's a perfect time for new lc-tools release!

There are not so many new features in this lc-tools release, most of the changes were to chase internal libcloud changes. Additionally, I've changed versioning scheme a little and now it looks like $libcloud_version$lctools_version, where $libcloud_version is the version of libcloud current release was targeted and tested with.

The only new major change is the addition of lb-* scripts to manage load balancers. You can get more information on them from Documnetation.

You can install the new version using either easy_install:

easy_install lctools

or by downloading and installing it by hands:

lctools-0.5.0.0.tar.gz

SHA256 (lctools-0.5.0.0.tar.gz) = f09629664a5209be687c56cfe07e123939e28b18070b719436307a74b823f10b

Happy hacking on the cloud stuff!

Wednesday, May 18, 2011

Dealing with pkg-config detection of FreeBSD's base OpenSSL

Recently I spotted a software that uses pkg-config to find OpenSSL on the system. This way doesn't work on FreeBSD: it does have OpenSSL in base system, but it doesn't supply '*.pc' file, unfortunately. So, when configure script tries to execute pkg-config openssl it fails, obviously.

There were a number of solutions suggested for this problem on #bsdports like replacing 'pkg-config openssl' with 'pkg-config pkg-config', depending on openssl from ports etc, but the cleanest solution is to define libssl_LIBS and libssl_CFLAGS environment variables, as was suggested by bapt@. In port's Makefile it would look something like this:
USE_OPENSSL=yes
CONFIGURE_ENV+=libssl_CFLAGS="-I${OPENSSLINC}" libssl_LIBS="-L${OPENSSLLIB} -lssl"

Yes, configure will not call pkg-config if we define these 'libssl_*' variables. While it looks quite simple, this issue took surprisingly a lot time to figure everything out. :(

Friday, May 6, 2011

Managing OpenStack using libcloud and lc-tools

OpenStack is getting more and more popular and number of its installation increases day by day. We've got one as well. :-) While there are quite a number of bindings and tools to connecting to its API I prefer use familiar proven tools like libcloud and lc-tools. And since OpenStack supports both EC2-compatible and Rackspace-compatible APIs, there are two ways connecting to it.

EC2 API


To use EC2-compatible API, pick EUCALYPTUS driver like that:



You need to define EC2_ACCESS_KEY and EC2_SECRET_KEY variables to match your setup. Hostname, port and path arguments which are passed to constructor could be extracted from your EC2_URL environment variable.

Note: if you're not using trunk version of libcloud, you will need to adjust imports a little, i.e. strip compute. part from them.

Rackspace API


To use Rackspace-compatible API you will to check out trunk version of libcloud (please refer here to obtain it) which provides OPENSTACK driver, which could be used in a similar fashion:



Again, here you will need to redefine NOVA_API_KEY and NOVA_USERNAME for your setup and grab host and port from NOVA_URL.

Let me remind you once again that you need trunk version of libcloud to make it working. One more thing: OpenStack is not fully compatible with Rackspace API, so not everything will work smooth.

lc-tools


lc-tools is a set of command line tools on top of libcloud to manage your cloud servers. Git version of lc-tools supports working with OpenStack both through EC2 and Rackspace compatible APIs. Here's config samples for both:


[ec2compat]
driver = eucalyptus
access_id = CHANGE_ME
secret_key = CHANGE_ME
extra = { "host": "127.0.0.1", "secure": False, "port": 8773, "path": "/services/Cloud" }

[rscompat]
driver = openstack
access_id = nova_admin
secret_key = CHANGE_ME
extra = {"host": "127.0.0.1", "port": 8774}


And just check if it works by executing lc-node-list -p ec2compat and lc-node-list -p rscompat.

References

* libcloud
* lc-tools