Ubuntu – Launch instance in Openstack always results in “Error: No valid host was found”

openstackopenstack-autopilotvirtualization

There seem to be a coupe of other questions around this but no answers, so I'll ask as well.

I installed Openstack Juno via Landscape Autopilot and the Openstack Horizon dashboard shows all compute, storage and networking services active.

When I launch an instance within a project (any project, including admin) I eventually get an error, example below:

Error: Failed to launch instance "docker_test": Please try again later [Error: No valid host was found. Exceeded max scheduling attempts 3 for instance 34722fff-8e59-47a0-898d-853a5d3c8dd8. Last exception: [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2039, in _do].

I don't really know where to start with this. Any ideas?

Best Answer

The solution to my problem lay in the fact that I'm running my whole Openstack setup in a virtualised environment, in particular each of my compute nodes is a VM. By default my set up did not allow nested VMs, i.e. my compute node VMs could not themselves create instance VMs inside of themselves. I found this article very helpful: Configure DevStack with KVM-based Nested Virtualization

The key piece was exposing the host virtualisation extensions to the node VM by editing the VM’s libvirt XML configuration via virsh utility:

sudo virsh edit compute-node01-vm

Change the below snippet to expose the host CPU features to the VM:

From

<cpu mode='custom' match='exact'>
  <model fallback='allow'>Opteron_G3</model>
</cpu>

To

<cpu mode='host-passthrough'> </cpu>

The restart all the nodes for the changes to take effect.

Related Question