#!/bin/sh -ex
url="https://engine.example.com/ovirt-engine/api"
user="admin@internal"
password="..."
curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--request POST \
--header "Version: 4" \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<vm>
<name>myvm</name>
<template>
<name>Blank</name>
</template>
<cluster>
<name>mycluster</name>
</cluster>
</vm>
' \
"${url}/vms"
#!/bin/sh -ex
url = "https://engine.example.com/ovirt-engine/api"
user = "admin@internal"
password = "..."
curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user} :${password} " \
--request POST \
--header "Version: 4" \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<vm>
<name>myvm</name>
<template>
<name>Blank</name>
</template>
<cluster>
<name>mycluster</name>
</cluster>
</vm>
' \
"${url} /vms"
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
#!/bin/sh -ex
url="https://engine.example.com/ovirt-engine/api"
user="admin@internal"
password="..."
curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--request POST \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<vm>
<name>myvm</name>
<snapshots>
<snapshot id="266742a5-6a65-483c-816d-d2ce49746680"/>
</snapshots>
<cluster>
<name>mycluster</name>
</cluster>
</vm>
' \
"${url}/vms"
#!/bin/sh -ex
url = "https://engine.example.com/ovirt-engine/api"
user = "admin@internal"
password = "..."
curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user} :${password} " \
--request POST \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<vm>
<name>myvm</name>
<snapshots>
<snapshot id="266742a5-6a65-483c-816d-d2ce49746680"/>
</snapshots>
<cluster>
<name>mycluster</name>
</cluster>
</vm>
' \
"${url} /vms"
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
템플릿 또는 스냅샷에서 가상 머신을 생성할 때 일반적으로 가상 시스템의 디스크를 생성할 스토리지 도메인을 명시적으로 표시하는 것이 유용합니다. 가상 머신이 템플릿에서 생성되면 매핑을 나타내는 disk_attachment
요소 집합이 전달됩니다.
<vm>
...
<disk_attachments>
<disk_attachment>
<disk id="8d4bd566-6c86-4592-a4a7-912dbf93c298">
<storage_domains>
<storage_domain id="9cb6cb0a-cf1d-41c2-92ca-5a6d665649c9"/>
</storage_domains>
</disk>
<disk_attachment>
</disk_attachments>
</vm>
<vm>
...
<disk_attachments>
<disk_attachment>
<disk id="8d4bd566-6c86-4592-a4a7-912dbf93c298">
<storage_domains>
<storage_domain id="9cb6cb0a-cf1d-41c2-92ca-5a6d665649c9"/>
</storage_domains>
</disk>
<disk_attachment>
</disk_attachments>
</vm>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<vm>
...
<disk_attachments>
<disk_attachment>
<disk>
<image_id>8d4bd566-6c86-4592-a4a7-912dbf93c298</image_id>
<storage_domains>
<storage_domain id="9cb6cb0a-cf1d-41c2-92ca-5a6d665649c9"/>
</storage_domains>
</disk>
<disk_attachment>
</disk_attachments>
</vm>
<vm>
...
<disk_attachments>
<disk_attachment>
<disk>
<image_id>8d4bd566-6c86-4592-a4a7-912dbf93c298</image_id>
<storage_domains>
<storage_domain id="9cb6cb0a-cf1d-41c2-92ca-5a6d665649c9"/>
</storage_domains>
</disk>
<disk_attachment>
</disk_attachments>
</vm>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<vm>
<name>myvm</name>
<description>My Desktop Virtual Machine</description>
<type>desktop</type>
<memory>2147483648</memory>
...
</vm>
<vm>
<name>myvm</name>
<description>My Desktop Virtual Machine</description>
<type>desktop</type>
<memory>2147483648</memory>
...
</vm>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<vm>
...
<os>
<boot dev="cdrom"/>
</os>
</vm>
<vm>
...
<os>
<boot dev="cdrom"/>
</os>
</vm>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<vm>
...
<os>
<boot>
<devices>
<device>cdrom</device>
</devices>
</boot>
</os>
</vm>
<vm>
...
<os>
<boot>
<devices>
<device>cdrom</device>
</devices>
</boot>
</os>
</vm>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow