Chapter 15. Virtual Machine Pools

The vmpools collection provides information about the virtual machine pools in a Red Hat Enterprise Virtualization environment. An API user accesses this information through the rel="vmpools" link obtained from the entry point URI (see Chapter 4, Entry Point).
The following table shows specific elements contained in a virtual machine pool resource representation.

Note

The icons used in the properties column of this table are described in Table 7.1, “Element property icons”

Table 15.1. Virtual machine pool elements

Element Type Description Properties
size integer The number of virtual machines in the pool.
cluster id= GUID A reference to the cluster resource which virtual machines in this pool run.
template id= GUID A reference to the template resource which virtual machines in this pool are based.

Example 15.1. An XML representation of a virtual machine pool

<vmpool id="2d2d5e26-1b6e-11e1-8cda-001320f76e8e"
  href="/api/vmpools/2d2d5e26-1b6e-11e1-8cda-001320f76e8e">
    <name>VMPool1</name>
    <description>Virtual Machine Pool 1</description>
    <size>2</size>
    <cluster id="99408929-82cf-4dc7-a532-9d998063fa95"
      href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95"/>
    <template id="00000000-0000-0000-0000-000000000000"
      href="/api/templates/00000000-0000-0000-0000-000000000000"/>
</vmpool>

A new pool requires the name, cluster and template elements. Identify the cluster and template with the id attribute or name element. See Section 7.2.4, “ Creating a Resource in a Collection ” for more information.

Example 15.2. Creating a virtual machine pool

POST /api/vmpools HTTP/1.1
Accept: application/xml
Content-type: application/xml

<vmpool>
    <name>VM Pool A</name>
    <cluster id="99408929-82cf-4dc7-a532-9d998063fa95"
      href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95"/>
    <template id="00000000-0000-0000-0000-000000000000"
      href="/api/templates/00000000-0000-0000-0000-000000000000"/>
</vmpool>

The name, description and size are updatable post-creation. See Section 7.3.2, “ Updating a Resource ” for more information.

Example 15.3. Updating a virtual machine pool

PUT /api/vmpools/2d2d5e26-1b6e-11e1-8cda-001320f76e8e HTTP/1.1
Accept: application/xml
Content-type: application/xml

<vmpool>
    <name>VM Pool B</name>
    <description>Virtual Machine Pool B</description>
    <size>3</size>
</vmpool>

Removal of a virtual machine pool requires a DELETE request.

Example 15.4. Removing a virtual machine

DELETE /api/vmpools/2d2d5e26-1b6e-11e1-8cda-001320f76e8e HTTP/1.1

HTTP/1.1 204 No Content

Important

The API as documented in this chapter is experimental and subject to change. It is not covered by the backwards compatibility statement in Section 6, “Backwards Compatibility Statement”.