Merge "Configure Horizon to use SSL-enabled Keystone"
diff --git a/HACKING.rst b/HACKING.rst
index 5c15537..83455e3 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -20,7 +20,7 @@
contains the usual links for blueprints, bugs, tec.
__ contribute_
-.. _contribute: http://wiki.openstack.org/HowToContribute.
+.. _contribute: http://wiki.openstack.org/HowToContribute
__ lp_
.. _lp: https://launchpad.net/~devstack
@@ -231,7 +231,7 @@
Bash Style Guidelines
~~~~~~~~~~~~~~~~~~~~~
-Devstack defines a bash set of best practices for maintaining large
+DevStack defines a bash set of best practices for maintaining large
collections of bash scripts. These should be considered as part of the
review process.
diff --git a/clean.sh b/clean.sh
index f3b2a99..8bafcad 100755
--- a/clean.sh
+++ b/clean.sh
@@ -40,6 +40,7 @@
source $TOP_DIR/lib/tls
+source $TOP_DIR/lib/oslo
source $TOP_DIR/lib/horizon
source $TOP_DIR/lib/keystone
source $TOP_DIR/lib/glance
@@ -83,6 +84,7 @@
fi
# Clean projects
+cleanup_oslo
cleanup_cinder
cleanup_glance
cleanup_keystone
@@ -100,7 +102,7 @@
fi
# Clean out /etc
-sudo rm -rf /etc/keystone /etc/glance /etc/nova /etc/cinder /etc/swift
+sudo rm -rf /etc/keystone /etc/glance /etc/nova /etc/cinder /etc/swift /etc/heat
# Clean out tgt
sudo rm -f /etc/tgt/conf.d/*
diff --git a/driver_certs/cinder_driver_cert.sh b/driver_certs/cinder_driver_cert.sh
index d2c636f..7726e7e 100755
--- a/driver_certs/cinder_driver_cert.sh
+++ b/driver_certs/cinder_driver_cert.sh
@@ -19,6 +19,8 @@
#
# SCREEN_LOGDIR=/opt/stack/screen-logs
+set -o pipefail
+
CERT_DIR=$(cd $(dirname "$0") && pwd)
TOP_DIR=$(cd $CERT_DIR/..; pwd)
diff --git a/exercises/client-env.sh b/exercises/client-env.sh
index d955e4d..4e8259c 100755
--- a/exercises/client-env.sh
+++ b/exercises/client-env.sh
@@ -64,7 +64,7 @@
STATUS_KEYSTONE="Skipped"
else
echo -e "\nTest Keystone"
- if keystone catalog --service identity; then
+ if openstack endpoint show identity; then
STATUS_KEYSTONE="Succeeded"
else
STATUS_KEYSTONE="Failed"
diff --git a/exercises/neutron-adv-test.sh b/exercises/neutron-adv-test.sh
index 0a24fe9..6679670 100755
--- a/exercises/neutron-adv-test.sh
+++ b/exercises/neutron-adv-test.sh
@@ -100,15 +100,6 @@
DEMO1_ROUTER1_NET="demo1-net1"
DEMO2_ROUTER1_NET="demo2-net1"
-KEYSTONE="keystone"
-
-# Manually create a token by querying keystone (sending JSON data). Keystone
-# returns a token and catalog of endpoints. We use python to parse the token
-# and save it.
-
-TOKEN=`keystone token-get | grep ' id ' | awk '{print $4}'`
-die_if_not_set $LINENO TOKEN "Keystone fail to get token"
-
# Various functions
# -----------------
@@ -150,21 +141,21 @@
function get_tenant_id {
local TENANT_NAME=$1
- local TENANT_ID=`keystone tenant-list | grep " $TENANT_NAME " | head -n 1 | get_field 1`
+ local TENANT_ID=`openstack project list | grep " $TENANT_NAME " | head -n 1 | get_field 1`
die_if_not_set $LINENO TENANT_ID "Failure retrieving TENANT_ID for $TENANT_NAME"
echo "$TENANT_ID"
}
function get_user_id {
local USER_NAME=$1
- local USER_ID=`keystone user-list | grep $USER_NAME | awk '{print $2}'`
+ local USER_ID=`openstack user list | grep $USER_NAME | awk '{print $2}'`
die_if_not_set $LINENO USER_ID "Failure retrieving USER_ID for $USER_NAME"
echo "$USER_ID"
}
function get_role_id {
local ROLE_NAME=$1
- local ROLE_ID=`keystone role-list | grep $ROLE_NAME | awk '{print $2}'`
+ local ROLE_ID=`openstack role list | grep $ROLE_NAME | awk '{print $2}'`
die_if_not_set $LINENO ROLE_ID "Failure retrieving ROLE_ID for $ROLE_NAME"
echo "$ROLE_ID"
}
@@ -199,28 +190,21 @@
}
function add_tenant {
- local TENANT=$1
- local USER=$2
-
- $KEYSTONE tenant-create --name=$TENANT
- $KEYSTONE user-create --name=$USER --pass=${ADMIN_PASSWORD}
-
- local USER_ID=$(get_user_id $USER)
- local TENANT_ID=$(get_tenant_id $TENANT)
-
- $KEYSTONE user-role-add --user-id $USER_ID --role-id $(get_role_id Member) --tenant-id $TENANT_ID
+ openstack project create $1
+ openstack user create $2 --password ${ADMIN_PASSWORD} --project $1
+ openstack role add Member --project $1 --user $2
}
function remove_tenant {
local TENANT=$1
local TENANT_ID=$(get_tenant_id $TENANT)
- $KEYSTONE tenant-delete $TENANT_ID
+ openstack project delete $TENANT_ID
}
function remove_user {
local USER=$1
local USER_ID=$(get_user_id $USER)
- $KEYSTONE user-delete $USER_ID
+ openstack user delete $USER_ID
}
function create_tenants {
diff --git a/extras.d/80-opendaylight.sh b/extras.d/80-opendaylight.sh
index 57b4328..bf99866 100644
--- a/extras.d/80-opendaylight.sh
+++ b/extras.d/80-opendaylight.sh
@@ -14,6 +14,7 @@
configure_opendaylight
init_opendaylight
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+ configure_ml2_odl
# This has to start before Neutron
start_opendaylight
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
@@ -46,7 +47,11 @@
ODL_MGR_PORT=${ODL_MGR_PORT:-6640}
read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid)
sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT
- sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"}
+ if [[ -n "$OVS_BRIDGE_MAPPINGS" ]] && [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then
+ sudo ovs-vsctl set Open_vSwitch $ovstbl \
+ other_config:bridge_mappings=$OVS_BRIDGE_MAPPINGS
+ fi
+ sudo ovs-vsctl set Open_vSwitch $ovstbl other_config:local_ip=$ODL_LOCAL_IP
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
# no-op
:
diff --git a/files/apts/cinder b/files/apts/cinder
index 712fee9..7819c31 100644
--- a/files/apts/cinder
+++ b/files/apts/cinder
@@ -2,6 +2,5 @@
lvm2
qemu-utils
libpq-dev
-python-dev
open-iscsi
open-iscsi-utils # Deprecated since quantal dist:precise
diff --git a/files/apts/general b/files/apts/general
index 995c0c6..020d84f 100644
--- a/files/apts/general
+++ b/files/apts/general
@@ -18,5 +18,6 @@
euca2ools # only for testing client
tar
python-cmd2 # dist:precise
+python-dev
python2.7
bc
diff --git a/files/apts/glance b/files/apts/glance
index 6dc878e..e80f447 100644
--- a/files/apts/glance
+++ b/files/apts/glance
@@ -5,7 +5,6 @@
libssl-dev # testonly
libxml2-dev
libxslt1-dev # testonly
-python-dev
python-eventlet
python-routes
python-greenlet
diff --git a/files/apts/keystone b/files/apts/keystone
index 564921b..57fde80 100644
--- a/files/apts/keystone
+++ b/files/apts/keystone
@@ -1,4 +1,3 @@
-python-dev
python-lxml
python-pastescript
python-pastedeploy
diff --git a/files/apts/n-api b/files/apts/n-api
index e0e5e7f..b4372d9 100644
--- a/files/apts/n-api
+++ b/files/apts/n-api
@@ -1,2 +1,3 @@
python-dateutil
msgpack-python
+fping
diff --git a/files/apts/nova b/files/apts/nova
index 69d0a35..38c99c7 100644
--- a/files/apts/nova
+++ b/files/apts/nova
@@ -15,6 +15,7 @@
qemu-kvm # NOPRIME
qemu # dist:wheezy,jessie NOPRIME
libvirt-bin # NOPRIME
+pm-utils
libjs-jquery-tablesorter # Needed for coverage html reports
vlan
curl
diff --git a/files/apts/swift b/files/apts/swift
index 37d5bc0..0c27b5b 100644
--- a/files/apts/swift
+++ b/files/apts/swift
@@ -4,7 +4,6 @@
memcached
python-configobj
python-coverage
-python-dev
python-eventlet
python-greenlet
python-netifaces
diff --git a/files/rpms-suse/n-api b/files/rpms-suse/n-api
index 0f08daa..6f59e60 100644
--- a/files/rpms-suse/n-api
+++ b/files/rpms-suse/n-api
@@ -1 +1,2 @@
python-dateutil
+fping
diff --git a/files/rpms-suse/neutron b/files/rpms-suse/neutron
index 462513d..d4841b1 100644
--- a/files/rpms-suse/neutron
+++ b/files/rpms-suse/neutron
@@ -1,5 +1,5 @@
dnsmasq
-dnsmasq-utils # dist:opensuse-12.3
+dnsmasq-utils # dist:opensuse-12.3,opensuse-13.1
ebtables
iptables
iputils
diff --git a/files/rpms-suse/nova b/files/rpms-suse/nova
index c5a58b9..3e95724 100644
--- a/files/rpms-suse/nova
+++ b/files/rpms-suse/nova
@@ -1,6 +1,6 @@
curl
dnsmasq
-dnsmasq-utils # dist:opensuse-12.3
+dnsmasq-utils # dist:opensuse-12.3,opensuse-13.1
ebtables
gawk
genisoimage # required for config_drive
diff --git a/files/rpms-suse/opendaylight b/files/rpms-suse/opendaylight
index d6c7146..f7fafff 100644
--- a/files/rpms-suse/opendaylight
+++ b/files/rpms-suse/opendaylight
@@ -1,4 +1,3 @@
openvswitch # NOPRIME
-openvswitch-controller # NOPRIME
openvswitch-switch # NOPRIME
diff --git a/files/rpms/cinder b/files/rpms/cinder
index 423d57c..ce6181e 100644
--- a/files/rpms/cinder
+++ b/files/rpms/cinder
@@ -1,7 +1,6 @@
lvm2
scsi-target-utils
qemu-img
-python-devel
postgresql-devel
iscsi-initiator-utils
python-lxml #dist:f19,f20,rhel7
diff --git a/files/rpms/general b/files/rpms/general
index 6cfe31e..99be725 100644
--- a/files/rpms/general
+++ b/files/rpms/general
@@ -15,6 +15,7 @@
python-prettytable # dist:rhel6 [1]
python-unittest2
python-virtualenv
+python-devel
screen
tar
tcpdump
diff --git a/files/rpms/glance b/files/rpms/glance
index 2007e2e..f959c22 100644
--- a/files/rpms/glance
+++ b/files/rpms/glance
@@ -6,7 +6,6 @@
openssl-devel # testonly
postgresql-devel # testonly
python-argparse
-python-devel
python-eventlet
python-greenlet
python-lxml #dist:f19,f20,rhel7
diff --git a/files/rpms/horizon b/files/rpms/horizon
index 2dd24e0..38d349d 100644
--- a/files/rpms/horizon
+++ b/files/rpms/horizon
@@ -1,5 +1,4 @@
Django
-django-registration
gcc
httpd # NOPRIME
mod_wsgi # NOPRIME
diff --git a/files/rpms/n-api b/files/rpms/n-api
index 0f08daa..6f59e60 100644
--- a/files/rpms/n-api
+++ b/files/rpms/n-api
@@ -1 +1,2 @@
python-dateutil
+fping
diff --git a/files/rpms/swift b/files/rpms/swift
index bf29ea2..ec53424 100644
--- a/files/rpms/swift
+++ b/files/rpms/swift
@@ -4,7 +4,6 @@
memcached
python-configobj
python-coverage
-python-devel
python-eventlet
python-greenlet
python-netifaces
diff --git a/functions-common b/functions-common
index 6340c5c..cc90c07 100644
--- a/functions-common
+++ b/functions-common
@@ -1231,9 +1231,9 @@
$xtrace
$SUDO_PIP PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
- HTTP_PROXY=$http_proxy \
- HTTPS_PROXY=$https_proxy \
- NO_PROXY=$no_proxy \
+ http_proxy=$http_proxy \
+ https_proxy=$https_proxy \
+ no_proxy=$no_proxy \
$CMD_PIP install --build=${pip_build_tmp} \
$PIP_MIRROR_OPT $@ \
&& $SUDO_PIP rm -rf ${pip_build_tmp}
diff --git a/lib/ceilometer b/lib/ceilometer
index 5030b3c..59f572c 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -155,10 +155,11 @@
fi
# the compute and central agents need these credentials in order to
- # call out to the public nova and glance APIs
- iniset $CEILOMETER_CONF DEFAULT os_username ceilometer
- iniset $CEILOMETER_CONF DEFAULT os_password $SERVICE_PASSWORD
- iniset $CEILOMETER_CONF DEFAULT os_tenant_name $SERVICE_TENANT_NAME
+ # call out to other services' public APIs
+ # the alarm evaluator needs these options to call ceilometer APIs
+ iniset $CEILOMETER_CONF service_credentials os_username ceilometer
+ iniset $CEILOMETER_CONF service_credentials os_password $SERVICE_PASSWORD
+ iniset $CEILOMETER_CONF service_credentials os_tenant_name $SERVICE_TENANT_NAME
iniset $CEILOMETER_CONF keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
iniset $CEILOMETER_CONF keystone_authtoken auth_port $KEYSTONE_AUTH_PORT
@@ -236,7 +237,7 @@
# start_ceilometer() - Start running processes, including screen
function start_ceilometer {
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
- screen_it ceilometer-acompute "cd ; sg $LIBVIRT_GROUP \"ceilometer-agent-compute --config-file $CEILOMETER_CONF\""
+ screen_it ceilometer-acompute "cd ; sg $LIBVIRT_GROUP 'ceilometer-agent-compute --config-file $CEILOMETER_CONF'"
fi
if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then
screen_it ceilometer-acompute "cd ; ceilometer-agent-compute --config-file $CEILOMETER_CONF"
diff --git a/lib/cinder b/lib/cinder
index dd2956a..dadbe40 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -274,6 +274,10 @@
iniset $CINDER_CONF DEFAULT lock_path $CINDER_STATE_PATH
iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL
+ if is_service_enabled swift; then
+ iniset $CINDER_CONF DEFAULT backup_swift_url "http://$SERVICE_HOST:8080/v1/AUTH_"
+ fi
+
if is_service_enabled ceilometer; then
iniset $CINDER_CONF DEFAULT notification_driver "cinder.openstack.common.notifier.rpc_notifier"
fi
diff --git a/lib/cinder_plugins/nfs b/lib/cinder_plugins/nfs
index 2d9d875..5f4cc53 100644
--- a/lib/cinder_plugins/nfs
+++ b/lib/cinder_plugins/nfs
@@ -30,8 +30,7 @@
function configure_cinder_driver {
iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.nfs.NfsDriver"
iniset $CINDER_CONF DEFAULT nfs_shares_config "$CINDER_CONF_DIR/nfs_shares.conf"
- echo "$CINDER_NFS_SERVERPATH" | sudo tee "$CINDER_CONF_DIR/nfs_shares.conf"
- sudo chmod 660 $CINDER_CONF_DIR/nfs_shares.conf
+ echo "$CINDER_NFS_SERVERPATH" | tee "$CINDER_CONF_DIR/nfs_shares.conf"
}
# Restore xtrace
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 7a0145a..0a96cf8 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -83,36 +83,28 @@
# Now update ``my.cnf`` for some local needs and restart the mysql service
- # Change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0)
- sudo sed -i '/^bind-address/s/127.0.0.1/0.0.0.0/g' $MY_CONF
+ # Change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and
+ # set default db type to InnoDB
+ sudo bash -c "source $TOP_DIR/functions && \
+ iniset $MY_CONF mysqld bind-address 0.0.0.0 && \
+ iniset $MY_CONF mysqld default-storage-engine InnoDB"
- # Set default db type to InnoDB
- if sudo grep -q "default-storage-engine" $MY_CONF; then
- # Change it
- sudo bash -c "source $TOP_DIR/functions; iniset $MY_CONF mysqld default-storage-engine InnoDB"
- else
- # Add it
- sudo sed -i -e "/^\[mysqld\]/ a \
-default-storage-engine = InnoDB" $MY_CONF
- fi
if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then
echo_summary "Enabling MySQL query logging"
- # Turn on slow query log
- sudo sed -i '/log.slow.queries/d' $MY_CONF
- sudo sed -i -e "/^\[mysqld\]/ a \
- log-slow-queries = /var/log/mysql/mysql-slow.log" $MY_CONF
+ sudo sed -e '/log.slow.queries/d' \
+ -e '/long.query.time/d' \
+ -e '/log.queries.not.using.indexes/d' \
+ -i $MY_CONF
- # Log all queries (any query taking longer than 0 seconds)
- sudo sed -i '/long.query.time/d' $MY_CONF
- sudo sed -i -e "/^\[mysqld\]/ a \
- long-query-time = 0" $MY_CONF
-
- # Log all non-indexed queries
- sudo sed -i '/log.queries.not.using.indexes/d' $MY_CONF
- sudo sed -i -e "/^\[mysqld\]/ a \
- log-queries-not-using-indexes" $MY_CONF
+ # Turn on slow query log, log all queries (any query taking longer than
+ # 0 seconds) and log all non-indexed queries
+ sudo bash -c "source $TOP_DIR/functions && \
+ iniset $MY_CONF mysqld slow-query-log 1 && \
+ iniset $MY_CONF mysqld slow-query-log-file /var/log/mysql/mysql-slow.log && \
+ iniset $MY_CONF mysqld long-query-time 0 && \
+ iniset $MY_CONF mysqld log-queries-not-using-indexes 1"
fi
diff --git a/lib/heat b/lib/heat
index f66f0a8..fe75ec9 100644
--- a/lib/heat
+++ b/lib/heat
@@ -96,7 +96,7 @@
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
iniset $HEAT_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
iniset $HEAT_CONF database connection `database_connection_url heat`
- iniset $HEAT_CONF DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/random`
+ iniset $HEAT_CONF DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/urandom`
# logging
iniset $HEAT_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
@@ -119,7 +119,6 @@
# ec2authtoken
iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
- iniset $HEAT_CONF ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
# paste_deploy
[[ "$HEAT_STANDALONE" = "True" ]] && iniset $HEAT_CONF paste_deploy flavor standalone
diff --git a/lib/horizon b/lib/horizon
index 4688109..9ce4853 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -124,11 +124,9 @@
local horizon_conf=/etc/$APACHE_NAME/$APACHE_CONF_DIR/horizon.conf
if is_ubuntu; then
- # Clean up the old config name
- sudo rm -f /etc/apache2/sites-enabled/000-default
- # Be a good citizen and use the distro tools here
+ disable_apache_site 000-default
sudo touch $horizon_conf
- sudo a2ensite horizon.conf
+ enable_apache_site horizon.conf
elif is_fedora; then
sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
elif is_suse; then
diff --git a/lib/ironic b/lib/ironic
index 979420f..0528610 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -42,21 +42,23 @@
IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$TOP_DIR/tools/ironic/scripts}
IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$TOP_DIR/tools/ironic/templates}
IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False $IRONIC_BAREMETAL_BASIC_OPS)
+IRONIC_ENABLED_DRIVERS=${IRONIC_ENABLED_DRIVERS:-fake,pxe_ssh,pxe_ipmitool}
IRONIC_SSH_USERNAME=${IRONIC_SSH_USERNAME:-`whoami`}
IRONIC_SSH_KEY_DIR=${IRONIC_SSH_KEY_DIR:-$IRONIC_DATA_DIR/ssh_keys}
IRONIC_SSH_KEY_FILENAME=${IRONIC_SSH_KEY_FILENAME:-ironic_key}
IRONIC_KEY_FILE=$IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME
IRONIC_SSH_VIRT_TYPE=${IRONIC_SSH_VIRT_TYPE:-virsh}
IRONIC_TFTPBOOT_DIR=${IRONIC_TFTPBOOT_DIR:-$IRONIC_DATA_DIR/tftpboot}
-IRONIC_VM_SSH_PORT=${IRONIC_VM_SSH_PORT:-2222}
+IRONIC_VM_SSH_PORT=${IRONIC_VM_SSH_PORT:-22}
IRONIC_VM_SSH_ADDRESS=${IRONIC_VM_SSH_ADDRESS:-$HOST_IP}
IRONIC_VM_COUNT=${IRONIC_VM_COUNT:-1}
IRONIC_VM_SPECS_CPU=${IRONIC_VM_SPECS_CPU:-1}
-# NOTE(agordeev): both ubuntu and fedora deploy images won't work with 256MB of RAM.
-# System halts and throws kernel panic during initramfs unpacking.
-# Ubuntu needs at least 384MB, but fedora requires 448.
-# So placing 512 here to satisfy both.
-IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-512}
+# NOTE(adam_g): Kernels 3.12 and newer user tmpfs by default for initramfs.
+# DIB produced ramdisks tend to be ~250MB but tmpfs will only allow
+# use of 50% of available memory before ENOSPC. Set minimum 1GB
+# for nodes to avoid (LP: #1311987) and ensure consistency across
+# older and newer kernels.
+IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-1024}
IRONIC_VM_SPECS_DISK=${IRONIC_VM_SPECS_DISK:-10}
IRONIC_VM_EMULATOR=${IRONIC_VM_EMULATOR:-/usr/bin/qemu-system-x86_64}
IRONIC_VM_NETWORK_BRIDGE=${IRONIC_VM_NETWORK_BRIDGE:-brbm}
@@ -64,6 +66,10 @@
IRONIC_VM_MACS_CSV_FILE=${IRONIC_VM_MACS_CSV_FILE:-$IRONIC_DATA_DIR/ironic_macs.csv}
IRONIC_AUTHORIZED_KEYS_FILE=${IRONIC_AUTHORIZED_KEYS_FILE:-$HOME/.ssh/authorized_keys}
+# By default, baremetal VMs will console output to file.
+IRONIC_VM_LOG_CONSOLE=${IRONIC_VM_LOG_CONSOLE:-True}
+IRONIC_VM_LOG_DIR=${IRONIC_VM_LOG_DIR:-$IRONIC_DATA_DIR/logs/}
+
DIB_DIR=${DIB_DIR:-$DEST/diskimage-builder}
# Use DIB to create deploy ramdisk and kernel.
@@ -169,12 +175,25 @@
function configure_ironic_conductor {
cp $IRONIC_DIR/etc/ironic/rootwrap.conf $IRONIC_ROOTWRAP_CONF
cp -r $IRONIC_DIR/etc/ironic/rootwrap.d $IRONIC_CONF_DIR
+ IRONIC_ROOTWRAP=$(get_rootwrap_location ironic)
+ ROOTWRAP_ISUDOER_CMD="$IRONIC_ROOTWRAP $IRONIC_CONF_DIR/rootwrap.conf *"
+
+ # Set up the rootwrap sudoers for ironic
+ TEMPFILE=`mktemp`
+ echo "$STACK_USER ALL=(root) NOPASSWD: $ROOTWRAP_ISUDOER_CMD" >$TEMPFILE
+ chmod 0440 $TEMPFILE
+ sudo chown root:root $TEMPFILE
+ sudo mv $TEMPFILE /etc/sudoers.d/ironic-rootwrap
iniset $IRONIC_CONF_FILE DEFAULT rootwrap_config $IRONIC_ROOTWRAP_CONF
+ iniset $IRONIC_CONF_FILE DEFAULT enabled_drivers $IRONIC_ENABLED_DRIVERS
iniset $IRONIC_CONF_FILE conductor api_url http://$HOST_IP:6385
iniset $IRONIC_CONF_FILE pxe tftp_server $HOST_IP
iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR
iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images
+ if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
+ iniset $IRONIC_CONF_FILE pxe pxe_append_params "nofb nomodeset vga=normal console=ttyS0"
+ fi
}
# create_ironic_cache_dir() - Part of the init_ironic() process
@@ -304,9 +323,15 @@
function create_bridge_and_vms {
# Call libvirt setup scripts in a new shell to ensure any new group membership
sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/setup-network"
+ if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
+ LOG_ARG="$IRONIC_VM_LOG_DIR"
+ else
+ LOG_ARG=""
+ fi
sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/create-nodes \
$IRONIC_VM_SPECS_CPU $IRONIC_VM_SPECS_RAM $IRONIC_VM_SPECS_DISK \
- amd64 $IRONIC_VM_COUNT $IRONIC_VM_NETWORK_BRIDGE $IRONIC_VM_EMULATOR" >> $IRONIC_VM_MACS_CSV_FILE
+ amd64 $IRONIC_VM_COUNT $IRONIC_VM_NETWORK_BRIDGE $IRONIC_VM_EMULATOR \
+ $LOG_ARG" >> $IRONIC_VM_MACS_CSV_FILE
}
function enroll_vms {
@@ -315,8 +340,13 @@
IRONIC_NET_ID=$(neutron net-list | grep private | get_field 1)
local idx=0
- # work around; need to know what netns neutron uses for private network
- neutron port-create private
+ # work around; need to know what netns neutron uses for private network.
+ # Without knowing how to interconnect the networks, PXE won't work properly
+ # for fake baremetal instances. The network should be configured prior all
+ # the instances operation. If we don't do this, the first port creation
+ # only happens in the middle of fake baremetal instance's spawning by nova,
+ # so we'll end up with unbootable fake baremetal VM due to broken PXE.
+ PORT_ID=$(neutron port-create private | grep " id " | get_field 2)
while read MAC; do
@@ -357,6 +387,10 @@
sudo ovs-vsctl -- --if-exists del-port ovs-tap1 -- add-port br-int ovs-tap1 tag=$TAG_ID
sudo ovs-vsctl -- --if-exists del-port brbm-tap1 -- add-port $IRONIC_VM_NETWORK_BRIDGE brbm-tap1
+
+ # Remove the port needed only for workaround. For additional info read the
+ # comment at the beginning of this function
+ neutron port-delete $PORT_ID
}
function configure_tftpd {
@@ -412,31 +446,10 @@
fi
}
-function configure_ironic_sshd {
- # Ensure sshd server accepts connections from localhost only
-
- SSH_CONFIG=/etc/ssh/sshd_config
- HOST_PORT=$IRONIC_VM_SSH_ADDRESS:$IRONIC_VM_SSH_PORT
- if ! sudo grep ListenAddress $SSH_CONFIG | grep $HOST_PORT; then
- echo "ListenAddress $HOST_PORT" | sudo tee -a $SSH_CONFIG
- fi
-
- SSH_SERVICE_NAME=sshd
- if is_ubuntu; then
- SSH_SERVICE_NAME=ssh
- fi
-
- restart_service $SSH_SERVICE_NAME
- # to ensure ssh service is up and running
- sleep 3
- ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10
-
-}
-
function configure_ironic_auxiliary {
configure_ironic_dirs
configure_ironic_ssh_keypair
- configure_ironic_sshd
+ ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10
}
# build deploy kernel+ramdisk, then upload them to glance
@@ -496,19 +509,6 @@
fi
done
- SCREEN_NAME=${SCREEN_NAME:-stack}
- SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
-
- # stop all nova services
- stop_nova || true
-
- # remove any nova services failure status
- find $SERVICE_DIR/$SCREEN_NAME -name 'n-*.failure' -exec rm -f '{}' \;
-
- # start them again
- start_nova_api
- start_nova
-
TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
die_if_not_set $LINENO TOKEN "Keystone fail to get token"
@@ -520,6 +520,11 @@
create_bridge_and_vms
enroll_vms
configure_tftpd
+
+ # restart nova-compute to ensure its resource tracking is up to
+ # date with newly enrolled nodes
+ stop_nova_compute || true
+ start_nova_compute
}
function cleanup_baremetal_basic_ops {
diff --git a/lib/marconi b/lib/marconi
index fd1c351..473c8cd 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -42,7 +42,7 @@
MARCONI_BIN_DIR=$(get_python_exec_prefix)
# Set up database backend
-MARCONI_BACKEND=${MARCONI_BACKEND:-mongodb}
+MARCONI_BACKEND=${MARCONI_BACKEND:-sqlite}
# Set Marconi repository
@@ -109,8 +109,8 @@
if [ "$MARCONI_BACKEND" = 'mysql' ] || [ "$MARCONI_BACKEND" = 'postgresql' ] ; then
iniset $MARCONI_CONF drivers storage sqlalchemy
iniset $MARCONI_CONF 'drivers:storage:sqlalchemy' uri `database_connection_url marconi`
- else
- iniset $MARCONI_CONF drivers storage mongodb
+ elif [ "$MARCONI_BACKEND" = 'mongodb' ] ; then
+ iniset $MARCONI_CONF drivers storage mongodb
iniset $MARCONI_CONF 'drivers:storage:mongodb' uri mongodb://localhost:27017/marconi
configure_mongodb
cleanup_marconi
@@ -154,7 +154,7 @@
# start_marconi() - Start running processes, including screen
function start_marconi {
- screen_it marconi-server "marconi-server --config-file $MARCONI_CONF"
+ screen_it marconi-server "marconi-server --config-file $MARCONI_CONF --daemon"
echo "Waiting for Marconi to start..."
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT/v1/health; do sleep 1; done"; then
die $LINENO "Marconi did not start"
diff --git a/lib/neutron b/lib/neutron
index 294ffac..15cfa8e 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -127,6 +127,10 @@
# See _configure_neutron_common() for details about setting it up
declare -a Q_PLUGIN_EXTRA_CONF_FILES
+# List of (optional) config files for VPN device drivers to use with
+# the neutron-q-vpn agent
+declare -a Q_VPN_EXTRA_CONF_FILES
+
Q_RR_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf
if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
@@ -274,7 +278,7 @@
if is_service_enabled q-fwaas; then
_configure_neutron_fwaas
fi
- if is_service_enabled q-svc; then
+ if is_service_enabled q-agt q-svc; then
_configure_neutron_service
fi
if is_service_enabled q-agt; then
@@ -312,7 +316,7 @@
# set NOVA_VIF_DRIVER and optionally set options in nova_conf
neutron_plugin_create_nova_conf
- iniset $NOVA_CONF DEFAULT libvirt_vif_driver "$NOVA_VIF_DRIVER"
+ iniset $NOVA_CONF libvirt vif_driver "$NOVA_VIF_DRIVER"
iniset $NOVA_CONF DEFAULT linuxnet_interface_driver "$LINUXNET_VIF_DRIVER"
if is_service_enabled q-meta; then
iniset $NOVA_CONF DEFAULT service_neutron_metadata_proxy "True"
@@ -493,9 +497,10 @@
if is_service_enabled q-fwaas; then
L3_CONF_FILES="$L3_CONF_FILES --config-file $Q_FWAAS_CONF_FILE"
+ VPN_CONF_FILES="$VPN_CONF_FILES --config-file $Q_FWAAS_CONF_FILE"
fi
if is_service_enabled q-vpn; then
- screen_it q-vpn "cd $NEUTRON_DIR && $AGENT_VPN_BINARY $L3_CONF_FILES"
+ screen_it q-vpn "cd $NEUTRON_DIR && $AGENT_VPN_BINARY $VPN_CONF_FILES"
else
screen_it q-l3 "cd $NEUTRON_DIR && python $AGENT_L3_BINARY $L3_CONF_FILES"
fi
@@ -658,6 +663,7 @@
}
function _configure_neutron_l3_agent {
+ local cfg_file
Q_L3_ENABLED=True
# for l3-agent, only use per tenant router if we have namespaces
Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE
@@ -669,6 +675,15 @@
Q_FWAAS_CONF_FILE=$NEUTRON_CONF_DIR/fwaas_driver.ini
fi
+ if is_service_enabled q-vpn; then
+ Q_VPN_CONF_FILE=$NEUTRON_CONF_DIR/vpn_agent.ini
+ cp $NEUTRON_DIR/etc/vpn_agent.ini $Q_VPN_CONF_FILE
+ VPN_CONF_FILES="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE --config-file=$Q_VPN_CONF_FILE"
+ for cfg_file in ${Q_VPN_EXTRA_CONF_FILES[@]}; do
+ VPN_CONF_FILES+=" --config-file $cfg_file"
+ done
+ fi
+
cp $NEUTRON_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
iniset $Q_L3_CONF_FILE DEFAULT verbose True
@@ -765,7 +780,7 @@
iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_status_change $Q_NOTIFY_NOVA_PORT_STATUS_CHANGE
iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_data_changes $Q_NOTIFY_NOVA_ON_PORT_DATA_CHANGES
iniset $NEUTRON_CONF DEFAULT nova_url "$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2"
- iniset $NEUTRON_CONF DEFAULT nova_admin_username nova $NOVA_USER
+ iniset $NEUTRON_CONF DEFAULT nova_admin_username nova
iniset $NEUTRON_CONF DEFAULT nova_admin_password $SERVICE_PASSWORD
ADMIN_TENANT_ID=$(openstack project list | awk "/ service / { print \$2 }")
iniset $NEUTRON_CONF DEFAULT nova_admin_tenant_id $ADMIN_TENANT_ID
diff --git a/lib/neutron_plugins/brocade b/lib/neutron_plugins/brocade
index 4443fa7..e4cc754 100644
--- a/lib/neutron_plugins/brocade
+++ b/lib/neutron_plugins/brocade
@@ -24,6 +24,30 @@
Q_PLUGIN_CLASS="neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2"
}
+function neutron_plugin_configure_service {
+
+ if [[ "$BROCADE_SWITCH_OS_VERSION" != "" ]]; then
+ iniset /$Q_PLUGIN_CONF_FILE switch osversion $BROCADE_SWITCH_OS_VERSION
+ fi
+
+ if [[ "$BROCADE_SWITCH_OS_TYPE" != "" ]]; then
+ iniset /$Q_PLUGIN_CONF_FILE switch ostype $BROCADE_SWITCH_OS_TYPE
+ fi
+
+ if [[ "$BROCADE_SWITCH_PASSWORD" != "" ]]; then
+ iniset /$Q_PLUGIN_CONF_FILE switch password $BROCADE_SWITCH_PASSWORD
+ fi
+
+ if [[ "$BROCADE_SWITCH_USERNAME" != "" ]]; then
+ iniset /$Q_PLUGIN_CONF_FILE switch username $BROCADE_SWITCH_USERNAME
+ fi
+
+ if [[ "$BROCADE_SWITCH_IPADDR" != "" ]]; then
+ iniset /$Q_PLUGIN_CONF_FILE switch address $BROCADE_SWITCH_IPADDR
+ fi
+
+}
+
function neutron_plugin_configure_debug_command {
iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
}
diff --git a/lib/neutron_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent
index 33ca17a..3604a50 100644
--- a/lib/neutron_plugins/openvswitch_agent
+++ b/lib/neutron_plugins/openvswitch_agent
@@ -10,8 +10,8 @@
function neutron_plugin_create_nova_conf {
_neutron_ovs_base_configure_nova_vif_driver
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
- iniset $NOVA_CONF DEFAULT xenapi_vif_driver nova.virt.xenapi.vif.XenAPIOpenVswitchDriver
- iniset $NOVA_CONF DEFAULT xenapi_ovs_integration_bridge $XEN_INTEGRATION_BRIDGE
+ iniset $NOVA_CONF xenserver vif_driver nova.virt.xenapi.vif.XenAPIOpenVswitchDriver
+ iniset $NOVA_CONF xenserver ovs_integration_bridge $XEN_INTEGRATION_BRIDGE
# Disable nova's firewall so that it does not conflict with neutron
iniset $NOVA_CONF DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
fi
diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base
index ae7f815..1e293a1 100644
--- a/lib/neutron_plugins/ovs_base
+++ b/lib/neutron_plugins/ovs_base
@@ -44,9 +44,8 @@
# Ensure that the service is started
restart_service openvswitch
elif is_suse; then
- install_package openvswitch
+ install_package openvswitch-switch
restart_service openvswitch-switch
- restart_service openvswitch-controller
fi
}
diff --git a/lib/nova b/lib/nova
index 5cc94ec..c51d584 100644
--- a/lib/nova
+++ b/lib/nova
@@ -303,6 +303,10 @@
sudo chown -R $STACK_USER $NOVA_INSTANCES_PATH
fi
fi
+ if is_suse; then
+ # iscsid is not started by default
+ start_service iscsid
+ fi
fi
# Rebuild the config file from scratch
@@ -428,7 +432,6 @@
iniset $NOVA_CONF DEFAULT default_floating_pool "$PUBLIC_NETWORK_NAME"
iniset $NOVA_CONF DEFAULT s3_host "$SERVICE_HOST"
iniset $NOVA_CONF DEFAULT s3_port "$S3_SERVICE_PORT"
- iniset $NOVA_CONF DEFAULT osapi_compute_extension "nova.api.openstack.compute.contrib.standard_extensions"
iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP"
iniset $NOVA_CONF DEFAULT osapi_compute_workers "4"
iniset $NOVA_CONF DEFAULT ec2_workers "4"
@@ -438,8 +441,8 @@
iniset $NOVA_CONF DEFAULT instance_name_template "${INSTANCE_NAME_PREFIX}%08x"
iniset $NOVA_CONF osapi_v3 enabled "True"
- if is_fedora; then
- # nova defaults to /usr/local/bin, but fedora pip likes to
+ if is_fedora || is_suse; then
+ # nova defaults to /usr/local/bin, but fedora and suse pip like to
# install things in /usr/bin
iniset $NOVA_CONF DEFAULT bindir "/usr/bin"
fi
@@ -468,9 +471,6 @@
iniset $NOVA_CONF keystone_authtoken signing_dir $NOVA_AUTH_CACHE_DIR
- if is_service_enabled cinder; then
- iniset $NOVA_CONF DEFAULT volume_api_class "nova.volume.cinder.API"
- fi
if [ -n "$NOVA_STATE_PATH" ]; then
iniset $NOVA_CONF DEFAULT state_path "$NOVA_STATE_PATH"
iniset $NOVA_CONF DEFAULT lock_path "$NOVA_STATE_PATH"
diff --git a/lib/nova_plugins/hypervisor-baremetal b/lib/nova_plugins/hypervisor-baremetal
index 2da1097..1d4d414 100644
--- a/lib/nova_plugins/hypervisor-baremetal
+++ b/lib/nova_plugins/hypervisor-baremetal
@@ -49,7 +49,7 @@
iniset $NOVA_CONF DEFAULT scheduler_host_manager nova.scheduler.baremetal_host_manager.BaremetalHostManager
iniset $NOVA_CONF DEFAULT ram_allocation_ratio 1.0
iniset $NOVA_CONF DEFAULT reserved_host_memory_mb 0
- iniset $NOVA_CONF baremetal instance_type_extra_specs cpu_arch:$BM_CPU_ARCH
+ iniset $NOVA_CONF baremetal flavor_extra_specs cpu_arch:$BM_CPU_ARCH
iniset $NOVA_CONF baremetal driver $BM_DRIVER
iniset $NOVA_CONF baremetal power_manager $BM_POWER_MANAGER
iniset $NOVA_CONF baremetal tftp_root /tftpboot
diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt
index 053df3c..259bf15 100644
--- a/lib/nova_plugins/hypervisor-libvirt
+++ b/lib/nova_plugins/hypervisor-libvirt
@@ -39,9 +39,9 @@
# configure_nova_hypervisor - Set config files, create data dirs, etc
function configure_nova_hypervisor {
configure_libvirt
- iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
- iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
- iniset $NOVA_CONF DEFAULT use_usb_tablet "False"
+ iniset $NOVA_CONF libvirt virt_type "$LIBVIRT_TYPE"
+ iniset $NOVA_CONF libvirt cpu_mode "none"
+ iniset $NOVA_CONF libvirt use_usb_tablet "False"
iniset $NOVA_CONF DEFAULT default_ephemeral_format "ext4"
iniset $NOVA_CONF DEFAULT compute_driver "libvirt.LibvirtDriver"
LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.libvirt.firewall.IptablesFirewallDriver"}
diff --git a/lib/nova_plugins/hypervisor-xenserver b/lib/nova_plugins/hypervisor-xenserver
index 10bda2c..c37969b 100644
--- a/lib/nova_plugins/hypervisor-xenserver
+++ b/lib/nova_plugins/hypervisor-xenserver
@@ -63,9 +63,13 @@
local ssh_dom0
ssh_dom0="sudo -u $DOMZERO_USER ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$dom0_ip"
+ # Find where the plugins should go in dom0
+ xen_functions=`cat $TOP_DIR/tools/xen/functions`
+ PLUGIN_DIR=`$ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location"`
+
# install nova plugins to dom0
tar -czf - -C $NOVA_DIR/plugins/xenserver/xenapi/etc/xapi.d/plugins/ ./ |
- $ssh_dom0 'tar -xzf - -C /etc/xapi.d/plugins/ && chmod a+x /etc/xapi.d/plugins/*'
+ $ssh_dom0 "tar -xzf - -C $PLUGIN_DIR && chmod a+x $PLUGIN_DIR/*"
# install console logrotate script
tar -czf - -C $NOVA_DIR/tools/xenserver/ rotate_xen_guest_logs.sh |
diff --git a/lib/opendaylight b/lib/opendaylight
index 1022e2c..be3db6e 100644
--- a/lib/opendaylight
+++ b/lib/opendaylight
@@ -35,6 +35,15 @@
# ODL_MGR_IP=
ODL_MGR_IP=${ODL_MGR_IP:-$SERVICE_HOST}
+# The ODL endpoint URL
+ODL_ENDPOINT=${ODL_ENDPOINT:-http://${ODL_MGR_IP}:8080/controller/nb/v2/neutron}
+
+# The ODL username
+ODL_USERNAME=${ODL_USERNAME:-admin}
+
+# The ODL password
+ODL_PASSWORD=${ODL_PASSWORD:-admin}
+
# <define global variables here that belong to this project>
ODL_DIR=$DEST/opendaylight
@@ -80,6 +89,12 @@
echo "ovsdb.of.version=1.3" >> $ODL_DIR/opendaylight/configuration/config.ini
}
+function configure_ml2_odl {
+ populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_odl url=$ODL_ENDPOINT
+ populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_odl username=$ODL_USERNAME
+ populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_odl password=$ODL_PASSWORD
+}
+
# init_opendaylight() - Initialize databases, etc.
function init_opendaylight {
# clean up from previous (possibly aborted) runs
@@ -117,9 +132,8 @@
# Ensure that the service is started
restart_service openvswitch
elif is_suse; then
- install_package openvswitch
+ install_package openvswitch-switch
restart_service openvswitch-switch
- restart_service openvswitch-controller
fi
}
diff --git a/lib/oslo b/lib/oslo
index 2e1f6bf..3cf7218 100644
--- a/lib/oslo
+++ b/lib/oslo
@@ -34,6 +34,10 @@
# install_oslo() - Collect source and prepare
function install_oslo {
+ # TODO(sdague): remove this once we get to Icehouse, this just makes
+ # for a smoother transition of existing users.
+ cleanup_oslo
+
git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
setup_install $CLIFF_DIR
@@ -59,6 +63,17 @@
setup_install $TASKFLOW_DIR
}
+# cleanup_oslo() - purge possibly old versions of oslo
+function cleanup_oslo {
+ # this means we've got an old oslo installed, lets get rid of it
+ if ! python -c 'import oslo.config' 2>/dev/null; then
+ echo "Found old oslo.config... removing to ensure consistency"
+ local PIP_CMD=$(get_pip_command)
+ pip_install oslo.config
+ sudo $PIP_CMD uninstall -y oslo.config
+ fi
+}
+
# Restore xtrace
$XTRACE
diff --git a/lib/sahara b/lib/sahara
index 1ff0cf9..55131f9 100644
--- a/lib/sahara
+++ b/lib/sahara
@@ -35,6 +35,8 @@
SAHARA_AUTH_CACHE_DIR=${SAHARA_AUTH_CACHE_DIR:-/var/cache/sahara}
+SAHARA_ENABLED_PLUGINS=${SAHARA_ENABLED_PLUGINS:-vanilla,hdp,fake}
+
# Support entry points installation of console scripts
if [[ -d $SAHARA_DIR/bin ]]; then
SAHARA_BIN_DIR=$SAHARA_DIR/bin
@@ -109,15 +111,18 @@
rm -rf $SAHARA_AUTH_CACHE_DIR/*
# Set obsolete keystone auth configs for backward compatibility
- iniset $SAHARA_CONF_FILE DEFAULT os_auth_host $KEYSTONE_SERVICE_HOST
- iniset $SAHARA_CONF_FILE DEFAULT os_auth_port $KEYSTONE_SERVICE_PORT
- iniset $SAHARA_CONF_FILE DEFAULT os_auth_protocol $KEYSTONE_SERVICE_PROTOCOL
+ iniset $SAHARA_CONF_FILE DEFAULT os_auth_host $KEYSTONE_AUTH_HOST
+ iniset $SAHARA_CONF_FILE DEFAULT os_auth_port $KEYSTONE_AUTH_PORT
+ iniset $SAHARA_CONF_FILE DEFAULT os_auth_protocol $KEYSTONE_AUTH_PROTOCOL
iniset $SAHARA_CONF_FILE DEFAULT os_admin_password $SERVICE_PASSWORD
iniset $SAHARA_CONF_FILE DEFAULT os_admin_username sahara
iniset $SAHARA_CONF_FILE DEFAULT os_admin_tenant_name $SERVICE_TENANT_NAME
# Set actual keystone auth configs
iniset $SAHARA_CONF_FILE keystone_authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/
+ iniset $SAHARA_CONF_FILE keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
+ iniset $SAHARA_CONF_FILE keystone_authtoken auth_port $KEYSTONE_AUTH_PORT
+ iniset $SAHARA_CONF_FILE keystone_authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
iniset $SAHARA_CONF_FILE keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
iniset $SAHARA_CONF_FILE keystone_authtoken admin_user sahara
iniset $SAHARA_CONF_FILE keystone_authtoken admin_password $SERVICE_PASSWORD
@@ -127,6 +132,8 @@
iniset $SAHARA_CONF_FILE DEFAULT verbose True
iniset $SAHARA_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
+ iniset $SAHARA_CONF_FILE DEFAULT plugins $SAHARA_ENABLED_PLUGINS
+
iniset $SAHARA_CONF_FILE database connection `database_connection_url sahara`
if is_service_enabled neutron; then
@@ -142,6 +149,11 @@
iniset $SAHARA_CONF_FILE DEFAULT use_syslog $SYSLOG
+ # Format logging
+ if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
+ setup_colorized_logging $SAHARA_CONF_FILE DEFAULT
+ fi
+
recreate_database sahara utf8
$SAHARA_BIN_DIR/sahara-db-manage --config-file $SAHARA_CONF_FILE upgrade head
}
diff --git a/lib/swift b/lib/swift
index 3e183ff..6db779a 100644
--- a/lib/swift
+++ b/lib/swift
@@ -453,10 +453,13 @@
rm -rf ${swift_log_dir}
mkdir -p ${swift_log_dir}/hourly
sudo chown -R ${STACK_USER}:adm ${swift_log_dir}
- sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
- tee /etc/rsyslog.d/10-swift.conf
- # restart syslog to take the changes
- sudo killall -HUP rsyslogd
+
+ if [[ $SYSLOG != "False" ]]; then
+ sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
+ tee /etc/rsyslog.d/10-swift.conf
+ # restart syslog to take the changes
+ sudo killall -HUP rsyslogd
+ fi
if is_apache_enabled_service swift; then
_config_swift_apache_wsgi
diff --git a/lib/tempest b/lib/tempest
index a4558ce..2125f88 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -28,7 +28,6 @@
# - ``DEFAULT_INSTANCE_TYPE``
# - ``DEFAULT_INSTANCE_USER``
# - ``CINDER_MULTI_LVM_BACKEND``
-# - ``HEAT_CREATE_TEST_IMAGE``
#
# ``stack.sh`` calls the entry points in this order:
#
@@ -77,7 +76,6 @@
local num_images
local image_uuid
local image_uuid_alt
- local errexit
local password
local line
local flavors
@@ -93,11 +91,6 @@
# TODO(afazekas):
# sudo python setup.py deploy
- # This function exits on an error so that errors don't compound and you see
- # only the first error that occurred.
- errexit=$(set +o | grep errexit)
- set -o errexit
-
# Save IFS
ifs=$IFS
@@ -153,6 +146,7 @@
# user and tenant are set up...
ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-admin}
+ ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-Default}
TEMPEST_USERNAME=${TEMPEST_USERNAME:-demo}
TEMPEST_TENANT_NAME=${TEMPEST_TENANT_NAME:-demo}
ALT_USERNAME=${ALT_USERNAME:-alt_demo}
@@ -267,6 +261,7 @@
iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME
iniset $TEMPEST_CONFIG identity admin_password "$password"
iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME
+ iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
# Image
@@ -320,12 +315,18 @@
iniset $TEMPEST_CONFIG boto http_socket_timeout 30
iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
- # Orchestration test image
- if [[ ! -z "$HEAT_FETCHED_TEST_IMAGE" ]]; then
- iniset $TEMPEST_CONFIG orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
- elif [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then
- disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest"
- iniset $TEMPEST_CONFIG orchestration image_ref "fedora-vm-heat-cfntools-tempest"
+ # Orchestration Tests
+ if is_service_enabled heat; then
+ if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
+ iniset $TEMPEST_CONFIG orchestration image_ref $(basename "$HEAT_CFN_IMAGE_URL" ".qcow2")
+ fi
+ # build a specialized heat flavor that is likely to be fast
+ available_flavors=$(nova flavor-list)
+ if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then
+ nova flavor-create m1.heat 451 1024 0 2
+ fi
+ iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat"
+ iniset $TEMPEST_CONFIG orchestration build_timeout 900
fi
# Scenario
@@ -360,6 +361,11 @@
# Networking
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
+ # Baremetal
+ if [ "$VIRT_DRIVER" = "ironic" ] ; then
+ iniset $TEMPEST_CONFIG baremetal driver_enabled True
+ fi
+
# service_available
for service in ${TEMPEST_SERVICES//,/ }; do
if is_service_enabled $service ; then
@@ -371,8 +377,6 @@
# Restore IFS
IFS=$ifs
- #Restore errexit
- $errexit
}
# create_tempest_accounts() - Set up common required tempest accounts
@@ -419,9 +423,9 @@
( #new namespace
# tenant:demo ; user: demo
source $TOP_DIR/accrc/demo/demo
- euca-bundle-image -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH"
- euca-bundle-image -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH"
- euca-bundle-image -i "$disk_image" -d "$BOTO_MATERIALS_PATH"
+ euca-bundle-image -r x86_64 -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH"
+ euca-bundle-image -r x86_64 -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH"
+ euca-bundle-image -r x86_64 -i "$disk_image" -d "$BOTO_MATERIALS_PATH"
) 2>&1 </dev/null | cat
else
echo "Boto materials are not prepared"
diff --git a/stack.sh b/stack.sh
index 91f188f..7da1fb9 100755
--- a/stack.sh
+++ b/stack.sh
@@ -149,6 +149,14 @@
fi
fi
+# Look for obsolete stuff
+if [[ ,${ENABLED_SERVICES}, =~ ,"swift", ]]; then
+ echo "FATAL: 'swift' is not supported as a service name"
+ echo "FATAL: Use the actual swift service names to enable tham as required:"
+ echo "FATAL: s-proxy s-object s-container s-account"
+ exit 1
+fi
+
# Make sure we only have one rpc backend enabled,
# and the specified rpc backend is available on your platform.
check_rpc_backend
@@ -215,21 +223,24 @@
apt_get install --force-yes gplhost-archive-keyring
fi
-if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
- # Installing Open vSwitch on RHEL6 requires enabling the RDO repo.
- RHEL6_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"http://rdo.fedorapeople.org/openstack-havana/rdo-release-havana.rpm"}
- RHEL6_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-havana"}
+if [[ is_fedora && $DISTRO =~ (rhel) ]]; then
+ # Installing Open vSwitch on RHEL requires enabling the RDO repo.
+ RHEL6_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm"}
+ RHEL6_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-icehouse"}
if ! sudo yum repolist enabled $RHEL6_RDO_REPO_ID | grep -q $RHEL6_RDO_REPO_ID; then
echo "RDO repo not detected; installing"
yum_install $RHEL6_RDO_REPO_RPM || \
die $LINENO "Error installing RDO repo, cannot continue"
fi
-
- # RHEL6 requires EPEL for many Open Stack dependencies
- RHEL6_EPEL_RPM=${RHEL6_EPEL_RPM:-"http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"}
+ # RHEL requires EPEL for many Open Stack dependencies
+ if [[ $DISTRO =~ (rhel7) ]]; then
+ EPEL_RPM=${RHEL7_EPEL_RPM:-"http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.1.noarch.rpm"}
+ else
+ EPEL_RPM=${RHEL6_EPEL_RPM:-"http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"}
+ fi
if ! sudo yum repolist enabled epel | grep -q 'epel'; then
echo "EPEL not detected; installing"
- yum_install ${RHEL6_EPEL_RPM} || \
+ yum_install ${EPEL_RPM} || \
die $LINENO "Error installing EPEL repo, cannot continue"
fi
@@ -290,7 +301,7 @@
HOST_IP=$(get_default_host_ip $FIXED_RANGE $FLOATING_RANGE "$HOST_IP_IFACE" "$HOST_IP")
if [ "$HOST_IP" == "" ]; then
- die $LINENO "Could not determine host ip address. Either localrc specified dhcp on ${HOST_IP_IFACE} or defaulted"
+ die $LINENO "Could not determine host ip address. See local.conf for suggestions on setting HOST_IP."
fi
# Allow the use of an alternate hostname (such as localhost/127.0.0.1) for service endpoints.
@@ -425,7 +436,7 @@
# Rabbit connection info
if is_service_enabled rabbit; then
- RABBIT_HOST=${RABBIT_HOST:-localhost}
+ RABBIT_HOST=${RABBIT_HOST:-$SERVICE_HOST}
read_password RABBIT_PASSWORD "ENTER A PASSWORD TO USE FOR RABBIT."
fi
@@ -1001,9 +1012,13 @@
fi
clean_iptables
- rm -rf ${NOVA_STATE_PATH}/networks
- sudo mkdir -p ${NOVA_STATE_PATH}/networks
- safe_chown -R ${USER} ${NOVA_STATE_PATH}/networks
+
+ if is_service_enabled n-net; then
+ rm -rf ${NOVA_STATE_PATH}/networks
+ sudo mkdir -p ${NOVA_STATE_PATH}/networks
+ safe_chown -R ${USER} ${NOVA_STATE_PATH}/networks
+ fi
+
# Force IP forwarding on, just in case
sudo sysctl -w net.ipv4.ip_forward=1
fi
diff --git a/stackrc b/stackrc
index 4418be1..822403e 100644
--- a/stackrc
+++ b/stackrc
@@ -21,9 +21,9 @@
# Specify which services to launch. These generally correspond to
# screen tabs. To change the default list, use the ``enable_service`` and
-# ``disable_service`` functions in ``localrc``.
-# For example, to enable Swift add this to ``localrc``:
-# enable_service swift
+# ``disable_service`` functions in ``local.conf``.
+# For example, to enable Swift add this to ``local.conf``:
+# enable_service s-proxy s-object s-container s-account
# In order to enable Neutron (a single node setup) add the following
# settings in `` localrc``:
# disable_service n-net
@@ -32,7 +32,6 @@
# enable_service q-dhcp
# enable_service q-l3
# enable_service q-meta
-# enable_service neutron
# # Optional, to enable tempest configuration as part of devstack
# enable_service tempest
@@ -331,8 +330,8 @@
esac
;;
vsphere)
- DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-debian-2.6.32-i686}
- IMAGE_URLS=${IMAGE_URLS:-"http://partnerweb.vmware.com/programs/vmdkimage/cirros-0.3.0-i386-disk.vmdk"};;
+ DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.2-i386-disk.vmdk}
+ IMAGE_URLS=${IMAGE_URLS:-"http://partnerweb.vmware.com/programs/vmdkimage/cirros-0.3.2-i386-disk.vmdk"};;
xenserver)
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.0-x86_64-disk}
IMAGE_URLS=${IMAGE_URLS:-"https://github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk.vhd.tgz"};;
@@ -341,9 +340,23 @@
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"};;
esac
-HEAT_FETCHED_TEST_IMAGE=${HEAT_FETCHED_TEST_IMAGE:-""}
-if [[ "$HEAT_FETCHED_TEST_IMAGE" == "Fedora-i386-20-20131211.1-sda" ]]; then
- IMAGE_URLS+=",https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/i386/$HEAT_FETCHED_TEST_IMAGE.qcow2"
+# Use 64bit fedora image if heat is enabled
+if [[ "$ENABLED_SERVICES" =~ 'h-api' ]]; then
+ case "$VIRT_DRIVER" in
+ libvirt|baremetal|ironic)
+ HEAT_CFN_IMAGE_URL=${HEAT_CFN_IMAGE_URL:-"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2"}
+ IMAGE_URLS+=",$HEAT_CFN_IMAGE_URL"
+ ;;
+ *)
+ ;;
+ esac
+fi
+# Staging Area for New Images, have them here for at least 24hrs for nodepool
+# to cache them otherwise the failure rates in the gate are too high
+PRECACHE_IMAGES=$(trueorfalse False $PRECACHE_IMAGES)
+if [[ "$PRECACHE_IMAGES" == "True" ]]; then
+ # staging in update for nodepool
+ IMAGE_URLS+=",https://dl.fedoraproject.org/pub/fedora/linux/updates/20/Images/x86_64/Fedora-x86_64-20-20140407-sda.qcow2"
fi
# 10Gb default volume backing file size
diff --git a/tools/build_docs.sh b/tools/build_docs.sh
index c566e63..384b1fa 100755
--- a/tools/build_docs.sh
+++ b/tools/build_docs.sh
@@ -22,7 +22,7 @@
# --------
# Source repo/branch for DevStack
-MASTER_REPO=${MASTER_REPO:-https://github.com/openstack-dev/devstack.git}
+MASTER_REPO=${MASTER_REPO:-git://git.openstack.org/openstack-dev/devstack}
MASTER_BRANCH=${MASTER_BRANCH:-master}
# http://devstack.org is a GitHub gh-pages site in the https://github.com/cloudbuilders/devtack.git repo
diff --git a/tools/image_list.sh b/tools/image_list.sh
new file mode 100755
index 0000000..f9a4e2f
--- /dev/null
+++ b/tools/image_list.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Keep track of the devstack directory
+TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
+
+source $TOP_DIR/functions
+
+# Possible virt drivers, if we have more, add them here. Always keep
+# dummy in the end position to trigger the fall through case.
+DRIVERS="openvz ironic libvirt vsphere xenserver dummy"
+
+# Extra variables to trigger getting additional images.
+ENABLED_SERVICES=h-api
+HEAT_FETCHED_TEST_IMAGE="Fedora-i386-20-20131211.1-sda"
+PRECACHE_IMAGES=True
+
+# Loop over all the virt drivers and collect all the possible images
+ALL_IMAGES=""
+for driver in $DRIVERS; do
+ VIRT_DRIVER=$driver
+ URLS=$(source $TOP_DIR/stackrc && echo $IMAGE_URLS)
+ if [[ ! -z "$ALL_IMAGES" ]]; then
+ ALL_IMAGES+=,
+ fi
+ ALL_IMAGES+=$URLS
+done
+
+# Make a nice list
+echo $ALL_IMAGES | tr ',' '\n' | sort | uniq
+
+# Sanity check - ensure we have a minimum number of images
+num=$(echo $ALL_IMAGES | tr ',' '\n' | sort | uniq | wc -l)
+if [[ "$num" -lt 5 ]]; then
+ echo "ERROR: We only found $num images in $ALL_IMAGES, which can't be right."
+ exit 1
+fi
diff --git a/tools/ironic/scripts/configure-vm b/tools/ironic/scripts/configure-vm
index 9936b76..4c42c49 100755
--- a/tools/ironic/scripts/configure-vm
+++ b/tools/ironic/scripts/configure-vm
@@ -9,6 +9,25 @@
'templates')
+CONSOLE_LOG = """
+ <serial type='file'>
+ <source path='%(console_log)s'/>
+ <target port='0'/>
+ <alias name='serial0'/>
+ </serial>
+ <serial type='pty'>
+ <source path='/dev/pts/49'/>
+ <target port='1'/>
+ <alias name='serial1'/>
+ </serial>
+ <console type='file'>
+ <source path='%(console_log)s'/>
+ <target type='serial' port='0'/>
+ <alias name='serial0'/>
+ </console>
+"""
+
+
def main():
parser = argparse.ArgumentParser(
description="Configure a kvm virtual machine for the seed image.")
@@ -30,6 +49,8 @@
help='The libvirt network name to use')
parser.add_argument('--libvirt-nic-driver', default='e1000',
help='The libvirt network driver to use')
+ parser.add_argument('--console-log',
+ help='File to log console')
parser.add_argument('--emulator', default=None,
help='Path to emulator bin for vm template')
args = parser.parse_args()
@@ -44,6 +65,7 @@
'cpus': args.cpus,
'bootdev': args.bootdev,
'network': args.network,
+ 'nicdriver': args.libvirt_nic_driver,
'emulator': args.emulator,
}
@@ -55,22 +77,13 @@
elif os.path.exists("/usr/bin/qemu-kvm"): # Redhat
params['emulator'] = "/usr/bin/qemu-kvm"
- nicparams = {
- 'nicdriver': args.libvirt_nic_driver,
- 'network': args.network,
- }
-
- params['bm_network'] = """
-<!-- neutron friendly 'bare metal' network -->
-<interface type='network'>
- <source network='%(network)s'/>
- <virtualport type='openvswitch'/>
- <model type='%(nicdriver)s'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
-</interface>""" % nicparams
-
+ if args.console_log:
+ params['console_log'] = CONSOLE_LOG % {'console_log': args.console_log}
+ else:
+ params['console_log'] = ''
libvirt_template = source_template % params
conn = libvirt.open("qemu:///system")
+
a = conn.defineXML(libvirt_template)
print ("Created machine %s with UUID %s" % (args.name, a.UUIDString()))
diff --git a/tools/ironic/scripts/create-nodes b/tools/ironic/scripts/create-nodes
index d81113a..140bffe 100755
--- a/tools/ironic/scripts/create-nodes
+++ b/tools/ironic/scripts/create-nodes
@@ -4,7 +4,7 @@
# Creates baremetal poseur nodes for ironic testing purposes
-set -exu
+set -ex
# Keep track of the devstack directory
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
@@ -24,6 +24,7 @@
TOTAL=$(($5 - 1))
BRIDGE=$6
EMULATOR=$7
+LOGDIR=$8
LIBVIRT_NIC_DRIVER=${LIBVIRT_NIC_DRIVER:-"e1000"}
LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"}
@@ -43,6 +44,10 @@
virsh pool-start $LIBVIRT_STORAGE_POOL >&2
fi
+if [ -n "$LOGDIR" ] ; then
+ mkdir -p "$LOGDIR"
+fi
+
PREALLOC=
if [ -f /etc/debian_version ]; then
PREALLOC="--prealloc-metadata"
@@ -51,6 +56,11 @@
DOMS=""
for idx in $(seq 0 $TOTAL) ; do
NAME="baremetal${BRIDGE}_${idx}"
+ if [ -n "$LOGDIR" ] ; then
+ VM_LOGGING="--console-log $LOGDIR/${NAME}_console.log"
+ else
+ VM_LOGGING=""
+ fi
DOMS="$DOMS $NAME"
VOL_NAME="baremetal${BRIDGE}-${idx}.qcow2"
(virsh list --all | grep -q $NAME) && continue
@@ -62,7 +72,10 @@
# Pre-touch the VM to set +C, as it can only be set on empty files.
sudo touch "$volume_path"
sudo chattr +C "$volume_path" || true
- $TOP_DIR/scripts/configure-vm --bootdev network --name $NAME --image "$volume_path" --arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER --emulator $EMULATOR --network $BRIDGE >&2
+ $TOP_DIR/scripts/configure-vm \
+ --bootdev network --name $NAME --image "$volume_path" \
+ --arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER \
+ --emulator $EMULATOR --network $BRIDGE $VM_LOGGING >&2
done
for dom in $DOMS ; do
diff --git a/tools/ironic/templates/vm.xml b/tools/ironic/templates/vm.xml
index b18dec0..4f40334 100644
--- a/tools/ironic/templates/vm.xml
+++ b/tools/ironic/templates/vm.xml
@@ -27,14 +27,19 @@
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
- %(network)s
- %(bm_network)s
+ <interface type='network'>
+ <source network='%(network)s'/>
+ <virtualport type='openvswitch'/>
+ <model type='%(nicdriver)s'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
+ %(console_log)s
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>