From 0cdf8b20b664abd26bd25483ead82eaf3640a36d Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Mon, 16 Sep 2019 12:15:34 +1200 Subject: Add image build experimental CI job Story: 2006553 Task: 36637 Change-Id: I3d909082fb887b24ed25c93e11792031d5053b1e --- devstack/plugin.sh | 72 ++++-------------------------------------------------- 1 file changed, 5 insertions(+), 67 deletions(-) (limited to 'devstack') diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 917718a9..e6afa5c2 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -389,69 +389,6 @@ function setup_mgmt_network() { # fi } -# Set up Trove management network and make configuration change. -function config_trove_network { - echo "Finalizing Neutron networking for Trove" - echo "Dumping current network parameters:" - echo " SERVICE_HOST: $SERVICE_HOST" - echo " BRIDGE_IP: $BRIDGE_IP" - echo " PUBLIC_NETWORK_GATEWAY: $PUBLIC_NETWORK_GATEWAY" - echo " NETWORK_GATEWAY: $NETWORK_GATEWAY" - echo " IPV4_ADDRS_SAFE_TO_USE: $IPV4_ADDRS_SAFE_TO_USE" - echo " IPV6_ADDRS_SAFE_TO_USE: $IPV6_ADDRS_SAFE_TO_USE" - echo " FIXED_RANGE: $FIXED_RANGE" - echo " FLOATING_RANGE: $FLOATING_RANGE" - echo " SUBNETPOOL_PREFIX_V4: $SUBNETPOOL_PREFIX_V4" - echo " SUBNETPOOL_SIZE_V4: $SUBNETPOOL_SIZE_V4" - echo " SUBNETPOOL_V4_ID: $SUBNETPOOL_V4_ID" - echo " ROUTER_GW_IP: $ROUTER_GW_IP" - echo " TROVE_MGMT_SUBNET_RANGE: ${TROVE_MGMT_SUBNET_RANGE}" - - echo "Creating Trove management network/subnet for Trove service project." - trove_service_project_id=$(openstack project show $SERVICE_PROJECT_NAME -c id -f value) - setup_mgmt_network ${trove_service_project_id} ${TROVE_MGMT_NETWORK_NAME} ${TROVE_MGMT_SUBNET_NAME} ${TROVE_MGMT_SUBNET_RANGE} - mgmt_net_id=$(openstack network show ${TROVE_MGMT_NETWORK_NAME} -c id -f value) - echo "Created Trove management network ${TROVE_MGMT_NETWORK_NAME}(${mgmt_net_id})" - - # Share the private network to other projects for testing purpose. We make - # the private network accessible to control plane below so that we could - # reach the private network for integration tests without floating ips - # associated, no matter which user the tests are using. - shared=$(openstack network show ${PRIVATE_NETWORK_NAME} -c shared -f value) - if [[ "$shared" == "False" ]]; then - openstack network set ${PRIVATE_NETWORK_NAME} --share - fi - sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP - - # Make sure we can reach the management port of the service VM, this - # configuration is only for testing purpose. In production, it's - # recommended to config the router in the cloud infrastructure for the - # communication between Trove control plane and service VMs. - INTERFACE=trove-mgmt - MGMT_PORT_ID=$(openstack port create --project ${trove_service_project_id} --security-group ${TROVE_MGMT_SECURITY_GROUP} --device-owner trove --network ${TROVE_MGMT_NETWORK_NAME} --host=$(hostname) -c id -f value ${INTERFACE}-port) - MGMT_PORT_MAC=$(openstack port show -c mac_address -f value $MGMT_PORT_ID) - MGMT_PORT_IP=$(openstack port show -f value -c fixed_ips $MGMT_PORT_ID | awk '{FS=",| "; gsub(",",""); gsub("'\''",""); for(i = 1; i <= NF; ++i) {if ($i ~ /^ip_address/) {n=index($i, "="); if (substr($i, n+1) ~ "\\.") print substr($i, n+1)}}}') - sudo ovs-vsctl -- --may-exist add-port ${OVS_BRIDGE:-br-int} $INTERFACE -- set Interface $INTERFACE type=internal -- set Interface $INTERFACE external-ids:iface-status=active -- set Interface $INTERFACE external-ids:attached-mac=$MGMT_PORT_MAC -- set Interface $INTERFACE external-ids:iface-id=$MGMT_PORT_ID -- set Interface $INTERFACE external-ids:skip_cleanup=true - sudo ip link set dev $INTERFACE address $MGMT_PORT_MAC - mask=$(echo ${TROVE_MGMT_SUBNET_RANGE} | awk -F'/' '{print $2}') - sudo ip addr add ${MGMT_PORT_IP}/${mask} dev $INTERFACE - sudo ip link set $INTERFACE up - - echo "Neutron network list:" - openstack network list - echo "Neutron subnet list:" - openstack subnet list - echo "ip route:" - sudo ip route - - # Now make sure the conf settings are right - iniset $TROVE_CONF DEFAULT network_label_regex ${PRIVATE_NETWORK_NAME} - iniset $TROVE_CONF DEFAULT ip_regex "" - iniset $TROVE_CONF DEFAULT black_list_regex "" - iniset $TROVE_CONF DEFAULT management_networks ${mgmt_net_id} - iniset $TROVE_CONF DEFAULT network_driver trove.network.neutron.NeutronDriver -} - # start_trove() - Start running processes, including screen function start_trove { if [[ ${TROVE_USE_MOD_WSGI}" == TRUE" ]]; then @@ -501,7 +438,7 @@ function create_guest_image { $DEST/trove/integration/scripts/trovestack build-image ${TROVE_DATASTORE_TYPE} ${TROVE_IMAGE_OS} ${TROVE_IMAGE_OS_RELEASE} true - image_name=${TROVE_IMAGE_OS}-${TROVE_DATASTORE_TYPE} + image_name="trove-${TROVE_IMAGE_OS}-${TROVE_IMAGE_OS_RELEASE}-${TROVE_DATASTORE_TYPE}" image_file=$HOME/images/${image_name}.qcow2 if [ ! -f ${image_file} ]; then echo "Image file was not found at ${image_file}. Probably it was not created." @@ -562,8 +499,8 @@ function config_trove_network { echo " TROVE_MGMT_SUBNET_RANGE: ${TROVE_MGMT_SUBNET_RANGE}" # Save xtrace setting - local XTRACE - XTRACE=$(set +o | grep xtrace) + local orig_xtrace + orig_xtrace=$(set +o | grep xtrace) set -x echo "Creating Trove management network/subnet for Trove service project." @@ -613,7 +550,7 @@ function config_trove_network { iniset $TROVE_CONF DEFAULT network_driver trove.network.neutron.NeutronDriver # Restore xtrace setting - $XTRACE + $orig_xtrace } function config_nova_keypair { @@ -646,6 +583,7 @@ function config_cinder_volume_type { iniset $TROVE_CONF DEFAULT cinder_volume_type ${volume_type} } + function config_mgmt_security_group { local sgid -- cgit v1.2.1