3.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
サーバーは、ホスト 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>