What are the components of ovirt api for creating the VM

200 Views Asked by At

I am using the oVirt API (newbie), I am checking into the ovirt documentation,

It has the following as payload,

<vm>
  <name>myvm</name>
  <template>
    <name>Blank</name>
  </template>
  <cluster>
    <name>mycluster</name>
  </cluster>
</vm>

1) What is the difference between template and cluster?

I can understand that template - It is a configuration which we can set and apply for multiple vm's but What is cluster?

2) Is it necessary to use the template and cluster in using createVM rest API in ovirt?

3) Can't we create a vm without specifying the template and cluster?

Thanks,
Harry

1

There are 1 best solutions below

0
On

I will recommend to read through the oVirt documentation, as you miss a lot of information.

There is quite clear explaination of clusters:

https://www.ovirt.org/documentation/admin-guide/chap-Clusters/

And of templates:

https://www.ovirt.org/documentation/vmm-guide/chap-Templates/

Very simply exaplained. Cluster is a set of hosts, which could run virtual machines. Template is predefined configuration for virtual machine with virtual disks, network interfaces and so on. You may have preinstalled operating system, while creating a virtual machine from tempalte for example. There is one hardoded template called 'Blank' which as name suggest is blank and there is no OS preconfigured. You may install any OS to VM created from such template using CD install or PXE for example.

So the answer is:

You must always specify cluster and template while creating a VM. But you may defined hardcoded template 'Blank' while creating a VM, but in order to create VM you must have up and running datacenter with cluster, or the VM will fail to create.