Browse Source

Merge pull request #46 from CanonicalLtd/fix-network-after-reboot2

Persist external bridge over reboots.
configure-hook
James Page 3 years ago
committed by GitHub
parent
commit
6aa38a941a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 10 deletions
  1. +19
    -0
      snap-overlay/bin/setup-br-ex
  2. +2
    -10
      snap/hooks/configure
  3. +8
    -0
      snapcraft.yaml

+ 19
- 0
snap-overlay/bin/setup-br-ex View 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

+ 2
- 10
snap/hooks/configure View File

@ -30,16 +30,8 @@ done
HOME=$SNAP_COMMON/lib/rabbitmq rabbitmqctl add_user openstack rabbitmq || :
HOME=$SNAP_COMMON/lib/rabbitmq rabbitmqctl set_permissions openstack ".*" ".*" ".*"
# Open vSwitch/Neutron
echo "Configuring Open vSwitch networking"
# 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 || :
# Glance
echo "Waiting for glance to start."
while ! nc -z localhost 9292; do sleep 0.1; done;
sleep 5


+ 8
- 0
snapcraft.yaml View File

@ -213,6 +213,14 @@ apps:
ovs-dpctl:
command: ovs-wrapper $SNAP/bin/ovs-dpctl
# plugs:
# - network
external-bridge:
command: bin/setup-br-ex
daemon: oneshot
passthrough:
after: [ovs-vswitchd]
# plugs:
# - network
# Libvirt/Qemu


Loading…
Cancel
Save