3.13. 例:仮想マシンのストレージディスクの作成
以下の例では、サンプル仮想マシンの 8 GB の Copy-On-Write ストレージディスクを作成します。
例3.15 仮想マシンのストレージディスクの作成
要求:
POST /ovirt-engine/api/vms/6efc0cfa-8495-4a96-93e5-ee490328cf48/disks HTTP/1.1
Accept: application/xml
Content-type: application/xml
<disk>
<storage_domains>
<storage_domain id="9ca7cb40-9a2a-4513-acef-dc254af57aac"/>
</storage_domains>
<size>8589934592</size>
<type>system</type>
<interface>virtio</interface>
<format>cow</format>
<bootable>true</bootable>
</disk>
curl コマンド:
# curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" \
-u [USER:PASS] --cacert [CERT] \
-d "<disk><storage_domains> \
<storage_domain id='9ca7cb40-9a2a-4513-acef-dc254af57aac'/> \
</storage_domains><size>8589934592</size><type>system</type> \
<interface>virtio</interface><format>cow</format> \
<bootable>true</bootable></disk>" \
https://[RHEVM Host]:443/ovirt-engine/api/vms/6efc0cfa-8495-4a96-93e5-ee490328cf48/disks
storage_domain 要素は、ディスクを data1 ストレージドメインに保存するように API に指示します。