summaryrefslogtreecommitdiffstats
path: root/mcp/scripts/lib.sh
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-18 02:10:36 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-29 01:27:28 +0200
commit835cf06e032d1271ac831b2acc2ff542f1022848 (patch)
tree429697287c9cc217060c38de03c512c0d032ea2b /mcp/scripts/lib.sh
parente4095ec00b9deb968bedfb201c0af12a168a3375 (diff)
[lib.sh] Add veth pair handling support
Upcoming docker integration requires special care for network interfaces Docker will hook to, so virsh networks can be mixed with Docker networks. We'll use veth pair(s) to hook together the Docker network(s) to their counterpart virsh-managed Linux bridge(s). JIRA: FUEL-383 Change-Id: I1a714dc8be73e79539d85bacac311d1ed05cc18d Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r--mcp/scripts/lib.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index d7af97c9b..f5affb0d3 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -376,9 +376,9 @@ function jumpserver_check_requirements {
}
function create_networks {
- local vnode_networks=("$@")
+ local all_vnode_networks=("mcpcontrol" "$@")
# create required networks, including constant "mcpcontrol"
- for net in "mcpcontrol" "${vnode_networks[@]}"; do
+ for net in "${all_vnode_networks[@]}"; do
if virsh net-info "${net}" >/dev/null 2>&1; then
virsh net-destroy "${net}" || true
virsh net-undefine "${net}"
@@ -391,6 +391,14 @@ function create_networks {
virsh net-start "${net}"
fi
done
+ # create veth pairs for relevant networks (mcpcontrol, pxebr, mgmt)
+ for i in $(seq 0 2 4); do
+ sudo ip link del "veth_mcp$i" || true
+ sudo ip link add "veth_mcp$i" type veth peer name "veth_mcp$((i+1))"
+ sudo ip link set "veth_mcp$i" up mtu 9000
+ sudo ip link set "veth_mcp$((i+1))" up mtu 9000
+ sudo brctl addif "${all_vnode_networks[$((i/2))]}" "veth_mcp$i"
+ done
}
function create_vms {