Perist external bridge over reboots.
This fixes an issue where we weren't creating a netplan config and/or and entry in /etc/network/interfaces for br-ex, and thus losing external access to our virtual networks after reboot. Since we don't actually want to touch the host system's networking config, we just drop a oneshot daemon into place that sets br-ex up each time the snap services are started.
This commit is contained in:
parent
e769f51a9d
commit
597ffc99d8
19
snap-overlay/bin/setup-br-ex
Executable file
19
snap-overlay/bin/setup-br-ex
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Oneshot daemon which creates a networking bridge.
|
||||||
|
#
|
||||||
|
# Creates br-ex, and sets up an ip address for it. We put this in a
|
||||||
|
# oneshot so that the ip address persists after reboot, without
|
||||||
|
# needing to add networking entries to the host system. (We want this
|
||||||
|
# to work well when we turn off classic confinement.)
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Create external integration bridge
|
||||||
|
ovs-vsctl --retry --may-exist add-br br-ex
|
||||||
|
|
||||||
|
# Configure br-ex
|
||||||
|
ip address add 10.20.20.1/24 dev br-ex || :
|
||||||
|
ip link set br-ex up || :
|
||||||
|
|
||||||
|
exit 0
|
12
snap/hooks/configure
vendored
12
snap/hooks/configure
vendored
@ -30,16 +30,8 @@ done
|
|||||||
HOME=$SNAP_COMMON/lib/rabbitmq rabbitmqctl add_user openstack rabbitmq || :
|
HOME=$SNAP_COMMON/lib/rabbitmq rabbitmqctl add_user openstack rabbitmq || :
|
||||||
HOME=$SNAP_COMMON/lib/rabbitmq rabbitmqctl set_permissions openstack ".*" ".*" ".*"
|
HOME=$SNAP_COMMON/lib/rabbitmq rabbitmqctl set_permissions openstack ".*" ".*" ".*"
|
||||||
|
|
||||||
# Open vSwitch/Neutron
|
# Glance
|
||||||
echo "Configuring Open vSwitch networking"
|
echo "Waiting for glance to start."
|
||||||
|
|
||||||
# Create external integration bridge
|
|
||||||
ovs-vsctl --retry --may-exist add-br br-ex
|
|
||||||
|
|
||||||
# Configure br-ex
|
|
||||||
ip address add 10.20.20.1/24 dev br-ex || :
|
|
||||||
ip link set br-ex up || :
|
|
||||||
|
|
||||||
while ! nc -z localhost 9292; do sleep 0.1; done;
|
while ! nc -z localhost 9292; do sleep 0.1; done;
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -213,6 +213,14 @@ apps:
|
|||||||
ovs-dpctl:
|
ovs-dpctl:
|
||||||
command: ovs-wrapper $SNAP/bin/ovs-dpctl
|
command: ovs-wrapper $SNAP/bin/ovs-dpctl
|
||||||
# plugs:
|
# plugs:
|
||||||
|
# - network
|
||||||
|
|
||||||
|
external-bridge:
|
||||||
|
command: bin/setup-br-ex
|
||||||
|
daemon: oneshot
|
||||||
|
passthrough:
|
||||||
|
after: [ovs-vswitchd]
|
||||||
|
# plugs:
|
||||||
# - network
|
# - network
|
||||||
|
|
||||||
# Libvirt/Qemu
|
# Libvirt/Qemu
|
||||||
|
Loading…
Reference in New Issue
Block a user