From bea1e1954ad793f528876c030bc0ffecb83b0787 Mon Sep 17 00:00:00 2001 From: Huan Xie Date: Tue, 19 Apr 2016 07:01:30 +0100 Subject: [PATCH] Set default value and configurable value for integration bridge When using XenServer as hypervisor, install_os_domU.sh will create integration bridge for compute node when neutron network is used. But it should provide a way to allow moving of the VM to another host (with a different XEN_INTEGRATION_BRIDGE) for easier install. This patch is to provide the way to let user have the chance to configure integration bridge themselves Change-Id: If923a5e978e77fc091d24b6e1fe7a83a3375da09 --- lib/nova_plugins/hypervisor-xenserver | 3 ++- tools/xen/README.md | 6 ++++++ tools/xen/install_os_domU.sh | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/nova_plugins/hypervisor-xenserver b/lib/nova_plugins/hypervisor-xenserver index 3eb9149bb4..e7f1e87b61 100644 --- a/lib/nova_plugins/hypervisor-xenserver +++ b/lib/nova_plugins/hypervisor-xenserver @@ -29,7 +29,8 @@ GUEST_INTERFACE_DEFAULT=eth1 # Allow ``build_domU.sh`` to specify the flat network bridge via kernel args FLAT_NETWORK_BRIDGE_DEFAULT=$(sed -e 's/.* flat_network_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline) if is_service_enabled neutron; then - XEN_INTEGRATION_BRIDGE=$(sed -e 's/.* xen_integration_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline) + XEN_INTEGRATION_BRIDGE_DEFAULT=$(sed -e 's/.* xen_integration_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline) + XEN_INTEGRATION_BRIDGE=${XEN_INTEGRATION_BRIDGE:-$XEN_INTEGRATION_BRIDGE_DEFAULT} fi VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=169.254.0.1} diff --git a/tools/xen/README.md b/tools/xen/README.md index 21090e56aa..7062ecb48c 100644 --- a/tools/xen/README.md +++ b/tools/xen/README.md @@ -170,3 +170,9 @@ VM as `TEMPLATE_FILENAME`: xe vm-import filename="$mountdir/$TEMPLATE_FILENAME" umount "$mountdir" rm -rf "$mountdir" + +### Migrate OpenStack DomU to another host + +Given you need to migrate your DomU with OpenStack installed to another host, +you need to set `XEN_INTEGRATION_BRIDGE` in localrc if neutron network is used. +It is the bridge for `XEN_INT_BRIDGE_OR_NET_NAME` network created in Dom0 diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh index 46ff0b6fda..8b97265e21 100755 --- a/tools/xen/install_os_domU.sh +++ b/tools/xen/install_os_domU.sh @@ -299,10 +299,10 @@ $THIS_DIR/build_xva.sh "$GUEST_NAME" # kernel parameter for DomU attach_network "$XEN_INT_BRIDGE_OR_NET_NAME" -XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME") +XEN_INTEGRATION_BRIDGE_DEFAULT=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME") append_kernel_cmdline \ "$GUEST_NAME" \ - "xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}" + "xen_integration_bridge=${XEN_INTEGRATION_BRIDGE_DEFAULT}" FLAT_NETWORK_BRIDGE="${FLAT_NETWORK_BRIDGE:-$(bridge_for "$VM_BRIDGE_OR_NET_NAME")}" append_kernel_cmdline "$GUEST_NAME" "flat_network_bridge=${FLAT_NETWORK_BRIDGE}"