Nested Virtualization

Hi, I have opennebula setup on physical server. Few CentOS 7 and Ubuntu VMs are build over it.

These VMs, I need to use for further virtualization in lab e.g. hosts for openstack, ovirt or another opennebula instances (frontend/compute) within it.

I can do same using virtualbox or vmware workstation or ESXi but how to do same in VM’s hosted in opennebula.

Appreciate your support

Add to the host machine, in boot grub config kvm-intel.nested=1, /etc/default/grub on debian for example:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet kvm-intel.nested=1"
GRUB_CMDLINE_LINUX=""

then you need set the cpu model as “host-passthrough” in the instance.

In case you are interested.

For testing I use Vagrant/Libvirt in linux and use nesting as well:

Then you also add this to your Vagrantfile:

  # VM Resources, allow nested virtualization
  config.vm.provider "libvirt" do |l|
    l.nested = true
    l.cpu_mode = "host-model"
    l.memory = 1024
    l.cpus   = 1
    l.storage :file, :size => '10G'
  end

Thanks… I am using Opennebula as platform and within that, I had hosted another 2 VMs used for Frontend and Compute. Able to successfully installed and configure frontend on hosted VM’s but while provisioning VM. following error I am getting.

Fri Dec 29 12:01:21 2017 [Z0][VM][I]: New state is ACTIVE
Fri Dec 29 12:01:21 2017 [Z0][VM][I]: New LCM state is PROLOG
Fri Dec 29 12:01:31 2017 [Z0][VM][I]: New LCM state is BOOT
Fri Dec 29 12:01:31 2017 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/1/deployment.0
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: ExitCode: 0
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/deploy ‘/var/lib/one//datastores/0/1/deployment.0’ ‘frontend’ 1 frontend
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: error: Failed to create domain from /var/lib/one//datastores/0/1/deployment.0
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: error: invalid argument: could not find capabilities for arch=x86_64 domaintype=kvm
Fri Dec 29 12:01:33 2017 [Z0][VMM][E]: Could not create domain from /var/lib/one//datastores/0/1/deployment.0
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: ExitCode: 255
Fri Dec 29 12:01:33 2017 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Fri Dec 29 12:01:33 2017 [Z0][VMM][E]: Error deploying virtual machine: Could not create domain from /var/lib/one//datastores/0/1/deployment.0
Fri Dec 29 12:01:33 2017 [Z0][VM][I]: New LCM state is BOOT_FAILURE

you saw the reply from @dubcl? you will neeed to enable Nested virtuaization on the HOST, that is the actual cluster where your node VM could be scheduled to run.

You will also need to configure properly your VM also, by passing the host-passthrough cpu parameter. I guess this parameter can be set in the VM template of the host cloud.

I guess you will need the administrator of the host cluster and cloud to help you, settings are required both on the physical hosts and the VM template that your nested opennebula will use.

In principle, I have the same setup as you. Using vagrant instead of opennebula, but it is also KVM-Libvirt. I run 2 nodes (1GB mem each) and one frontend, and I can spin 4 VMs with Debian 9, test virtual networks, etc. It is pretty fast and usable.

You should be able to get it working.