17.2. 创建路由器类型

您可以创建路由器类型,用于在 Red Hat OpenStack Platform (RHOSP) ML2/OVN 部署中创建自定义虚拟路由器。

先决条件

  • 您已启用了路由器类型功能。

流程

  1. 为路由器类别创建服务配置文件:

       $ openstack network flavor profile create             \
         --description "User defined router flavor profile" \
         --enable  \
         --driver   \
         neutron.services.ovn_l3.service_providers.user_defined.Userdefined_1

    --driver 参数值中的路径是您在前面的流程中创建的一个。

    输出示例

    +-------------+----------------------------------------------------------------------+
    | Field       | Value                                                                |
    +-------------+----------------------------------------------------------------------+
    | description | User defined router flavor profile                                   |
    | driver      | neutron.services.ovn_l3.service_providers.user_defined.Userdefined_1 |
    | enabled     | True                                                                 |
    | id          | a717c92c-63f7-47e8-9efb-6ad0d61c4875                                 |
    | meta_info   |                                                                      |
    | project_id  | None                                                                 |
    +-------------+----------------------------------------------------------------------+

  2. 创建路由器类型:

       $ openstack network flavor create \
          --service-type L3_ROUTER_NAT     \
          --description "User defined flavor for routers in the L3 OVN plugin" \
          user-defined_router-flavor

    输出示例

       +---------------------+------------------------------------------------------+
       | Field               | Value                                                |
       +---------------------+------------------------------------------------------+
       | description         | User defined flavor for routers in the L3 OVN plugin |
       | enabled             | True                                                 |
       | id                  | e47c1c5c-629b-4c48-b49a-78abe6ac7696                 |
       | name                | user-defined-router-flavor                           |
       | service_profile_ids | []                                                   |
       | service_type        | L3_ROUTER_NAT                                        |
       +---------------------+------------------------------------------------------+

  3. 将服务配置集添加到 router 类别中,如下例所示:

       $ openstack network flavor add profile user-defined-router-flavor     \
         a717c92c-63f7-47e8-9efb-6ad0d61c4875