Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 17. Creating custom virtual routers with router flavors
The content in this section is available in this release as a Technology Preview, and therefore is not fully supported by Red Hat. It should only be used for testing, and should not be deployed in a production environment. For more information, see Technology Preview.
You can use router flavors to deploy custom virtual routers in your Red Hat OpenStack Platform (RHOSP) ML2/OVN environments. After the RHOSP administrator enables the router flavor feature and creates the router flavor, users can create custom routers by using the router flavor.
Within a RHOSP deployment you can combine virtual custom routers that are based on router flavors with routers of the default OVN type.
Using router flavors does not affect the operation of the default OVN router. When router flavors are used, the default OVN router is treated as the default router flavor, with no impact on its configuration or operation.
To set up router flavors and create custom routers, perform the following general steps:
The administrator loads the necessary RHOSP Networking service (neutron) plug-in and specifies the service provider.
See Section 17.1, “Enabling router flavors and creating service providers”.
The administrator creates the router flavor.
The user creates a custom router by using one of the router flavors.
17.1. Enabling router flavors and creating service providers Link kopierenLink in die Zwischenablage kopiert!
Before a Red Hat OpenStack Platform (RHOSP) administrator can create a router flavor, the administrator must first load the necessary RHOSP Networking service (neutron) plug-in and specify the service provider.
The administrator must deploy the service provider code in a module in the Networking service directories. Red Hat recommends the neutron.services.ovn_l3.service_providers.user_defined module.
You can find a sample service provider named UserDefined in the neutron.services.ovn_l3.service_providers.user_defined module.
The following procedure involves direct editing of .conf files on the Controller nodes. Red Hat is developing heat template methods and OpenStack commands to replace this direct editing method.
Prerequisites
- Your Networking service mechanism driver must be ML2/OVN.
- You have a router flavor service provider created for your deployment.
- You have access to the RHOSP Controller nodes and permission to update configuration files.
Procedure
-
On one of the Controller nodes, open the file,
/var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf. In the
service_pluginslist, changeovn-routerstoovn-router-flavors-ha:[DEFAULT] service_plugins = qos,ovn-router-flavors-ha,trunk,segments,port_forwarding,log
[DEFAULT] service_plugins = qos,ovn-router-flavors-ha,trunk,segments,port_forwarding,logCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
service_providerssection and add a service provider definition for each router flavor that you plan to use.- Example
In this example, a service provider,
user_defined_1, is added:... [service_providers] service_provider = L3_ROUTER_NAT:user_defined_1:neutron.services.ovn_l3.service_providers.user_defined.UserDefined1
... [service_providers] service_provider = L3_ROUTER_NAT:user_defined_1:neutron.services.ovn_l3.service_providers.user_defined.UserDefined1Copy to Clipboard Copied! Toggle word wrap Toggle overflow A router flavor service provider definition has the following elements:
- Service provider constant
- L3_ROUTER_NAT
- Name
Name of the service provider, which is a descriptive string between two colon characters.
For example,
:user_defined_1:. The name must be unique within the environment.- Path
-
Red Hat recommends using this path:
neutron.services.ovn_l3.service_providers.user_defined - Class
A python class name for the service provider.
Each provider has its own class. For example,
UserDefined1.NoteRetain this class name and its path. You need it later when you create the router flavor.
Restart the Networking service (neutron):
sudo podman restart neutron_api
$ sudo podman restart neutron_apiCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Perform steps 1 - 4 on the remaining RHOSP Controller nodes.
Verification
Verify that the Networking service has loaded your user defined service provider:
openstack network service provider list
$ openstack network service provider listCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the procedure was successful the new service appears in the list.
- Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
17.2. Creating a router flavor Link kopierenLink in die Zwischenablage kopiert!
The Red Hat OpenStack Platform (RHOSP) administrator can create router flavors that users must specify when they create custom virtual routers in their RHOSP ML2/OVN environment. After the administrator has loaded the Networking service (neutron) ovn-router-flavors-ha plug-in and specified the service provider, the remaining steps for creating a router flavor are:
- Create a service profile for the router flavor.
- Create the router flavor.
- Add the service profile to the router flavor.
Prerequisites
- Your Networking service mechanism driver must be ML2/OVN.
-
You must be a RHOSP user with the
adminrole. -
The Networking service has the
ovn-router-flavors-haplug-in loaded. The router flavor service provider has been created and you know the name and path of its class.
For more information, see Section 17.1, “Enabling router flavors and creating service providers”.
Procedure
-
Source your overcloud credentials file that assigns you the
adminrole. Using the service provider class and its path, create a service profile for the router flavor.
Retain the profile ID, as you need it in a later step.
- Example
In this example, the driver class name is
UserDefined1, and its path is,neutron.services.ovn_l3.service_providers.user_defined:openstack network flavor profile create \ --description "User-defined router flavor profile" \ --enable --driver \ neutron.services.ovn_l3.service_providers.user_defined.UserDefined1
$ openstack network flavor profile create \ --description "User-defined router flavor profile" \ --enable --driver \ neutron.services.ovn_l3.service_providers.user_defined.UserDefined1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create the router flavor:
openstack network flavor create \ --service-type L3_ROUTER_NAT \ --description "User-defined flavor for routers" \ user-defined-router-flavor
$ openstack network flavor create \ --service-type L3_ROUTER_NAT \ --description "User-defined flavor for routers" \ user-defined-router-flavorCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add the service profile to the router flavor, using the profile ID from an earlier step.
- Example
openstack network flavor add profile user-defined-router-flavor \ a717c92c-63f7-47e8-9efb-6ad0d61c4875
$ openstack network flavor add profile user-defined-router-flavor \ a717c92c-63f7-47e8-9efb-6ad0d61c4875Copy to Clipboard Copied! Toggle word wrap Toggle overflow
17.3. Creating a custom virtual router Link kopierenLink in die Zwischenablage kopiert!
You can create a custom virtual router in your Red Hat OpenStack Platform (RHOSP) environment by using a router flavor provided by your RHOSP administrator.
Prerequisites
- The RHOSP administrator has created a router flavor.
- Your Networking service (neutron) mechanism driver must be ML2/OVN.
Procedure
- Source your credentials file.
Get the ID for the router flavor to use to create your custom router:
openstack network flavor list -c ID -c Name
$ openstack network flavor list -c ID -c NameCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
+--------------------------------------+-------------------------------+ | ID | Name | +--------------------------------------+-------------------------------+ | 4b37f895-e78e-49df-a96b-1916550f9116 | user-defined-router-flavor | +--------------------------------------+-------------------------------+
+--------------------------------------+-------------------------------+ | ID | Name | +--------------------------------------+-------------------------------+ | 4b37f895-e78e-49df-a96b-1916550f9116 | user-defined-router-flavor | +--------------------------------------+-------------------------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Using the router flavor ID, create a custom router:
- Example
In this example, a custom router,
user-defined-routeris created using the flavor ID foruser-defined-router-flavor:openstack router create \ --flavor-id 4b37f895-e78e-49df-a96b-1916550f9116 user-defined-router
$ openstack router create \ --flavor-id 4b37f895-e78e-49df-a96b-1916550f9116 user-defined-routerCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you do not use the
--flavor-idargument, theopenstack router createcommand creates a default OVN router.
List your deployment’s routers to verify the router creation:
openstack router list -c ID -c Name -c Status -c HA
$ openstack router list -c ID -c Name -c Status -c HACopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow