14.3. 新しいロールの NIC テンプレートの作成

Red Hat OpenStack Platform (RHOSP) 16.2 では、トリプル NIC テンプレートにデフォルトで InterfaceRoutes パラメーターが含まれています。通常は、Networking サービス (neutron) ネットワークの host_routes プロパティーで、environments/network-environment.yaml 設定ファイルでレンダリングした routes パラメーターを設定します。次に、それを InterfaceRoutes パラメーターに追加します。

director Operator には Networking サービス (neutron) が存在しません。新しいロールの新しい NIC テンプレートを作成するには、特定のネットワークのルートを NIC テンプレートに追加し、リストを連結する必要があります。

14.3.1. デフォルトのネットワークルートの作成

ネットワークルートを NIC テンプレートに追加してデフォルトのネットワークルートを作成し、リストを連結します。

手順

  1. NIC テンプレートを開きます。
  2. テンプレートにネットワークルートを追加し、リストを連結します。

    parameters:
      ...
      {{ $net.Name }}Routes:
        default: []
        description: >
          Routes for the storage network traffic.
          JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
          Unless the default is changed, the parameter is automatically resolved
          from the subnet host_routes attribute.
        type: json
      ...
                  - type: interface
                    ...
                    routes:
                      list_concat_unique:
                        - get_param: {{ $net.Name }}Routes
                        - get_param: {{ $net.Name }}InterfaceRoutes

14.3.2. サブネットルート

Routes サブネット情報は、Ansible Playbook で使用される tripleo 環境ファイル environment/network-environment.yaml に自動レンダリングされます。NIC テンプレートでは、Routes_<subnet_name> パラメーターを使用して、ホストに正しいルーティングを設定します (例: StorageRoutes_storage_leaf1)。

14.3.3. スパインリーフネットワーキング用の NIC テンプレートの変更

スパインリーフネットワークを設定するには、ロールごとに NIC テンプレートを変更し、ConfigMap を再作成します。

前提条件

  • OpenShift Container Platform クラスターが稼働しており、director Operator が正しくインストールされています。
  • ワークステーションに oc コマンドラインツールをインストールしました。

手順

  1. 各コンピュートロールの NIC テンプレートを作成します。

    ...
      StorageRoutes_storage_leaf1:
        default: []
        description: >
          Routes for the storage network traffic.
          JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
          Unless the default is changed, the parameter is automatically resolved
          from the subnet host_routes attribute.
        type: json
    ...
      InternalApiRoutes_internal_api_leaf1:
        default: []
        description: >
          Routes for the internal_api network traffic.
          JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
          Unless the default is changed, the parameter is automatically resolved
          from the subnet host_routes attribute.
        type: json
    ...
      TenantRoutes_tenant_leaf1:
        default: []
        description: >
          Routes for the internal_api network traffic.
          JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
          Unless the default is changed, the parameter is automatically resolved
          from the subnet host_routes attribute.
        type: json
    ...
                           get_param: StorageIpSubnet
                       routes:
                         list_concat_unique:
                          - get_param: StorageRoutes_storage_leaf1
                     - type: vlan
    ...
                           get_param: InternalApiIpSubnet
                       routes:
                         list_concat_unique:
                          - get_param: InternalApiRoutes_internal_api_leaf1
    ...
                           get_param: TenantIpSubnet
                       routes:
                         list_concat_unique:
                          - get_param: TenantRoutes_tenant_leaf1
                   - type: ovs_bridge
    ...
  2. ~/custom_environment_files ディレクトリーで、テンプレートを tarball にアーカイブします。

    $ tar -cvzf custom-config.tar.gz *.yaml
  3. tripleo-tarball-config ConfigMap を作成します。

    $ oc create configmap tripleo-tarball-config --from-file=custom-config.tar.gz -n openstack

14.3.4. NIC テンプレートを登録するための環境ファイルの作成または更新

環境ファイルを作成または更新するには、新しいノードの NIC テンプレートをリソースレジストリーに追加し、ConfigMap を再作成します。

前提条件

  • OpenShift Container Platform クラスターが稼働しており、director Operator が正しくインストールされています。
  • ワークステーションに oc コマンドラインツールをインストールしました。
  • tripleo-tarball-config ConfigMap が、ロールに必要な roles_data.yaml と NIC テンプレートで更新されました。

手順

  1. 新しいノードの NIC テンプレートを、環境ファイルの resource_registry セクションに追加します。

    resource_registry:
      OS::TripleO::Compute::Net::SoftwareConfig: net-config-two-nic-vlan-compute.yaml
      OS::TripleO::ComputeLeaf1::Net::SoftwareConfig: net-config-two-nic-vlan-compute_leaf1.yaml
      OS::TripleO::ComputeLeaf2::Net::SoftwareConfig: net-config-two-nic-vlan-compute_leaf2.yaml
  2. ~/custom_environment_files ディレクトリーで、テンプレートを tarball にアーカイブします。

    $ tar -cvzf custom-config.tar.gz *.yaml
  3. tripleo-tarball-config ConfigMap を作成します。

    $ oc create configmap tripleo-tarball-config --from-file=custom-config.tar.gz -n openstack