Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

7.151. NetworkAttachment 구조

호스트가 네트워크에 연결하는 방법을 설명합니다.

호스트의 네트워크 연결의 XML 표현입니다.

<network_attachment href="/ovirt-engine/api/hosts/123/nics/456/networkattachments/789" id="789">
  <network href="/ovirt-engine/api/networks/234" id="234"/>
  <host_nic href="/ovirt-engine/api/hosts/123/nics/123" id="123"/>
  <in_sync>true</in_sync>
  <ip_address_assignments>
    <ip_address_assignment>
      <assignment_method>static</assignment_method>
      <ip>
        <address>192.168.122.39</address>
        <gateway>192.168.122.1</gateway>
        <netmask>255.255.255.0</netmask>
        <version>v4</version>
      </ip>
    </ip_address_assignment>
  </ip_address_assignments>
  <reported_configurations>
    <reported_configuration>
      <name>mtu</name>
      <expected_value>1500</expected_value>
      <actual_value>1500</actual_value>
      <in_sync>true</in_sync>
    </reported_configuration>
    <reported_configuration>
      <name>bridged</name>
      <expected_value>true</expected_value>
      <actual_value>true</actual_value>
      <in_sync>true</in_sync>
    </reported_configuration>
    ...
  </reported_configurations>
</network_attachment>

NIC(네트워크 인터페이스 카드)에 네트워크를 연결하려면 이름 또는 id 가 있는 네트워크 요소가 필요합니다.

예를 들어, 네트워크를 호스트 네트워크 인터페이스 카드에 연결하려면 다음과 같은 요청을 보냅니다.

POST /ovirt-engine/api/hosts/123/nics/456/networkattachments

다음과 같은 요청 본문이 있습니다.

<networkattachment>
  <network id="234"/>
</networkattachment>

호스트에 네트워크를 연결하려면 다음과 같은 요청을 보냅니다.

POST /ovirt-engine/api/hosts/123/networkattachments

다음과 같은 요청 본문이 있습니다.

<network_attachment>
  <network id="234"/>
  <host_nic id="456"/>
</network_attachment>

ip_address_assignmentsproperties 요소는 updatable post-creation입니다.

예를 들어 네트워크 연결을 업데이트하려면 다음과 같은 요청을 보냅니다.

PUT /ovirt-engine/api/hosts/123/nics/456/networkattachments/789

다음과 같은 요청 본문이 있습니다.

<network_attachment>
  <ip_address_assignments>
    <ip_address_assignment>
      <assignment_method>static</assignment_method>
      <ip>
        <address>7.1.1.1</address>
        <gateway>7.1.1.2</gateway>
        <netmask>255.255.255.0</netmask>
        <version>v4</version>
      </ip>
    </ip_address_assignment>
  </ip_address_assignments>
</network_attachment>

네트워크 인터페이스 카드에서 네트워크를 분리하려면 다음과 같은 요청을 보냅니다.

DELETE /ovirt-engine/api/hosts/123/nics/456/networkattachments/789
중요

네트워크 연결 구성 변경 사항을 명시적으로 커밋해야 합니다.

네트워크 연결의 속성 하위 수집의 XML 표현:

<network_attachment>
  <properties>
    <property>
      <name>bridge_opts</name>
      <value>
        forward_delay=1500 group_fwd_mask=0x0 multicast_snooping=1
      </value>
    </property>
  </properties>
  ...
</network_attachment>

표 7.199. 속성 요약

이름유형요약

주석

문자열

이 오브젝트에 대한 설명이 포함된 무료 텍스트입니다.

description

문자열

사람이 읽을 수 있는 설명은 일반 텍스트로 표시됩니다.

dns_resolver_configuration

DnsResolverConfiguration

GET을 사용하여 네트워크 연결을 검색할 때 DNS 확인자 구성이 보고됩니다.

id

문자열

고유 식별자입니다.

in_sync

부울

 

ip_address_assignments

IpAddressAssignment[]

네트워크의 IP 구성입니다.

name

문자열

사람이 읽을 수 있는 이름은 일반 텍스트로 표시됩니다.

속성

property[]

네트워크 구성에 대한 사용자 정의 속성을 정의합니다.

reported_configurations

ReportedConfiguration[]

구성 속성의 읽기 전용 목록입니다.

7.151.1. dns_resolver_configuration

GET을 사용하여 네트워크 연결을 검색할 때 DNS 확인자 구성이 보고됩니다. 새 네트워크 연결을 생성하거나 기존 네트워크 연결을 업데이트할 때 선택 사항입니다.