Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

4.7. 예: NFS ISO 스토리지 생성

NFS ISO 스토리지 도메인은 데이터 센터에 연결된 마운트된 NFS 공유이며 DVD/CD-ROM ISO 및 VFD(가상 유동 디스크) 이미지 파일용 스토리지를 제공합니다. 새 스토리지 도메인을 생성하려면 스토리지 도메인 표현이 포함된 POST 요청이 필요하며 스토리지 도메인 컬렉션의 URL로 전송됩니다.

요청은 다음과 같아야 합니다.

POST /ovirt-engine/api/storagedomains HTTP/1.1
Accept: application/xml
Content-type: application/xml

요청 본문이 다음과 같아야 합니다.

<storage_domain>
  <name>myisos</name>
  <description>My ISOs</description>
  <type>iso</type>
  <storage>
    <type>nfs</type>
    <address>mynfs.example.com</address>
    <path>/exports/myisos</path>
  </storage>
  <host>
    <name>myhost</name>
  </host>
</storage_domain>

curl 명령을 사용하여 동일한 요청입니다.

# curl \
--cacert '/etc/pki/ovirt-engine/ca.pem' \
--user 'admin@internal:mypassword' \
--request POST \
--header 'Version: 4' \
--header 'Content-Type: application/xml' \
--header 'Accept: application/xml' \
--data '
<storage_domain>
  <name>myisos</name>
  <description>My ISOs</description>
  <type>iso</type>
  <storage>
    <type>nfs</type>
    <address>mynfs.example.com</address>
    <path>/exports/myisos</path>
  </storage>
  <host>
    <name>myhost</name>
  </host>
</storage_domain>
' \
https://myengine.example.com/ovirt-engine/api/storagedomains

서버는 host myhost 를 사용하여 mynfs.example.com:/exports/ myisos 의 내보내기 경로가 있는 myisos라는 NFS ISO 스토리지 도메인을 생성합니다. API는 새로 생성된 스토리지 도메인 리소스( StorageDomain유형)의 다음 표현도 반환합니다.

<storage_domain href="/ovirt-engine/api/storagedomains/006" id="006">
  <name>myiso</name>
  <description>My ISOs</description>
  <available>42949672960</available>
  <committed>0</committed>
  <master>false</master>
  <status>unattached</status>
  <storage>
    <address>mynfs.example.com</address>
    <path>/exports/myisos</path>
    <type>nfs</type>
  </storage>
  <storage_format>v1</storage_format>
  <type>iso</type>
  <used>9663676416</used>
</storage_domain>