Big enterprise virtualization technology providers already have a mechanism to create virtual machines with given parameters on demand. Such a system would likely be overkill for a handful of physical servers. I also doubt they support the highly effective pseudo-virtualization LXC technology.
Thus I created a python "lmachine" script for our LXC servers, that copies an OS image into a selected "slot" with already pre-allocated IP number and server name. The script also modifies a couple of system files from the OS image accordingly.
The script can be downloaded here.
Preparing an LXC image
LXC images are easily created using the debootstrap utility. To make them ready for the lmachine script, you need to set the actual IP number with the IPNUMBER string and the actual server name with the VSERVERNAME string. Here is the list of files that needs to be modified:
- fstab
- lxc.conf
- root/etc/network/interfaces
- root/etc/hosts
- root/etc/hostname
- root/etc/mailname
6 comments:
What are your thoughts on:
http://www.activestate.com/blog/2011/10/virtualization-ec2-cloud-using-lxc
Running LXC from inside of EC2's XEN? Hmm...
While it is entirely possible, I can not imagine that being useful to anyone. Without controlling IP numbers allocation (even in the private address space), you are painted into corner of using loopback-bound IP numbers (127.*) only.
Nice Article, If you want to get IP address auto management, you could reuse https://github.com/theforeman/smart-proxy
If you are interested, I would be happy to try and see if we can integrate it into foreman (http://theforeman.org)
You are welcome to take the script and integrate it into the foreman system.
You can even borrow my LLS scripts to allocate space for the vservers dynamically.
Currently I work for Dell and thought your blog on Linux zealot is really informative. The information about IP address in very useful. Thanks for sharing with us.
Running LXC in AWS's EC2 is very useful in several ways.
One I just tried the other day was to deploy OpenStack in EC2 using LXC containers... it worked!
Also, deploying container bound servers that are all in their own DNS/DHCP network can be very useful on EC2.
Post a Comment