Merge "Make dependency on libvirt dynamic"

This commit is contained in:
Jenkins 2013-06-10 22:30:44 +00:00 committed by Gerrit Code Review
commit f606adb4a8
4 changed files with 110 additions and 96 deletions

View File

@ -12,8 +12,8 @@ iptables
ebtables
sqlite3
sudo
kvm
qemu # dist:wheezy,jessie
kvm # NOPRIME
qemu # dist:wheezy,jessie NOPRIME
libvirt-bin # NOPRIME
libjs-jquery-tablesorter # Needed for coverage html reports
vlan
@ -27,7 +27,7 @@ python-paste
python-migrate
python-gflags
python-greenlet
python-libvirt
python-libvirt # NOPRIME
python-libxml2
python-routes
python-netaddr

View File

@ -7,11 +7,11 @@ genisoimage # required for config_drive
iptables
iputils
kpartx
kvm
kvm # NOPRIME
# qemu as fallback if kvm cannot be used
qemu
qemu # NOPRIME
libvirt # NOPRIME
libvirt-python
libvirt-python # NOPRIME
libxml2-python
mysql-community-server # NOPRIME
parted

View File

@ -7,9 +7,9 @@ genisoimage # required for config_drive
iptables
iputils
kpartx
kvm
kvm # NOPRIME
libvirt-bin # NOPRIME
libvirt-python
libvirt-python # NOPRIME
libxml2-python
numpy # needed by websockify for spice console
m2crypto

View File

@ -237,6 +237,7 @@ function configure_nova() {
# Force IP forwarding on, just on case
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
@ -272,12 +273,14 @@ function configure_nova() {
fi
fi
fi
fi
# Prepare directories and packages for baremetal driver
if is_baremetal; then
configure_baremetal_nova_dirs
fi
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
if is_service_enabled quantum && is_quantum_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF; then
# Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
cat <<EOF | sudo tee -a $QEMU_CONF
@ -296,8 +299,6 @@ EOF
LIBVIRT_DAEMON=libvirtd
fi
if is_fedora || is_suse; then
if is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -le "17" ]]; then
sudo bash -c "cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
@ -349,6 +350,7 @@ EOF"
# the system configuration (modules, filesystems), we need to restart
# libvirt to detect those changes.
restart_service $LIBVIRT_DAEMON
fi
# Instance Storage
@ -436,8 +438,10 @@ function create_nova_conf() {
if is_baremetal; then
iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
fi
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
fi
iniset $NOVA_CONF DEFAULT instance_name_template "${INSTANCE_NAME_PREFIX}%08x"
iniset $NOVA_CONF osapi_v3 enabled "True"
@ -636,10 +640,15 @@ function install_novaclient() {
# install_nova() - Collect source and prepare
function install_nova() {
if is_service_enabled n-cpu; then
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
if is_ubuntu; then
install_package kvm
install_package libvirt-bin
install_package python-libvirt
elif is_fedora || is_suse; then
install_package kvm
install_package libvirt
install_package libvirt-python
else
exit_distro_not_supported "libvirt installation"
fi
@ -659,6 +668,7 @@ function install_nova() {
fi
fi
fi
fi
git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH
setup_develop $NOVA_DIR
@ -698,9 +708,13 @@ function start_nova() {
screen_it n-cell "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cells --config-file $NOVA_CELLS_CONF"
fi
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
# Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group.
screen_it n-cpu "cd $NOVA_DIR && sg $LIBVIRT_GROUP '$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM'"
else
screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM"
fi
screen_it n-crt "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cert"
screen_it n-net "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-network --config-file $NOVA_CONF_BOTTOM"
screen_it n-sch "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-scheduler --config-file $NOVA_CONF_BOTTOM"