From 2d4c8da8031d4ca8638befe1c039c6197d3ac08d Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Wed, 19 Mar 2014 10:42:01 +0100 Subject: [PATCH 0001/3788] Upgrade to cirros 0.3.2 Cirros 0.3.2 is fixing the host name setting issue, which is required for turning on the tempest instance validation tests. Change-Id: I1b87740ab02c4eb0a8df653a35e1f85d40abda51 Related-Bug: #1132686 --- lib/tempest | 17 ++++++++++------- stackrc | 18 ++++++++++-------- tools/xen/README.md | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/tempest b/lib/tempest index af5493e2c1..d81423bc1d 100644 --- a/lib/tempest +++ b/lib/tempest @@ -56,7 +56,7 @@ BUILD_INTERVAL=1 BUILD_TIMEOUT=196 -BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1" +BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-${CIRROS_VERSION}" # Cinder/Volume variables TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default} @@ -310,9 +310,9 @@ function configure_tempest { iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud" iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}" iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH" - iniset $TEMPEST_CONFIG boto ari_manifest cirros-0.3.1-x86_64-initrd.manifest.xml - iniset $TEMPEST_CONFIG boto ami_manifest cirros-0.3.1-x86_64-blank.img.manifest.xml - iniset $TEMPEST_CONFIG boto aki_manifest cirros-0.3.1-x86_64-vmlinuz.manifest.xml + iniset $TEMPEST_CONFIG boto ari_manifest cirros-${CIRROS_VERSION}-x86_64-initrd.manifest.xml + iniset $TEMPEST_CONFIG boto ami_manifest cirros-${CIRROS_VERSION}-x86_64-blank.img.manifest.xml + iniset $TEMPEST_CONFIG boto aki_manifest cirros-${CIRROS_VERSION}-x86_64-vmlinuz.manifest.xml iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type" iniset $TEMPEST_CONFIG boto http_socket_timeout 30 iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros} @@ -326,7 +326,10 @@ function configure_tempest { fi # Scenario - iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec" + iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-${CIRROS_VERSION}-x86_64-uec" + iniset $TEMPEST_CONFIG scenario ami_img_file "cirros-${CIRROS_VERSION}-x86_64-blank.img" + iniset $TEMPEST_CONFIG scenario ari_img_file "cirros-${CIRROS_VERSION}-x86_64-initrd" + iniset $TEMPEST_CONFIG scenario aki_img_file "cirros-${CIRROS_VERSION}-x86_64-vmlinuz" # Large Ops Number iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0} @@ -403,8 +406,8 @@ function install_tempest { # init_tempest() - Initialize ec2 images function init_tempest { - local base_image_name=cirros-0.3.1-x86_64 - # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec + local base_image_name=cirros-${CIRROS_VERSION}-x86_64 + # /opt/stack/devstack/files/images/cirros-${CIRROS_VERSION}-x86_64-uec local image_dir="$FILES/images/${base_image_name}-uec" local kernel="$image_dir/${base_image_name}-vmlinuz" local ramdisk="$image_dir/${base_image_name}-initrd" diff --git a/stackrc b/stackrc index 4a997bf77c..dd52161dba 100644 --- a/stackrc +++ b/stackrc @@ -306,12 +306,14 @@ esac # glance as a disk image. If it ends in .gz, it is uncompressed first. # example: # http://cloud-images.ubuntu.com/releases/precise/release/ubuntu-12.04-server-cloudimg-armel-disk1.img -# http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-rootfs.img.gz +# http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-rootfs.img.gz # * OpenVZ image: # OpenVZ uses its own format of image, and does not support UEC style images #IMAGE_URLS="http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" # old ttylinux-uec image -#IMAGE_URLS="http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img" # cirros full disk image +#IMAGE_URLS="http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img" # cirros full disk image + +CIRROS_VERSION=${CIRROS_VERSION:-"0.3.2"} # Set default image based on ``VIRT_DRIVER`` and ``LIBVIRT_TYPE``, either of # which may be set in ``localrc``. Also allow ``DEFAULT_IMAGE_NAME`` and @@ -323,11 +325,11 @@ case "$VIRT_DRIVER" in libvirt) case "$LIBVIRT_TYPE" in lxc) # the cirros root disk in the uec tarball is empty, so it will not work for lxc - DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-rootfs} - IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-rootfs.img.gz"};; + DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-${CIRROS_VERSION}-x86_64-rootfs} + IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-rootfs.img.gz"};; *) # otherwise, use the uec style image (with kernel, ramdisk, disk) - DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-uec} - IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"};; + DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-${CIRROS_VERSION}-x86_64-uec} + IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz"};; esac ;; vsphere) @@ -337,8 +339,8 @@ case "$VIRT_DRIVER" in 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"};; *) # Default to Cirros with kernel, ramdisk and disk image - DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-uec} - IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"};; + DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-${CIRROS_VERSION}-x86_64-uec} + IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz"};; esac HEAT_FETCHED_TEST_IMAGE=${HEAT_FETCHED_TEST_IMAGE:-""} diff --git a/tools/xen/README.md b/tools/xen/README.md index 712782bc5f..c8f47be393 100644 --- a/tools/xen/README.md +++ b/tools/xen/README.md @@ -97,7 +97,7 @@ Of course, use real passwords if this machine is exposed. # Download a vhd and a uec image IMAGE_URLS="\ https://github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk.vhd.tgz,\ - http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz" + http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-uec.tar.gz" # Explicitly set virt driver VIRT_DRIVER=xenserver From c68a8f67a70538d4081c63742a27743e1172c147 Mon Sep 17 00:00:00 2001 From: Dane LeBlanc Date: Thu, 20 Mar 2014 19:10:08 -0400 Subject: [PATCH 0002/3788] stack.sh fails for Cisco plugin with missing cisco_plugins.ini error When the Cisco Nexus monolithic plugin is configured in the localrc, stack.sh fails with the error message: sed: can't read /etc/neutron/plugins/cisco/cisco_plugins.ini: No such file or directory This failure was introduced with the merge of change set 76992 (bug #1285884). Change set 76992 removed the copying of Q_PLUGIN_EXTRA_CONF_FILES from the neutron project area to directories under /etc/neutron. This copy from neutron to /etc is required by the Cisco Nexus monolithic plugin, since this plugin follows the original model for generating extra config files based on localrc settings: - Copy default config file(s) from neutron project to /etc using a relative path (relative to neutron and relative to /) - Modify the copies of the config file(s) using localrc settings - Add a --config-file command line setting for neutron server which points to the modified config file(s) under /etc The fix is to add the copying of the default versions of the extra config files from neutron to /etc into the cisco devstack script. Change-Id: Ifbae197ed591f7cccfd6d51eae2b21e31eb0a409 Closes-Bug: #1295411 --- lib/neutron_plugins/cisco | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/neutron_plugins/cisco b/lib/neutron_plugins/cisco index a1b089e1a3..ca9be75a95 100644 --- a/lib/neutron_plugins/cisco +++ b/lib/neutron_plugins/cisco @@ -183,6 +183,15 @@ function neutron_plugin_configure_common { ovs_neutron_plugin_configure_common Q_PLUGIN_EXTRA_CONF_PATH=etc/neutron/plugins/cisco Q_PLUGIN_EXTRA_CONF_FILES=(cisco_plugins.ini) + # Copy extra config files to /etc so that they can be modified + # later according to Cisco-specific localrc settings. + mkdir -p /$Q_PLUGIN_EXTRA_CONF_PATH + local f + local extra_conf_file + for (( f=0; $f < ${#Q_PLUGIN_EXTRA_CONF_FILES[@]}; f+=1 )); do + extra_conf_file=$Q_PLUGIN_EXTRA_CONF_PATH/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} + cp $NEUTRON_DIR/$extra_conf_file /$extra_conf_file + done else Q_PLUGIN_CONF_PATH=etc/neutron/plugins/cisco Q_PLUGIN_CONF_FILENAME=cisco_plugins.ini From 815ef98fa2f61dcc10ad9cf74a64a7e1848dcb60 Mon Sep 17 00:00:00 2001 From: Shiv Haris Date: Tue, 8 Apr 2014 15:19:12 -0700 Subject: [PATCH 0003/3788] Add missing function neutron_plugin_configure_service to brocade specific file Closes bug: 1304701 Change-Id: I18f90865a015b9dc6db4123d46492140ca67a38f --- lib/neutron_plugins/brocade | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/neutron_plugins/brocade b/lib/neutron_plugins/brocade index 4443fa7823..e4cc754039 100644 --- a/lib/neutron_plugins/brocade +++ b/lib/neutron_plugins/brocade @@ -24,6 +24,30 @@ function neutron_plugin_configure_common { 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 } From 8af6faed817e8128498551603ee04470559410a5 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Fri, 11 Apr 2014 17:06:14 -0700 Subject: [PATCH 0004/3788] Enable console logging for Ironic baremetal VMs Logs console output of VMs created for use by Ironic to $DATA_DIR/ironic/logs. This gives Jenkins something to archive that will be useful for debugging any deployment ramdisk issue blocking provisioning. Change-Id: I7d234a6a13dbe8579f685e46d7712dae497272a5 --- lib/ironic | 15 ++++++++++- tools/ironic/scripts/configure-vm | 41 ++++++++++++++++++++----------- tools/ironic/scripts/create-nodes | 17 +++++++++++-- tools/ironic/templates/vm.xml | 9 +++++-- 4 files changed, 63 insertions(+), 19 deletions(-) diff --git a/lib/ironic b/lib/ironic index 8d7687bac5..1aa85eab80 100644 --- a/lib/ironic +++ b/lib/ironic @@ -65,6 +65,10 @@ IRONIC_VM_NETWORK_RANGE=${IRONIC_VM_NETWORK_RANGE:-192.0.2.0/24} 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. @@ -177,6 +181,9 @@ function configure_ironic_conductor { 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 @@ -306,9 +313,15 @@ function configure_ironic_dirs { 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 { diff --git a/tools/ironic/scripts/configure-vm b/tools/ironic/scripts/configure-vm index 9936b76c4f..4c42c491c5 100755 --- a/tools/ironic/scripts/configure-vm +++ b/tools/ironic/scripts/configure-vm @@ -9,6 +9,25 @@ templatedir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates') +CONSOLE_LOG = """ + + + + + + + + + + + + + + + +""" + + def main(): parser = argparse.ArgumentParser( description="Configure a kvm virtual machine for the seed image.") @@ -30,6 +49,8 @@ def main(): 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 @@ def main(): 'cpus': args.cpus, 'bootdev': args.bootdev, 'network': args.network, + 'nicdriver': args.libvirt_nic_driver, 'emulator': args.emulator, } @@ -55,22 +77,13 @@ def main(): 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'] = """ - - - - - -
-""" % 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 d81113a4d5..140bffe46f 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 @@ esac 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 @@ if [ "$pool_state" != "running" ] ; then 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 @@ fi 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 @@ for idx in $(seq 0 $TOTAL) ; do # 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 b18dec055f..4f40334b7d 100644 --- a/tools/ironic/templates/vm.xml +++ b/tools/ironic/templates/vm.xml @@ -27,14 +27,19 @@
- %(network)s - %(bm_network)s + + + + +
+