Enabling nested virtualization in VMWare

Hello community,

I’m writing a new charm to deploy our application. Our provider Vcenter, and our application needs to run in KVM under the ESXi VM - So, I need to enable nested virtualization on the machines that juju spawns.

I can’t find how to instruct juju to enable that setting on the created VMs. Is somebody aware of how to do so?

Thanks!

1 Like

Welcome @fsedano, thanks for your question.

I don’t believe so at this stage. It should be possible to enable nested virtualization via the vSphere Web Client, however. @babbageclunk could you please correct me?

It’s possible that enabling nested virtualization for specific instances would enable KVM instance creation for Juju to work via its standard syntax:

juju add-machine kvm:2 # assuming machine 2 supports nested virtualization

@fsedano it might be worthwhile testing the following steps and seeing how far you get:

  1. bootstrap to vSphere (this has presumably already been done)
  2. create a Juju model (juju add-model)
  3. use Juju to create a standard instance (juju add-machine --constraints "mem=8G")
  4. use the vSphere web client to enable nested virtualization
  5. use Juju to create containers within the standard instance created earlier (juju add-machine kvm:0)

Sorry @fsedano, as far as I know @timClicks is right - at the moment there’s no way to configure the VM to enable nested virtualisation from Juju. Once it’s enabled though, deploying to KVMs inside machines should work.

Why not deploy to lxc instead of nested KVM

1 Like

Thanks folks. I’m pretty sure that would work, but it would defeat one of the main advantages of using juju for me - Automatic machine creation.

A sightly different idea (but still a hack) would be to enable nested virtualization on the template. Still, fragile if for any reason template is updated :frowning:

Hey,

My application requires a full VM, not a container, so I don’t think that would work.

Juju would still be able to create KVM-based VMs. Enabling nested virtualisation would be a one off per host.

Hey tim. Thanks for replying.

Nested virtualization AFAIK is a per-vm setting, no per-host: