Merge "Add support for setting extra networking configuration options."
diff --git a/exercises/euca.sh b/exercises/euca.sh
index d704279..16b5f8e 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -162,7 +162,7 @@
# case changed with bug/836978. Requesting the status of an invalid instance
# will now return an error message including the instance id, so we need to
# filter that out.
-if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -ve \"\\\(InstanceNotFound\\\|InvalidInstanceID\[.\]NotFound\\\)\" | grep -q $INSTANCE; do sleep 1; done"; then
+if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -ve '\(InstanceNotFound\|InvalidInstanceID\.NotFound\)' | grep -q $INSTANCE; do sleep 1; done"; then
die $LINENO "server didn't terminate within $TERMINATE_TIMEOUT seconds"
fi
diff --git a/files/apts/general b/files/apts/general
index a1fcf3c..ec6dd0d 100644
--- a/files/apts/general
+++ b/files/apts/general
@@ -1,5 +1,4 @@
bridge-utils
-pep8
pylint
python-pip
screen
diff --git a/files/apts/horizon b/files/apts/horizon
index 2c2faf1..e1ce85f 100644
--- a/files/apts/horizon
+++ b/files/apts/horizon
@@ -11,7 +11,6 @@
python-webob
python-kombu
pylint
-pep8
python-eventlet
python-nose
python-sphinx
diff --git a/files/apts/nova b/files/apts/nova
index c24333c..6a7ef74 100644
--- a/files/apts/nova
+++ b/files/apts/nova
@@ -12,8 +12,8 @@
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-migrate
python-gflags
python-greenlet
-python-libvirt
+python-libvirt # NOPRIME
python-libxml2
python-routes
python-netaddr
diff --git a/files/rpms-suse/general b/files/rpms-suse/general
index b8ceeb7..93711ff 100644
--- a/files/rpms-suse/general
+++ b/files/rpms-suse/general
@@ -8,7 +8,6 @@
psmisc
python-cmd2 # dist:opensuse-12.3
python-netaddr
-python-pep8
python-pip
python-pylint
python-unittest2
diff --git a/files/rpms-suse/horizon b/files/rpms-suse/horizon
index 7e46ffe..405fb7a 100644
--- a/files/rpms-suse/horizon
+++ b/files/rpms-suse/horizon
@@ -17,7 +17,6 @@
python-mox
python-netaddr
python-nose
-python-pep8
python-pylint
python-sqlalchemy-migrate
python-xattr
diff --git a/files/rpms-suse/nova b/files/rpms-suse/nova
index a3fd479..1be24a8 100644
--- a/files/rpms-suse/nova
+++ b/files/rpms-suse/nova
@@ -7,11 +7,11 @@
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
diff --git a/files/rpms/general b/files/rpms/general
index 764b602..d6abae9 100644
--- a/files/rpms/general
+++ b/files/rpms/general
@@ -11,7 +11,6 @@
psmisc
pylint
python-netaddr
-python-pep8
python-pip
python-prettytable # dist:rhel6 [1]
python-unittest2
@@ -29,4 +28,4 @@
# [2] : RHEL6 rpm versions of python-lxml is old, and has to be
# removed. Several tools rely on it, so we install the dependencies
-# pip needs to build it here (see tools/install_prereqs.sh)
\ No newline at end of file
+# pip needs to build it here (see tools/install_prereqs.sh)
diff --git a/files/rpms/horizon b/files/rpms/horizon
index cf16cdb..e27888a 100644
--- a/files/rpms/horizon
+++ b/files/rpms/horizon
@@ -20,7 +20,6 @@
python-nose
python-paste #dist:f16,f17,f18
python-paste-deploy #dist:f16,f17,f18
-python-pep8
python-routes
python-sphinx
python-sqlalchemy
diff --git a/files/rpms/nova b/files/rpms/nova
index c74f396..f50d93f 100644
--- a/files/rpms/nova
+++ b/files/rpms/nova
@@ -7,9 +7,9 @@
iptables
iputils
kpartx
-kvm
+kvm # NOPRIME
libvirt-bin # NOPRIME
-libvirt-python
+libvirt-python # NOPRIME
libxml2-python
numpy # needed by websockify for spice console
m2crypto
diff --git a/lib/cinder b/lib/cinder
index 7e9c2ba..6636397 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -194,7 +194,7 @@
iniset $CINDER_CONF lvmdriver-1 volume_backend_name LVM_iSCSI
iniset $CINDER_CONF lvmdriver-2 volume_group $VOLUME_GROUP2
iniset $CINDER_CONF lvmdriver-2 volume_driver cinder.volume.drivers.lvm.LVMISCSIDriver
- iniset $CINDER_CONF lvmdriver-2 volume_backend_name LVM_iSCSI
+ iniset $CINDER_CONF lvmdriver-2 volume_backend_name LVM_iSCSI_2
else
iniset $CINDER_CONF DEFAULT volume_group $VOLUME_GROUP
iniset $CINDER_CONF DEFAULT volume_name_template ${VOLUME_NAME_PREFIX}%s
diff --git a/lib/nova b/lib/nova
index be526cf..508ed78 100644
--- a/lib/nova
+++ b/lib/nova
@@ -237,37 +237,39 @@
# Force IP forwarding on, just on case
sudo sysctl -w net.ipv4.ip_forward=1
- # Attempt to load modules: network block device - used to manage qcow images
- sudo modprobe nbd || true
+ if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
+ # Attempt to load modules: network block device - used to manage qcow images
+ sudo modprobe nbd || true
- # Check for kvm (hardware based virtualization). If unable to initialize
- # kvm, we drop back to the slower emulation mode (qemu). Note: many systems
- # come with hardware virtualization disabled in BIOS.
- if [[ "$LIBVIRT_TYPE" == "kvm" ]]; then
- sudo modprobe kvm || true
- if [ ! -e /dev/kvm ]; then
- echo "WARNING: Switching to QEMU"
- LIBVIRT_TYPE=qemu
- if which selinuxenabled 2>&1 > /dev/null && selinuxenabled; then
- # https://bugzilla.redhat.com/show_bug.cgi?id=753589
- sudo setsebool virt_use_execmem on
+ # Check for kvm (hardware based virtualization). If unable to initialize
+ # kvm, we drop back to the slower emulation mode (qemu). Note: many systems
+ # come with hardware virtualization disabled in BIOS.
+ if [[ "$LIBVIRT_TYPE" == "kvm" ]]; then
+ sudo modprobe kvm || true
+ if [ ! -e /dev/kvm ]; then
+ echo "WARNING: Switching to QEMU"
+ LIBVIRT_TYPE=qemu
+ if which selinuxenabled 2>&1 > /dev/null && selinuxenabled; then
+ # https://bugzilla.redhat.com/show_bug.cgi?id=753589
+ sudo setsebool virt_use_execmem on
+ fi
fi
fi
- fi
- # Install and configure **LXC** if specified. LXC is another approach to
- # splitting a system into many smaller parts. LXC uses cgroups and chroot
- # to simulate multiple systems.
- if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
- if is_ubuntu; then
- if [[ ! "$DISTRO" > natty ]]; then
- cgline="none /cgroup cgroup cpuacct,memory,devices,cpu,freezer,blkio 0 0"
- sudo mkdir -p /cgroup
- if ! grep -q cgroup /etc/fstab; then
- echo "$cgline" | sudo tee -a /etc/fstab
- fi
- if ! mount -n | grep -q cgroup; then
- sudo mount /cgroup
+ # Install and configure **LXC** if specified. LXC is another approach to
+ # splitting a system into many smaller parts. LXC uses cgroups and chroot
+ # to simulate multiple systems.
+ if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
+ if is_ubuntu; then
+ if [[ ! "$DISTRO" > natty ]]; then
+ cgline="none /cgroup cgroup cpuacct,memory,devices,cpu,freezer,blkio 0 0"
+ sudo mkdir -p /cgroup
+ if ! grep -q cgroup /etc/fstab; then
+ echo "$cgline" | sudo tee -a /etc/fstab
+ fi
+ if ! mount -n | grep -q cgroup; then
+ sudo mount /cgroup
+ fi
fi
fi
fi
@@ -278,9 +280,10 @@
configure_baremetal_nova_dirs
fi
- 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
+ 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
cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
@@ -288,19 +291,17 @@
"/dev/rtc", "/dev/hpet","/dev/net/tun",
]
EOF
- fi
+ fi
- if is_ubuntu; then
- LIBVIRT_DAEMON=libvirt-bin
- else
- LIBVIRT_DAEMON=libvirtd
- fi
+ if is_ubuntu; then
+ LIBVIRT_DAEMON=libvirt-bin
+ else
+ 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
+ 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
[libvirt Management Access]
Identity=unix-group:$LIBVIRT_GROUP
Action=org.libvirt.unix.manage
@@ -308,11 +309,11 @@
ResultInactive=yes
ResultActive=yes
EOF"
- elif is_suse && [[ $os_RELEASE = 12.2 || "$os_VENDOR" = "SUSE LINUX" ]]; then
- # openSUSE < 12.3 or SLE
- # Work around the fact that polkit-default-privs overrules pklas
- # with 'unix-group:$group'.
- sudo bash -c "cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
+ elif is_suse && [[ $os_RELEASE = 12.2 || "$os_VENDOR" = "SUSE LINUX" ]]; then
+ # openSUSE < 12.3 or SLE
+ # Work around the fact that polkit-default-privs overrules pklas
+ # with 'unix-group:$group'.
+ sudo bash -c "cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
[libvirt Management Access]
Identity=unix-user:$USER
Action=org.libvirt.unix.manage
@@ -320,13 +321,13 @@
ResultInactive=yes
ResultActive=yes
EOF"
- else
- # Starting with fedora 18 and opensuse-12.3 enable stack-user to
- # virsh -c qemu:///system by creating a policy-kit rule for
- # stack-user using the new Javascript syntax
- rules_dir=/etc/polkit-1/rules.d
- sudo mkdir -p $rules_dir
- sudo bash -c "cat <<EOF > $rules_dir/50-libvirt-$STACK_USER.rules
+ else
+ # Starting with fedora 18 and opensuse-12.3 enable stack-user to
+ # virsh -c qemu:///system by creating a policy-kit rule for
+ # stack-user using the new Javascript syntax
+ rules_dir=/etc/polkit-1/rules.d
+ sudo mkdir -p $rules_dir
+ sudo bash -c "cat <<EOF > $rules_dir/50-libvirt-$STACK_USER.rules
polkit.addRule(function(action, subject) {
if (action.id == 'org.libvirt.unix.manage' &&
subject.user == '"$STACK_USER"') {
@@ -334,21 +335,22 @@
}
});
EOF"
- unset rules_dir
+ unset rules_dir
+ fi
fi
- fi
- # The user that nova runs as needs to be member of **libvirtd** group otherwise
- # nova-compute will be unable to use libvirt.
- if ! getent group $LIBVIRT_GROUP >/dev/null; then
- sudo groupadd $LIBVIRT_GROUP
- fi
- add_user_to_group $STACK_USER $LIBVIRT_GROUP
+ # The user that nova runs as needs to be member of **libvirtd** group otherwise
+ # nova-compute will be unable to use libvirt.
+ if ! getent group $LIBVIRT_GROUP >/dev/null; then
+ sudo groupadd $LIBVIRT_GROUP
+ fi
+ add_user_to_group $STACK_USER $LIBVIRT_GROUP
- # libvirt detects various settings on startup, as we potentially changed
- # the system configuration (modules, filesystems), we need to restart
- # libvirt to detect those changes.
- restart_service $LIBVIRT_DAEMON
+ # libvirt detects various settings on startup, as we potentially changed
+ # the system configuration (modules, filesystems), we need to restart
+ # libvirt to detect those changes.
+ restart_service $LIBVIRT_DAEMON
+ fi
# Instance Storage
@@ -436,10 +438,12 @@
if is_baremetal; then
iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
fi
- iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
- iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
+ 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 DEFAULT osapi_v3_enabled "True"
+ iniset $NOVA_CONF osapi_v3 enabled "True"
if is_fedora; then
# nova defaults to /usr/local/bin, but fedora pip likes to
@@ -636,26 +640,32 @@
# install_nova() - Collect source and prepare
function install_nova() {
if is_service_enabled n-cpu; then
- if is_ubuntu; then
- install_package libvirt-bin
- elif is_fedora || is_suse; then
- install_package libvirt
- else
- exit_distro_not_supported "libvirt installation"
- fi
-
- # Install and configure **LXC** if specified. LXC is another approach to
- # splitting a system into many smaller parts. LXC uses cgroups and chroot
- # to simulate multiple systems.
- if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
+ if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
if is_ubuntu; then
- if [[ "$DISTRO" > natty ]]; then
- install_package cgroup-lite
- fi
+ 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
- ### FIXME(dtroyer): figure this out
- echo "RPM-based cgroup not implemented yet"
- yum_install libcgroup-tools
+ exit_distro_not_supported "libvirt installation"
+ fi
+
+ # Install and configure **LXC** if specified. LXC is another approach to
+ # splitting a system into many smaller parts. LXC uses cgroups and chroot
+ # to simulate multiple systems.
+ if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
+ if is_ubuntu; then
+ if [[ "$DISTRO" > natty ]]; then
+ install_package cgroup-lite
+ fi
+ else
+ ### FIXME(dtroyer): figure this out
+ echo "RPM-based cgroup not implemented yet"
+ yum_install libcgroup-tools
+ fi
fi
fi
fi
@@ -698,9 +708,13 @@
screen_it n-cell "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cells --config-file $NOVA_CELLS_CONF"
fi
- # 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'"
+ 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"
diff --git a/lib/tempest b/lib/tempest
index a259ee9..8018166 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -23,6 +23,7 @@
# ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
# ``DEFAULT_INSTANCE_TYPE``
# ``DEFAULT_INSTANCE_USER``
+# ``CINDER_MULTI_LVM_BACKEND``
# ``stack.sh`` calls the entry points in this order:
#
# install_tempest
@@ -44,7 +45,7 @@
NOVA_SOURCE_DIR=$DEST/nova
-BUILD_INTERVAL=3
+BUILD_INTERVAL=1
BUILD_TIMEOUT=400
@@ -234,11 +235,10 @@
iniset $TEMPEST_CONF whitebox path_to_private_key $TEMPEST_DIR/id_rsa
iniset $TEMPEST_CONF whitebox db_uri $BASE_SQL_CONN/nova
-
- # compute admin
+ # Compute admin
iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED
- # network
+ # Network
if is_service_enabled quantum; then
iniset $TEMPEST_CONF network quantum_available "True"
fi
@@ -247,7 +247,7 @@
iniset $TEMPEST_CONF network public_network_id "$public_network_id"
iniset $TEMPEST_CONF network public_router_id "$public_router_id"
- #boto
+ # boto
iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
iniset $TEMPEST_CONF boto s3_materials_path "$BOTO_MATERIALS_PATH"
@@ -255,11 +255,19 @@
iniset $TEMPEST_CONF boto http_socket_timeout 30
iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
- # orchestration
+ # Orchestration
if is_service_enabled heat; then
iniset $TEMPEST_CONF orchestration heat_available "True"
fi
+ # Volume
+ CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
+ if [ $CINDER_MULTI_LVM_BACKEND == "True "]; then
+ iniset $TEMPEST_CONF volume multi_backend_enabled "True"
+ iniset $TEMPEST_CONF volume backend1_name "LVM_iSCSI"
+ iniset $TEMPEST_CONF volume backend2_name "LVM_iSCSI_2"
+ fi
+
echo "Created tempest configuration file:"
cat $TEMPEST_CONF
diff --git a/rejoin-stack.sh b/rejoin-stack.sh
index c452694..65ba721 100755
--- a/rejoin-stack.sh
+++ b/rejoin-stack.sh
@@ -5,6 +5,10 @@
TOP_DIR=`dirname $0`
+# Import common functions in case the localrc (loaded via stackrc)
+# uses them.
+source $TOP_DIR/functions
+
source $TOP_DIR/stackrc
# if screenrc exists, run screen