From 43d950843769135d32ce316cfb0f72697a879623 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 30 Jan 2014 17:49:22 -0500 Subject: [PATCH] Install libguestfs for nova-compute on Ubuntu We were already installing this for n-cpu on rpm distros, but not Ubuntu. Install it so that nova-compute can use it for file injection, which is the preferred method over nbd. Set CONF.libvirt.inject_partition to -1. This enables using libguestfs to determine the proper partition to inject into. Don't bother trying to load the nbd kernel module anymore. It won't be used since we know always expect libguestfs to be installed. Change-Id: Ifa9d95bf759f1dad8685590a2df242d852dd2cb0 --- files/apts/n-cpu | 2 +- lib/nova | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/files/apts/n-cpu b/files/apts/n-cpu index 29e37603b7..b287107256 100644 --- a/files/apts/n-cpu +++ b/files/apts/n-cpu @@ -1,8 +1,8 @@ # Stuff for diablo volumes -nbd-client lvm2 open-iscsi open-iscsi-utils # Deprecated since quantal dist:precise genisoimage sysfsutils sg3-utils +python-guestfs diff --git a/lib/nova b/lib/nova index 9db19ed532..d5f7514be5 100644 --- a/lib/nova +++ b/lib/nova @@ -240,8 +240,10 @@ function configure_nova() { sudo sysctl -w net.ipv4.ip_forward=1 if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then - # Attempt to load modules: network block device - used to manage qcow images - sudo modprobe nbd || true + # When libguestfs is available for file injection, enable using + # libguestfs to inspect the image and figure out the proper + # partition to inject into. + iniset $NOVA_CONF libvirt inject_partition '-1' # Check for kvm (hardware based virtualization). If unable to initialize # kvm, we drop back to the slower emulation mode (qemu). Note: many systems