From 9f1fc50de23a34dd4ff6885512ee588013ee3f83 Mon Sep 17 00:00:00 2001 From: LIU Yulong Date: Mon, 9 Sep 2024 17:14:37 +0800 Subject: [PATCH] Add devstack plugin to enable ovs metadata_path Partially-Implements: blueprint distributed-metadata-datapath Change-Id: Ic34981480dd1796c2e11a9e62fbaece97ef827c1 --- devstack/lib/metadata_path | 7 +++++++ devstack/ml2-ovs-compute-local.conf.sample | 2 ++ devstack/plugin.sh | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 devstack/lib/metadata_path diff --git a/devstack/lib/metadata_path b/devstack/lib/metadata_path new file mode 100644 index 00000000000..ca16ea05706 --- /dev/null +++ b/devstack/lib/metadata_path @@ -0,0 +1,7 @@ +function configure_ovs_metadata_path { + sudo ovs-vsctl -- --may-exist add-br br-meta + plugin_agent_add_l2_agent_extension "metadata_path" + iniset /$NEUTRON_CORE_PLUGIN_CONF metadata metadata_proxy_shared_secret $SERVICE_PASSWORD + iniset /$NEUTRON_CORE_PLUGIN_CONF metadata nova_metadata_host $SERVICE_HOST + iniset /$NEUTRON_CORE_PLUGIN_CONF metadata nova_metadata_port $METADATA_SERVICE_PORT +} diff --git a/devstack/ml2-ovs-compute-local.conf.sample b/devstack/ml2-ovs-compute-local.conf.sample index 6ab5f105ef5..6881caca6af 100644 --- a/devstack/ml2-ovs-compute-local.conf.sample +++ b/devstack/ml2-ovs-compute-local.conf.sample @@ -54,6 +54,8 @@ tunnel_types=vxlan,gre # Uncomment the following to enable distributed DHCP for openvswitch agent # for your compute node. #extensions = dhcp +# Enable Neutron Openvswitch Agent metadata path extenison. +#extensions = dhcp,metadata_path [[post-config|$Q_L3_CONF_FILE]] [DEFAULT] diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 8af511af877..ad10f156bd2 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -8,6 +8,7 @@ source $LIBDIR/l2_agent_sriovnicswitch source $LIBDIR/l3_agent source $LIBDIR/l3_conntrack_helper source $LIBDIR/l3_ndp_proxy +source $LIBDIR/metadata_path source $LIBDIR/ml2 source $LIBDIR/network_segment_range source $LIBDIR/segments @@ -69,6 +70,11 @@ if [[ "$1" == "stack" ]]; then configure_ovs_distributed_dhcp fi fi + if is_service_enabled q-metadata-path neutron-metadata-path; then + if [ $Q_AGENT = openvswitch ]; then + configure_ovs_metadata_path + fi + fi if is_service_enabled neutron-local-ip; then configure_local_ip fi