Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 16. Deploying routed provider networks
16.1. Advantages of routed provider networks Copier lienLien copié sur presse-papiers!
In Red Hat OpenStack Platform (RHOSP), operators can create routed provider networks. Routed provider networks are typically used in edge deployments, and rely on multiple layer 2 network segments instead of traditional networks that have only one segment.
Routed provider networks simplify the cloud for end users because they see only one network. For cloud operators, routed provider networks deliver scalabilty and fault tolerance. For example, if a major error occurs, only one segment is impacted instead of the entire network failing.
Before routed provider networks, operators typically had to choose from one of the following architectures:
- A single, large layer 2 network
- Multiple, smaller layer 2 networks
Single, large layer 2 networks become complex when scaling and reduce fault tolerance (increase failure domains).
Multiple, smaller layer 2 networks scale better and shrink failure domains, but can introduce complexity for end users.
Starting with RHOSP 16.2 and later, you can deploy routed provider networks using the Modular Layer 2 plug-in with the Open Virtual Network mechanism driver (ML2/OVN). (Routed provider network support for the ML2/Open vSwitch (OVS) and SR-IOV mechanism drivers was introduced in RHOSP 16.1.1.)
16.2. Fundamentals of routed provider networks Copier lienLien copié sur presse-papiers!
A routed provider network is different from other types of networks because of the one-to-one association between a network subnet and a segment. In the past, the Red Hat OpenStack (RHOSP) Networking service has not supported routed provider networks, because the Networking service required that all subnets must either belong to the same segment or to no segment.
With routed provider networks, the IP addresses available to virtual machine (VM) instances depend on the segment of the network available on the particular compute node. The Networking service port can be associated with only one network segment.
Similar to conventional networking, layer 2 (switching) handles transit of traffic between ports on the same network segment and layer 3 (routing) handles transit of traffic between segments.
The Networking service does not provide layer 3 services between segments. Instead, it relies on physical network infrastructure to route subnets. Thus, both the Networking service and physical network infrastructure must contain configuration for routed provider networks, similar to conventional provider networks.
Because the Compute service (nova) scheduler is not network segment aware, when you deploy routed provider networks, you must map each leaf or rack segment or DCN edge site to a Compute service host-aggregate or availability zone.
If you require a DHCP-metadata service, you must define an availability zone for each edge site or network segment, to ensure that the local DHCP agent is deployed.
16.3. Limitations of routed provider networks Copier lienLien copié sur presse-papiers!
Routed provider networks are not supported by all mechanism drivers and there are restrictions with the Compute service scheduler and other software as noted in the following list:
- North-south routing with central SNAT or a floating IP is not supported.
- When using SR-IOV or PCI pass-through, physical network (physnet) names must be the same in central and remote sites or segments. You cannot reuse segment IDs.
The Compute service (nova) scheduler is not segment-aware. (You must map each segment or edge site to a Compute host-aggregate or availability zone.) Currently, there are only two VM instance boot options available:
-
Boot using
port-idand no IP address, specifying Compute availability zone (segment or edge site). -
Boot using
network-id, specifying the Compute availability zone (segment or edge site).
-
Boot using
- Cold or live migration works only when you specify the destination Compute availability zone (segment or edge site).
16.4. Preparing for a routed provider network Copier lienLien copié sur presse-papiers!
There are several tasks that you must perform before you can create a routed provider network in Red Hat OpenStack Platform (RHOSP).
Procedure
Within a network, use a unique physical network name for each segment. This enables reuse of the same segmentation details between subnets.
For example, use the same VLAN ID across all segments of a particular provider network.
Implement routing between segments.
Each subnet on a segment must contain the gateway address of the router interface on that particular subnet.
Expand Table 16.1. Sample segments for routing Segment Version Addresses Gateway segment1
4
203.0.113.0/24
203.0.113.1
segment1
6
fd00:203:0:113::/64
fd00:203:0:113::1
segment2
4
198.51.100.0/24
198.51.100.1
segment2
6
fd00:198:51:100::/64
fd00:198:51:100::1
Map segments to Compute nodes.
Routed provider networks imply that Compute nodes reside on different segments. Ensure that every Compute host in a routed provider network has direct connectivity to one of its segments.
Expand Table 16.2. Sample segment to Compute node mappings Host Rack Physical network compute0001
rack 1
segment 1
compute0002
rack 1
segment 1
…
…
…
compute0101
rack 2
segment 2
compute0102
rack 2
segment 2
compute0102
rack 2
segment 2
…
…
…
When you deploy with the Modular Layer 2 plug-in with the Open vSwitch mechanism driver (ML2/OVS), you must deploy at least one DHCP agent per segment.
Unlike conventional provider networks, a DHCP agent cannot support more than one segment within a network. Deploy DHCP agents on the Compute nodes containing the segments rather than on the network nodes to reduce the node count.
Expand Table 16.3. Sample DHCP agent per segment mapping Host Rack Physical network network0001
rack 1
segment 1
network0002
rack 1
segment 1
…
…
…
You deploy a DHCP agent and a RHOSP Networking service (neutron) metadata agent on the Compute nodes by using a custom roles file.
Here is an example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In a custom environment file, add the following key-value pair:
parameter_defaults: .... NeutronEnableIsolatedMetadata: 'True' ....parameter_defaults: .... NeutronEnableIsolatedMetadata: 'True' ....Copy to Clipboard Copied! Toggle word wrap Toggle overflow
16.5. Creating a routed provider network Copier lienLien copié sur presse-papiers!
Routed provider networks simplify the Red Hat OpenStack Platform (RHOSP) cloud for end users because they see only one network. For cloud operators, routed provider networks deliver scalabilty and fault tolerance.
When you perform this procedure, you create a routed provider network with two network segments. Each segment contains one IPv4 subnet and one IPv6 subnet.
Prerequisites
- Complete the steps in xref:prepare-routed-prov-network_deploy-routed-prov-networks.
Procedure
Create a VLAN provider network that includes a default segment.
In this example, the VLAN provider network is named
multisegment1and uses a physical network calledprovider1and a VLAN whose ID is128:Example
openstack network create --share --provider-physical-network provider1 \ --provider-network-type vlan --provider-segment 128 multisegment1
$ openstack network create --share --provider-physical-network provider1 \ --provider-network-type vlan --provider-segment 128 multisegment1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Rename the default network segment to
segment1.Obtain the segment ID:
openstack network segment list --network multisegment1
$ openstack network segment list --network multisegment1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
+--------------------------------------+----------+--------------------------------------+--------------+---------+ | ID | Name | Network | Network Type | Segment | +--------------------------------------+----------+--------------------------------------+--------------+---------+ | 43e16869-ad31-48e4-87ce-acf756709e18 | None | 6ab19caa-dda9-4b3d-abc4-5b8f435b98d9 | vlan | 128 | +--------------------------------------+----------+--------------------------------------+--------------+---------+
+--------------------------------------+----------+--------------------------------------+--------------+---------+ | ID | Name | Network | Network Type | Segment | +--------------------------------------+----------+--------------------------------------+--------------+---------+ | 43e16869-ad31-48e4-87ce-acf756709e18 | None | 6ab19caa-dda9-4b3d-abc4-5b8f435b98d9 | vlan | 128 | +--------------------------------------+----------+--------------------------------------+--------------+---------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow Using the segment ID, rename the network segment to
segment1:openstack network segment set --name segment1 43e16869-ad31-48e4-87ce-acf756709e18
$ openstack network segment set --name segment1 43e16869-ad31-48e4-87ce-acf756709e18Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a second segment on the provider network.
In this example, the network segment uses a physical network called
provider2and a VLAN whose ID is129:Example
openstack network segment create --physical-network provider2 \ --network-type vlan --segment 129 --network multisegment1 segment2
$ openstack network segment create --physical-network provider2 \ --network-type vlan --segment 129 --network multisegment1 segment2Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the network contains the
segment1andsegment2segments:openstack network segment list --network multisegment1
$ openstack network segment list --network multisegment1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create one IPv4 subnet and one IPv6 subnet on the
segment1segment.In this example, the IPv4 subnet uses
203.0.113.0/24:Example
openstack subnet create \ --network multisegment1 --network-segment segment1 \ --ip-version 4 --subnet-range 203.0.113.0/24 \ multisegment1-segment1-v4
$ openstack subnet create \ --network multisegment1 --network-segment segment1 \ --ip-version 4 --subnet-range 203.0.113.0/24 \ multisegment1-segment1-v4Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, the IPv6 subnet uses
fd00:203:0:113::/64:Example
openstack subnet create \ --network multisegment1 --network-segment segment1 \ --ip-version 6 --subnet-range fd00:203:0:113::/64 \ --ipv6-address-mode slaac multisegment1-segment1-v6
$ openstack subnet create \ --network multisegment1 --network-segment segment1 \ --ip-version 6 --subnet-range fd00:203:0:113::/64 \ --ipv6-address-mode slaac multisegment1-segment1-v6Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteBy default, IPv6 subnets on provider networks rely on physical network infrastructure for stateless address autoconfiguration (SLAAC) and router advertisement.
Create one IPv4 subnet and one IPv6 subnet on the
segment2segment.In this example, the IPv4 subnet uses
198.51.100.0/24:Example
openstack subnet create \ --network multisegment1 --network-segment segment2 \ --ip-version 4 --subnet-range 198.51.100.0/24 \ multisegment1-segment2-v4
$ openstack subnet create \ --network multisegment1 --network-segment segment2 \ --ip-version 4 --subnet-range 198.51.100.0/24 \ multisegment1-segment2-v4Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, the IPv6 subnet uses
fd00:198:51:100::/64:Example
openstack subnet create \ --network multisegment1 --network-segment segment2 \ --ip-version 6 --subnet-range fd00:198:51:100::/64 \ --ipv6-address-mode slaac multisegment1-segment2-v6
$ openstack subnet create \ --network multisegment1 --network-segment segment2 \ --ip-version 6 --subnet-range fd00:198:51:100::/64 \ --ipv6-address-mode slaac multisegment1-segment2-v6Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that each IPv4 subnet associates with at least one DHCP agent:
openstack network agent list --agent-type dhcp --network multisegment1
$ openstack network agent list --agent-type dhcp --network multisegment1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that inventories were created for each segment IPv4 subnet in the Compute service placement API.
Run this command for all segment IDs:
SEGMENT_ID=053b7925-9a89-4489-9992-e164c8cc8763 openstack resource provider inventory list $SEGMENT_ID
$ SEGMENT_ID=053b7925-9a89-4489-9992-e164c8cc8763 $ openstack resource provider inventory list $SEGMENT_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
In this sample output, only one of the segments is shown:
+----------------+------------------+----------+----------+-----------+----------+-------+ | resource_class | allocation_ratio | max_unit | reserved | step_size | min_unit | total | +----------------+------------------+----------+----------+-----------+----------+-------+ | IPV4_ADDRESS | 1.0 | 1 | 2 | 1 | 1 | 30 | +----------------+------------------+----------+----------+-----------+----------+-------+
+----------------+------------------+----------+----------+-----------+----------+-------+ | resource_class | allocation_ratio | max_unit | reserved | step_size | min_unit | total | +----------------+------------------+----------+----------+-----------+----------+-------+ | IPV4_ADDRESS | 1.0 | 1 | 2 | 1 | 1 | 30 | +----------------+------------------+----------+----------+-----------+----------+-------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that host aggregates were created for each segment in the Compute service:
openstack aggregate list
$ openstack aggregate listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
In this example, only one of the segments is shown:
+----+---------------------------------------------------------+-------------------+ | Id | Name | Availability Zone | +----+---------------------------------------------------------+-------------------+ | 10 | Neutron segment id 053b7925-9a89-4489-9992-e164c8cc8763 | None | +----+---------------------------------------------------------+-------------------+
+----+---------------------------------------------------------+-------------------+ | Id | Name | Availability Zone | +----+---------------------------------------------------------+-------------------+ | 10 | Neutron segment id 053b7925-9a89-4489-9992-e164c8cc8763 | None | +----+---------------------------------------------------------+-------------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow Launch one or more instances. Each instance obtains IP addresses according to the segment it uses on the particular compute node.
NoteIf a fixed IP is specified by the user in the port create request, that particular IP is allocated immediately to the port. However, creating a port and passing it to an instance yields a different behavior than conventional networks. If the fixed IP is not specified on the port create request, the Networking service defers assignment of IP addresses to the port until the particular compute node becomes apparent. For example, when you run this command:
openstack port create --network multisegment1 port1
$ openstack port create --network multisegment1 port1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
16.6. Migrating a non-routed network to a routed provider network Copier lienLien copié sur presse-papiers!
You can migrate a non-routed network to a routed provider network by associating the subnet of the network with the ID of the network segment.
Prerequisites
The non-routed network you are migrating must contain only one segment and only one subnet.
ImportantIn non-routed provider networks that contain multiple subnets or network segments it is not possible to safely migrate to a routed provider network. In non-routed networks, addresses from the subnet allocation pools are assigned to ports without consideration of the network segment to which the port is bound.
Procedure
For the network that is being migrated, obtain the ID of the current network segment.
Example
openstack network segment list --network my_network
$ openstack network segment list --network my_networkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
+--------------------------------------+------+--------------------------------------+--------------+---------+ | ID | Name | Network | Network Type | Segment | +--------------------------------------+------+--------------------------------------+--------------+---------+ | 81e5453d-4c9f-43a5-8ddf-feaf3937e8c7 | None | 45e84575-2918-471c-95c0-018b961a2984 | flat | None | +--------------------------------------+------+--------------------------------------+--------------+---------+
+--------------------------------------+------+--------------------------------------+--------------+---------+ | ID | Name | Network | Network Type | Segment | +--------------------------------------+------+--------------------------------------+--------------+---------+ | 81e5453d-4c9f-43a5-8ddf-feaf3937e8c7 | None | 45e84575-2918-471c-95c0-018b961a2984 | flat | None | +--------------------------------------+------+--------------------------------------+--------------+---------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow For the network that is being migrated, obtain the ID of the current subnet.
Example
openstack network segment list --network my_network
$ openstack network segment list --network my_networkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
+--------------------------------------+-----------+--------------------------------------+---------------+ | ID | Name | Network | Subnet | +--------------------------------------+-----------+--------------------------------------+---------------+ | 71d931d2-0328-46ae-93bc-126caf794307 | my_subnet | 45e84575-2918-471c-95c0-018b961a2984 | 172.24.4.0/24 | +--------------------------------------+-----------+--------------------------------------+---------------+
+--------------------------------------+-----------+--------------------------------------+---------------+ | ID | Name | Network | Subnet | +--------------------------------------+-----------+--------------------------------------+---------------+ | 71d931d2-0328-46ae-93bc-126caf794307 | my_subnet | 45e84575-2918-471c-95c0-018b961a2984 | 172.24.4.0/24 | +--------------------------------------+-----------+--------------------------------------+---------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the current
segment_idof the subnet has a value ofNone.Example
openstack subnet show my_subnet --c segment_id
$ openstack subnet show my_subnet --c segment_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
+------------+-------+ | Field | Value | +------------+-------+ | segment_id | None | +------------+-------+
+------------+-------+ | Field | Value | +------------+-------+ | segment_id | None | +------------+-------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change the value of the subnet
segment_idto the network segment ID.Here is an example:
openstack subnet set --network-segment 81e5453d-4c9f-43a5-8ddf-feaf3937e8c7 my_subnet
$ openstack subnet set --network-segment 81e5453d-4c9f-43a5-8ddf-feaf3937e8c7 my_subnetCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the subnet is now associated with the desired network segment.
Example
openstack subnet show my_subnet --c segment_id
$ openstack subnet show my_subnet --c segment_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
+------------+--------------------------------------+ | Field | Value | +------------+--------------------------------------+ | segment_id | 81e5453d-4c9f-43a5-8ddf-feaf3937e8c7 | +------------+--------------------------------------+
+------------+--------------------------------------+ | Field | Value | +------------+--------------------------------------+ | segment_id | 81e5453d-4c9f-43a5-8ddf-feaf3937e8c7 | +------------+--------------------------------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow