CloudStack LXC Support

Apache CloudStack 4.2 has introduced support for Linux Containers. LXC is a light weight containment system very like “chroot” environment, FreeBSD Jails or Solaris Containers.

Containers share the same kernel as the host. So its not possible to run other operating systems. While it would be possible to run other Linux distributions, some modifications to the guest OS’s start/stop scripts might be necessary.

High Performance Computing (HPC) environment would benefit from containers. A Hadoop cluster running in containers would be far more efficient than running under a Hypervisor like Xen or KVM.

Couple of things to keep in mind while playing around with CloudStack 4.2’s LXC support:

  1. The community built RPMS available don’t seem to have LXC support compiled in. See CLOUDSTACK-4849 for the fix if you run into the error “Could not find corresponding resource manager for LXC”. The instructions for building non-OSS RPMS are here
  2. CentOS 6.x and Ubuntu 12.04 LTS distributions come with older versions of libvirt and kvm-qemu packages. libvirt 1.0.0 or higher and Qemu/KVM 1.0 or higher is required. Ubuntu 13.10 has more recent versions and seems to be a good choice to use as an LXC host. The cloudstack-agent Deb certainly is happy to install on Ubuntu 13.10 hosts. While its certainly possible to install more recent version of kvm-qemu and libvirt pakages on Ubuntu 12.04 LTS/CentOS 6.x system, I found it to be very hackish to mix repos.
  3. After configuring the LXC cluster and adding the LXC host, you will require OS templates. No standard template is provided along with CloudStack. You would need to create one on your own. It would be best to create a template of the same distribution as the host’s. If you are using Ubuntu 13.10, create a template of Ubuntu 13.10 itself. CloudStack seems to want templates in the tar format
  4. Once you have create an OS template that’s compatible with the host’s running distribution, import it into CloudStack as a template
  5. Attempting to create new instance from the template fails for me at this time. CloudStack management server just spits out tons of messages as below:
    2013-10-21 12:21:25,553 DEBUG [allocator.impl.FirstFitAllocator] (Job-Executor-17:job-66 = [ 7ffe9e13-c4e8-49ba-9ae4-4aff70197a4a ] FirstFitRoutingAllocator) Not considering hosts: [Host[-8-Routing]] to deploy template: Tmpl[204-TAR-204-2-38924546-779b-3ac1-bd1e-de8954924766 as they are not HVM enabled

There seems to be very limited information available currently on CloudStack and LXC. Please do let the cloudstack-users mailing list know if you make further progress. Also see

By Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.


  1. did you happen to find the solution FirstFitRoutingAllocator) Not considering hosts: [Host[-8-Routing]] to deploy template: Tmpl[204-TAR-204-2-38924546-779b-3ac1-bd1e-de8954924766 as they are not HVM enabled, I am getting the same error

  2. Hi Chinu,

    I didn’t LXC+CloudStack further as at this time (ACS 4.2.x), it seems to me that LXC does not receive the same love as the other Tier 1 hypervisors like XenServer, KVM or VMware. The lack of good LXC on CloudStack documentation is another big issue.

    I hope the situation changes soon so I can use LXC in production.

  3. It didn’t change. 🙂 I am just trying to add the host, but it’s still failing on message “KVM not loaded”.

Leave a comment

Your email address will not be published. Required fields are marked *