
This begins work toward moving our devstack code to a devstack plugin within our tree. This allows us to experiment with the devstack code more easily, as well as take some load off of the devstack team. Note that the plugin is not enabled until we enable it in project-config, so this doesn't actually affect devstack runs yet. The files that exist for us in devstack are listed below. $ find . -name *ironic* ./lib/ironic ./lib/nova_plugins/hypervisor-ironic ./files/rpms/ironic ./files/apache-ironic.template ./files/debs/ironic ./extras.d/50-ironic.sh ./tools/ironic $ tree tools/ironic tools/ironic ├── scripts │ ├── cleanup-node │ ├── configure-vm │ ├── create-node │ └── setup-network └── templates ├── brbm.xml ├── tftpd-xinetd.template └── vm.xml All of these files are copied here, except: lib/nova_plugins/hypervisor-ironic: this is nova code and will not move. extras.d/50-ironic.sh: this will become the base for plugin.sh. Change-Id: I3fabefa686cad4bc50f6a5603fd95c96d1a21e68 Depends-On: Id01d97fd13fa9f866d645ec5077834ddb78b2b89
29 lines
881 B
Bash
Executable File
29 lines
881 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# **setup-network**
|
|
|
|
# Setups openvswitch libvirt network suitable for
|
|
# running baremetal poseur nodes for ironic testing purposes
|
|
|
|
set -exu
|
|
|
|
LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"}
|
|
|
|
# Keep track of the DevStack directory
|
|
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
|
|
BRIDGE_SUFFIX=${1:-''}
|
|
BRIDGE_NAME=brbm$BRIDGE_SUFFIX
|
|
|
|
export VIRSH_DEFAULT_CONNECT_URI="$LIBVIRT_CONNECT_URI"
|
|
|
|
# Only add bridge if missing
|
|
(sudo ovs-vsctl list-br | grep ${BRIDGE_NAME}$) || sudo ovs-vsctl add-br ${BRIDGE_NAME}
|
|
|
|
# Remove bridge before replacing it.
|
|
(virsh net-list | grep "${BRIDGE_NAME} ") && virsh net-destroy ${BRIDGE_NAME}
|
|
(virsh net-list --inactive | grep "${BRIDGE_NAME} ") && virsh net-undefine ${BRIDGE_NAME}
|
|
|
|
virsh net-define <(sed s/brbm/$BRIDGE_NAME/ $TOP_DIR/templates/brbm.xml)
|
|
virsh net-autostart ${BRIDGE_NAME}
|
|
virsh net-start ${BRIDGE_NAME}
|