15.3. Methods
15.3.1. Creating a Virtual Machine
Creation of a new virtual machine requires the
name, template and cluster elements. Identify the template and cluster elements with the id attribute or name element.
Example 15.2. Creating a virtual machine with 512 MB and boots from the virtual hard disk
POST /api/vms HTTP/1.1
Accept: application/xml
Content-type: application/xml
<vm>
<name>vm2</name>
<description>Virtual Machine 2</description>
<type>desktop</type>
<memory>536870912</memory>
<cluster>
<name>default</name>
</cluster>
<template>
<name>Blank</name>
</template>
<os>
<boot dev="hd"/>
</os>
</vm>
Note
Memory in the previous example is converted to bytes using the following formula:
512MB * 1024 2 = 536870912 bytes