검색

18.8.23. SR-IOV 네트워크에서 실행되는 컴퓨팅 시스템 생성

download PDF

컨트롤 플레인을 가동시킨 후 " 컴퓨팅 머신의 SR-IOV 네트워크 생성"에서 만든 SR-IOV 네트워크에서 실행되는 컴퓨팅 머신을 생성합니다.

사전 요구 사항

  • "플레이북 종속 항목 다운로드"에서 모듈을 다운로드했습니다.
  • "설치 플레이북 다운로드"에서 플레이북을 다운로드했습니다.
  • 설치 프로그램에서 생성된 metadata.yaml 파일이 Ansible 플레이북과 동일한 디렉토리에 있습니다.
  • 컨트롤 플레인이 활성화되었습니다.
  • "컴퓨팅 머신의 SR-IOV 네트워크 생성"에 설명된 대로 radiouplink SR-IOV 네트워크를 생성했습니다.

프로세스

  1. 명령줄에서 작업 디렉토리를 inventory.yamlcommon.yaml 파일의 위치로 변경합니다.
  2. additionalNetworks 매개변수를 사용하여 inventory.yaml 파일의 끝에 radiouplink 네트워크를 추가합니다.

    ....
    # If this value is non-empty, the corresponding floating IP will be
    # attached to the bootstrap machine. This is needed for collecting logs
    # in case of install failure.
        os_bootstrap_fip: '203.0.113.20'
    
        additionalNetworks:
        - id: radio
          count: 4 1
          type: direct
          port_security_enabled: no
        - id: uplink
          count: 4 2
          type: direct
          port_security_enabled: no
    1 2
    count 매개변수는 각 작업자 노드에 연결할 SR-IOV 가상 함수(VF)의 수를 정의합니다. 이 경우 각 네트워크에는 4 개의 VF가 있습니다.
  3. compute-nodes.yaml 파일의 내용을 다음 텍스트로 바꿉니다.

    예 18.1. compute-nodes.yaml

    - import_playbook: common.yaml
    
    - hosts: all
      gather_facts: no
    
      vars:
        worker_list: []
        port_name_list: []
        nic_list: []
    
      tasks:
      # Create the SDN/primary port for each worker node
      - name: 'Create the Compute ports'
        os_port:
          name: "{{ item.1 }}-{{ item.0 }}"
          network: "{{ os_network }}"
          security_groups:
          - "{{ os_sg_worker }}"
          allowed_address_pairs:
          - ip_address: "{{ os_ingressVIP }}"
        with_indexed_items: "{{ [os_port_worker] * os_compute_nodes_number }}"
        register: ports
    
      # Tag each SDN/primary port with cluster name
      - name: 'Set Compute ports tag'
        command:
          cmd: "openstack port set --tag {{ cluster_id_tag }} {{ item.1 }}-{{ item.0 }}"
        with_indexed_items: "{{ [os_port_worker] * os_compute_nodes_number }}"
    
      - name: 'List the Compute Trunks'
        command:
          cmd: "openstack network trunk list"
        when: os_networking_type == "Kuryr"
        register: compute_trunks
    
      - name: 'Create the Compute trunks'
        command:
          cmd: "openstack network trunk create --parent-port {{ item.1.id }} {{ os_compute_trunk_name }}-{{ item.0 }}"
        with_indexed_items: "{{ ports.results }}"
        when:
        - os_networking_type == "Kuryr"
        - "os_compute_trunk_name|string not in compute_trunks.stdout"
    
      - name: ‘Call additional-port processing’
        include_tasks: additional-ports.yaml
    
      # Create additional ports in OpenStack
      - name: ‘Create additionalNetworks ports’
        os_port:
          name:  "{{ item.0 }}-{{ item.1.name }}"
          vnic_type: "{{ item.1.type }}"
          network: "{{ item.1.uuid }}"
          port_security_enabled: "{{ item.1.port_security_enabled|default(omit) }}"
          no_security_groups: "{{ 'true' if item.1.security_groups is not defined else omit }}"
          security_groups: "{{ item.1.security_groups | default(omit) }}"
        with_nested:
          - "{{ worker_list }}"
          - "{{ port_name_list }}"
    
      # Tag the ports with the cluster info
      - name: 'Set additionalNetworks ports tag'
        command:
          cmd: "openstack port set --tag {{ cluster_id_tag }} {{ item.0 }}-{{ item.1.name }}"
        with_nested:
          - "{{ worker_list }}"
          - "{{ port_name_list }}"
    
      # Build the nic list to use for server create
      - name: Build nic list
        set_fact:
          nic_list: "{{ nic_list | default([]) + [ item.name ] }}"
        with_items: "{{ port_name_list }}"
    
      # Create the servers
      - name: 'Create the Compute servers'
        vars:
          worker_nics: "{{ [ item.1 ] | product(nic_list) | map('join','-') | map('regex_replace', '(.*)', 'port-name=\\1') | list }}"
        os_server:
          name: "{{ item.1 }}"
          image: "{{ os_image_rhcos }}"
          flavor: "{{ os_flavor_worker }}"
          auto_ip: no
          userdata: "{{ lookup('file', 'worker.ign') | string }}"
          security_groups: []
          nics:  "{{ [ 'port-name=' + os_port_worker + '-' + item.0|string ] + worker_nics }}"
          config_drive: yes
        with_indexed_items: "{{ worker_list }}"
  4. 로컬 파일 additional-ports.yaml에 다음 내용을 삽입합니다.

    예 18.2. additional-ports.yaml

    # Build a list of worker nodes with indexes
    - name: ‘Build worker list’
      set_fact:
        worker_list: "{{ worker_list | default([]) + [ item.1 + '-' + item.0 | string ] }}"
      with_indexed_items: "{{ [ os_compute_server_name ] * os_compute_nodes_number }}"
    
    # Ensure that each network specified in additionalNetworks exists
    - name: ‘Verify additionalNetworks’
      os_networks_info:
        name: "{{ item.id }}"
      with_items: "{{ additionalNetworks }}"
      register: network_info
    
    # Expand additionalNetworks by the count parameter in each network definition
    - name: ‘Build port and port index list for additionalNetworks’
      set_fact:
        port_list: "{{ port_list | default([]) + [ {
                        'net_name' : item.1.id,
                        'uuid' : network_info.results[item.0].openstack_networks[0].id,
                        'type' : item.1.type|default('normal'),
                        'security_groups' : item.1.security_groups|default(omit),
                        'port_security_enabled' : item.1.port_security_enabled|default(omit)
                        } ] * item.1.count|default(1) }}"
        index_list: "{{ index_list | default([]) + range(item.1.count|default(1)) | list }}"
      with_indexed_items: "{{ additionalNetworks }}"
    
    # Calculate and save the name of the port
    # The format of the name is cluster_name-worker-workerID-networkUUID(partial)-count
    # i.e. fdp-nz995-worker-1-99bcd111-1
    - name: ‘Calculate port name’
      set_fact:
        port_name_list: "{{ port_name_list | default([]) + [ item.1 | combine( {'name' : item.1.uuid | regex_search('([^-]+)') + '-' + index_list[item.0]|string } ) ] }}"
      with_indexed_items: "{{ port_list }}"
      when: port_list is defined
  5. 명령줄에서 compute-nodes.yaml 플레이북을 실행합니다.

    $ ansible-playbook -i inventory.yaml compute-nodes.yaml
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.