KVM and LXC on the same host

Is there any way to create a host with 2 different virtualization drivers associated? We need to deploy LXC containers and KVM virtual machines on the same host, but when we add a new host it will only let us specify 1 virtualization driver.
We added 2 entries on /etc/hosts, lxc-node0 and kvm-node0, pointing to the same computer, same IP. Then, we added this 2 hosts (which are actually the same PC) with different virtualization drivers and worked, this let us deploy containers and virtual machines on the same PC. The problem with this solution is that OpenNebula treats them as different hosts, and the monitoring info is not good. For example, if we deploy 1 KVM virtual machine with 1 cpu and 3 containers with 3 cpu each, it will show 100 allocated cpu on kvm-node0 and 300 allocated cpu on lxc-node0, but what we really need is the total. Any ideas?


We don’t have any way to add a host with 2 drivers as you describe. I think that your scenario is a very specific problem that will only happen in testing/dev environments, and your current solution is probably the best one at the moment.