From 5ade538b7968b9c4adb549b8980db0951a9ba023 Mon Sep 17 00:00:00 2001 From: zhiyuan_cai Date: Tue, 11 Jul 2017 14:57:46 +0800 Subject: [PATCH] Change local type as the last network type candidate 1. What is the problem The segment ID of local type network is allocated in the local Neutron server, so it's possible that segment IDs of bridge network and local network conflict, which results to failure when creating bridge network. 2. What is the solution for the problem Since network AZ is implemented, we can deprecate the "local" network type and only create a local network by specifying AZ as region name. Before such deprecation, we change local type as the last network type candidate to avoid users create a local type network by mistake. 3. What features need to be implemented to the Tricircle to realize the solution N/A Change-Id: I55a1b6a93bd43e28c05530161e23de26a8bb8f60 Partial-Bug: #1692415 --- devstack/plugin.sh | 20 +++++---- doc/source/configuration.rst | 4 +- doc/source/installation-manual.rst | 4 +- ...working-guide-direct-provider-networks.rst | 16 ++++--- .../networking-guide-local-networking.rst | 42 ++++++++++--------- ...rking-guide-multiple-external-networks.rst | 4 +- ...tworking-guide-single-external-network.rst | 8 ++-- doc/source/networking-prerequisites.rst | 24 +++++------ tricircle/network/central_plugin.py | 4 +- 9 files changed, 64 insertions(+), 62 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index e0b23ac0..a2f6b446 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -279,23 +279,29 @@ function start_central_neutron_server { iniset $NEUTRON_CONF.$server_index client auto_refresh_endpoint True iniset $NEUTRON_CONF.$server_index client top_region_name $CENTRAL_REGION_NAME - local type_drivers=local - local tenant_network_types=local - if [ "$Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS" != "" ]; then - type_drivers+=,vlan - tenant_network_types+=,vlan - iniset $NEUTRON_CONF.$server_index tricircle network_vlan_ranges `echo $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS | awk -F= '{print $2}'` - fi + local type_drivers='' + local tenant_network_types='' if [ "$Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS" != "" ]; then type_drivers+=,vxlan tenant_network_types+=,vxlan iniset $NEUTRON_CONF.$server_index tricircle vni_ranges `echo $Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS | awk -F= '{print $2}'` fi + if [ "$Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS" != "" ]; then + type_drivers+=,vlan + tenant_network_types+=,vlan + iniset $NEUTRON_CONF.$server_index tricircle network_vlan_ranges `echo $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS | awk -F= '{print $2}'` + fi if [ "Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS" != "" ]; then type_drivers+=,flat tenant_network_types+=,flat iniset $NEUTRON_CONF.$server_index tricircle flat_networks `echo $Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS | awk -F= '{print $2}'` fi + type_drivers+=,local + tenant_network_types+=,local + # remove the heading "," + type_drivers=$(echo $type_drivers | sed 's/^,//') + tenant_network_types=$(echo $tenant_network_types | sed 's/^,//') + iniset $NEUTRON_CONF.$server_index tricircle type_drivers $type_drivers iniset $NEUTRON_CONF.$server_index tricircle tenant_network_types $tenant_network_types iniset $NEUTRON_CONF.$server_index tricircle enable_api_gateway False diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index e45d34be..3327fb22 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -154,9 +154,9 @@ configured in central Neutron's neutron.conf. - (String) Default region where the external network belongs to, it must exist, for example, RegionOne. * - ``network_vlan_ranges`` = ``None`` - (String) List of :: or specifying physical_network names usable for VLAN provider and tenant networks, as well as ranges of VLAN tags on each available for allocation to tenant networks, for example, bridge:2001:3000. - * - ``tenant_network_types`` = ``local,vxlan`` + * - ``tenant_network_types`` = ``vxlan,local`` - (String) Ordered list of network_types to allocate as tenant networks. The default value "local" is useful for single pod connectivity, for example, local vlan and vxlan. - * - ``type_drivers`` = ``local,vxlan`` + * - ``type_drivers`` = ``vxlan,local`` - (String) List of network type driver entry points to be loaded from the tricircle.network.type_drivers namespace, for example, local vlan and vxlan. * - ``vni_ranges`` = ``None`` - (String) Comma-separated list of : tuples enumerating ranges of VXLAN VNI IDs that are available for tenant network allocation, for example, 1001:2000 diff --git a/doc/source/installation-manual.rst b/doc/source/installation-manual.rst index 30346e5a..f1e4b107 100644 --- a/doc/source/installation-manual.rst +++ b/doc/source/installation-manual.rst @@ -169,8 +169,8 @@ Installation with Central Neutron Server [client] admin_tenant, "project name of admin account", demo [client] admin_user_domain_name, "user domain name of admin account", Default [client] admin_tenant_domain_name, "project name of admin account", Default - [tricircle] type_drivers, "list of network type driver entry points to be loaded", "local,vlan,vxlan,flat" - [tricircle] tenant_network_types, "ordered list of network_types to allocate as tenant networks", "local,vlan,vxlan,flat" + [tricircle] type_drivers, "list of network type driver entry points to be loaded", "vxlan,vlan,flat,local" + [tricircle] tenant_network_types, "ordered list of network_types to allocate as tenant networks", "vxlan,vlan,flat,local" [tricircle] network_vlan_ranges, "physical network names and VLAN tags range usable of VLAN provider", "bridge:2001:3000" [tricircle] vni_ranges, "VxLAN VNI range", "1001:2000" [tricircle] flat_networks, "physical network names with which flat networks can be created", bridge diff --git a/doc/source/networking-guide-direct-provider-networks.rst b/doc/source/networking-guide-direct-provider-networks.rst index 5d48c640..d2e84402 100644 --- a/doc/source/networking-guide-direct-provider-networks.rst +++ b/doc/source/networking-guide-direct-provider-networks.rst @@ -31,17 +31,16 @@ support service redundancy in case of region level failure. How to create this network topology =================================== -Create provider network phy_net1, which will be located in az1, including -RegionOne. +Create provider network phy_net1, which will be located in RegionOne. .. code-block:: console - $ neutron --os-region-name=CentralRegion net-create --provider:network_type vlan --provider:physical_network extern --availability-zone-hint az1 phy_net1 + $ neutron --os-region-name=CentralRegion net-create --provider:network_type vlan --provider:physical_network extern --availability-zone-hint RegionOne phy_net1 +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | - | availability_zone_hints | az1 | + | availability_zone_hints | RegionOne | | id | b7832cbb-d399-4d5d-bcfd-d1b804506a1a | | name | phy_net1 | | project_id | ce444c8be6da447bb412db7d30cd7023 | @@ -84,17 +83,16 @@ Create subnet in phy_net1. | updated_at | 2017-01-11T08:43:48Z | +-------------------+------------------------------------------------+ -Create provider network phy_net2, which will be located in az2, including -RegionTwo. +Create provider network phy_net2, which will be located in RegionTwo. .. code-block:: console - $ neutron --os-region-name=CentralRegion net-create --provider:network_type vlan --provider:physical_network extern --availability-zone-hint az2 phy_net2 + $ neutron --os-region-name=CentralRegion net-create --provider:network_type vlan --provider:physical_network extern --availability-zone-hint RegionTwo phy_net2 +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | - | availability_zone_hints | az2 | + | availability_zone_hints | RegionTwo | | id | 731293af-e68f-4677-b433-f46afd6431f3 | | name | phy_net2 | | project_id | ce444c8be6da447bb412db7d30cd7023 | @@ -328,7 +326,7 @@ List available flavors in RegionTwo. | d4 | ds4G | 4096 | 20 | 0 | | 4 | 1.0 | True | +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+ -Boot instance1 in RegionOne, and connect this instance to net1 and phy_net2. +Boot instance2 in RegionTwo, and connect this instance to net1 and phy_net2. .. code-block:: console diff --git a/doc/source/networking-guide-local-networking.rst b/doc/source/networking-guide-local-networking.rst index 52518608..00fbc15c 100644 --- a/doc/source/networking-guide-local-networking.rst +++ b/doc/source/networking-guide-local-networking.rst @@ -129,26 +129,28 @@ Create subnet in ext-net1. | updated_at | 2017-01-10T04:49:16Z | +-------------------+--------------------------------------------------+ -Create router R1. +Create local router R1 in RegionOne .. code-block:: console - $ neutron --os-region-name=CentralRegion router-create R1 - +-----------------------+--------------------------------------+ - | Field | Value | - +-----------------------+--------------------------------------+ - | admin_state_up | True | - | created_at | 2017-01-10T04:50:06Z | - | description | | - | external_gateway_info | | - | id | 7ce3282f-3864-4c55-84bf-fc5edc3293cb | - | name | R1 | - | project_id | c0e194dfadd44fc1983fd6dd7c8ed384 | - | revision_number | 1 | - | status | ACTIVE | - | tenant_id | c0e194dfadd44fc1983fd6dd7c8ed384 | - | updated_at | 2017-01-10T04:50:06Z | - +-----------------------+--------------------------------------+ + $ neutron --os-region-name=CentralRegion router-create --availability-zone-hint RegionOne R1 + +-------------------------+--------------------------------------+ + | Field | Value | + +-------------------------+--------------------------------------+ + | admin_state_up | True | + | availability_zone_hints | RegionOne | + | availability_zones | | + | created_at | 2017-01-10T04:50:06Z | + | description | | + | external_gateway_info | | + | id | 7ce3282f-3864-4c55-84bf-fc5edc3293cb | + | name | R1 | + | project_id | c0e194dfadd44fc1983fd6dd7c8ed384 | + | revision_number | 1 | + | status | ACTIVE | + | tenant_id | c0e194dfadd44fc1983fd6dd7c8ed384 | + | updated_at | 2017-01-10T04:50:06Z | + +-------------------------+--------------------------------------+ Set the router gateway to ext-net1 for R1. @@ -175,16 +177,16 @@ Set the router gateway to ext-net1 for R1. | updated_at | 2017-01-10T04:51:19Z | +-----------------------+------------------------------------------------------------------------------------------------------------+ -Create network net1. +Create local network net1 in RegionOne. .. code-block:: console - $ neutron --os-region-name=CentralRegion net-create net1 + $ neutron --os-region-name=CentralRegion net-create --availability-zone-hint RegionOne net1 +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | - | availability_zone_hints | | + | availability_zone_hints | RegionOne | | id | beaf59eb-c597-4b69-bd41-8bf9fee2dc6a | | name | net1 | | project_id | c0e194dfadd44fc1983fd6dd7c8ed384 | diff --git a/doc/source/networking-guide-multiple-external-networks.rst b/doc/source/networking-guide-multiple-external-networks.rst index 8d53352e..13b11f09 100644 --- a/doc/source/networking-guide-multiple-external-networks.rst +++ b/doc/source/networking-guide-multiple-external-networks.rst @@ -162,8 +162,8 @@ Set the router gateway to ext-net1 for R1. | updated_at | 2017-01-12T07:04:36Z | +-----------------------+------------------------------------------------------------------------------------------------------------+ -Create local network net1 which will reside in RegionOne. You can use az1 or -RegionOne as the value of availability-zone-hint. +Create local network net1 which will reside in RegionOne, so you use RegionOne +as the value of availability-zone-hint. .. code-block:: console diff --git a/doc/source/networking-guide-single-external-network.rst b/doc/source/networking-guide-single-external-network.rst index b73d7a57..a50ece2c 100644 --- a/doc/source/networking-guide-single-external-network.rst +++ b/doc/source/networking-guide-single-external-network.rst @@ -4,8 +4,8 @@ North South Networking via Single External Network The following figure illustrates one typical networking mode, the north south networking traffic for the tenant will be centralized through -single external network. Only one virtual router is needed even if -the tenant's network are located in multiple OpenStack regions. +single external network. Only one virtual non-local router R1 is needed +even if the tenant's network are located in multiple OpenStack regions. Only Neutron and Tricircle Local Neutron Plugin are required to be deployed in RegionThree if you want to make the external network being floating and @@ -188,8 +188,8 @@ Set the router gateway to ext-net1 for R1. $ neutron --os-region-name=CentralRegion router-gateway-set R1 ext-net1 Set gateway for router R1 -Create local network net1 which will reside in RegionOne. You can use az1 or -RegionOne as the value of availability-zone-hint. +Create local network net1 which will reside in RegionOne, so you use RegionOne +as the value of availability-zone-hint. .. code-block:: console diff --git a/doc/source/networking-prerequisites.rst b/doc/source/networking-prerequisites.rst index 570b1a4d..17adcf18 100644 --- a/doc/source/networking-prerequisites.rst +++ b/doc/source/networking-prerequisites.rst @@ -44,11 +44,6 @@ configure the local.conf like this:: TRICIRCLE_START_SERVICES=True enable_plugin tricircle https://github.com/openstack/tricircle/ -If you also want to configure vxlan network, suppose the vxlan range for tenant -network is 1001~2000, add the following configuration to the above local.conf:: - - Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS=(vni_ranges=1001:2000) - In the node which will run local Neutron without Tricircle services, configure the local.conf like this:: @@ -93,16 +88,17 @@ follows:: network_vlan_ranges = bridge:101:150,extern:151:200 vni_ranges = 1001:2000 flat_networks = bridge,extern - tenant_network_types = local,vlan,vxlan,flat - type_drivers = local,vlan,vxlan,flat + tenant_network_types = vxlan,vlan,flat,local + type_drivers = vxlan,vlan,flat,local -The default network type in central Neutron is local network, i.e, one -network can only be presented in one local Neutron. In which region the -local network will be located, it's up to in which region the first instance -will be booted in this network. After that, it'll fail if you want to boot -instance in another region to this network. The local network could be VLAN -or VxLAN or GRE network by default, it's up to your local Neutron's -configuration. +If you want to create a local network, it is recommend that you specify +availability_zone_hint as region name when creating the network, instead of +specifying the network type as "local". The "local" type has two drawbacks. +One is that you can not control the exact type of the network in local Neutron, +it's up to your local Neutron's configuration. The other is that the segment +ID of the network is allocated by local Neutron, so it may conflict with a +segment ID that is allocated by central Neutron. Considering such problems, we +have plan to deprecate "local" type. If you want to create a L2 network across multiple Neutron servers, then you have to speficy --provider-network-type vlan in network creation diff --git a/tricircle/network/central_plugin.py b/tricircle/network/central_plugin.py index ad46b82c..28cf6d27 100644 --- a/tricircle/network/central_plugin.py +++ b/tricircle/network/central_plugin.py @@ -75,11 +75,11 @@ from tricircle.network import security_groups tricircle_opts = [ cfg.ListOpt('type_drivers', - default=['local,vxlan'], + default=['vxlan,local'], help=_('List of network type driver entry points to be loaded ' 'from the tricircle.network.type_drivers namespace.')), cfg.ListOpt('tenant_network_types', - default=['local,vxlan'], + default=['vxlan,local'], help=_('Ordered list of network_types to allocate as tenant ' 'networks. The default value "local" is useful for ' 'single pod connectivity.')),