Archive
Posts from 2009
How does crossbow deal with MAC address conflicts?
When I gave my presentation on Solaris network virtualization a few months back, one of the folks in the audience asked me how Crossbow deals with duplicate MAC detection. I didn't have a solid answer for the gentlemen that asked, but thanks to Nicolas Droux from Solaris kernel engineering, now I do. Here is what Nicolas had to say about this topic on the network-discuss mailing list: "When a VNIC is created we have checks in place to ensure that the address doesn't conflict with another MAC address defined on top of the same underlying NIC. When the MAC address is generated randomly, and the generated MAC address conflicts with another VNIC, we currently fail the whole operation…
$ read more →Implementing locks in shell scripts
I have been working on a shell script that manages lxc-containers, and came across a use case last where it is possible for two yum processes to interfere with each other. To ensure that only one yum process is run at a single point in time, I implemented file based locks using flock(1). Flock makes this super easy, since it has a "-x" option to create an exclusive lock (this is the default), and a "-n" option which causes flock to exit with a return code of 1 if it can't obtain the lock. This allow code similar to the following to be used to protect sensitive areas: In my case this tiny bit of code ensures that only one yum process is able to run, which helps keep my package database in a sane state.
$ read more →Downloading Fedora and CentOS source code with yumdownloader
One of the things I really like about Linux is the availability of source code for the kernel and userland applications. If I encounter an issue where a program is misbehaving for some given reason, I can grab a source RPM from a network repository and start poking around to see what is going on. Fedora and CentOS provide the yumdownloader utility to download binary RPMs, and source RPMs when the "--source" option is specified: Once a source RPM is downloaded, you can install it and begin looking through the source. Sweet!
$ read more →Installing lxc-containers on Fedora hosts
During the Q&A period of my KVM presentation the other night, the world famous Mike Warfield tipped me off to the lxc-container project. Lxc-containers are a lightweight virtualization solution similar to Solaris zones and openvz, and allow you to create one or more virtual execution environments on a Linux server. It appears all of the kernel plumbing needed to support lxc-containers has been integrated (check out the various namespace projects on LWN for details) into the latest Linux kernels, and distribution support for lxc-containers is starting to trickle in. To install lxc-containers from the source RPM on sourceforge, you will first need to make sure you have the required dependencies…
$ read more →Installing Python modules with easy_install
I have been spending some of my spare time reading Learning Python and experimenting with various Python modules. One of the cool things about the Python modules facility is easy_install, which allows you to install modules from local files or a remote location. To install a module from a local directory, you can pass the name of the module to easy_install: To install from a network location, you can pass a URL with the location of the module to easy_install: You can also pass the name of a module to easy_install: Which will cause easy_install to search the Python package index, and install the module based on information in the package index. I loves me some Python!
$ read more →