13.3. CD-ROMs Sub-Collection

The cdroms sub-collection represents the CD-ROM device on a virtual machine. A cdrom representation contains the following elements:

Table 13.8. Elements for virtual machine CD-ROMs

Element Type Description Properties
file id= string/filename A reference to an ISO image. See Section 11.3, “ Files Sub-Collection ”.

Example 13.11. An XML representation of a CD-ROM device

<cdrom id="00000000-0000-0000-0000-000000000000"
  href="/api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/
  00000000-0000-0000-0000-000000000000">
    <file id="rhel-server-6.0-x86_64-dvd.iso"/>
    <vm id="cdc0b102-fbfe-444a-b9cb-57d2af94f401"
      href="/api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401"/>
</cdrom>

When adding a new CD-ROM, the file id element is required.
The API changes the CD-ROM while the virtual machine is powered-off using a PUT request:

Example 13.12. Changing a CD-ROM file

PUT /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000 HTTP/1.1
Accept: application/xml
Content-type: application/xml
      
<cdrom>
    <file id="fedora-15-x86_64-dvd.iso"/>
</cdrom>

The API changes the CD-ROM during a current session using a PUT request with an additional current URI argument:

Example 13.13. Changing a CD-ROM file during a current session

PUT /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000?current HTTP/1.1
Accept: application/xml
Content-type: application/xml
      
<cdrom>
    <file id="fedora-15-x86_64-dvd.iso"/>
</cdrom>

Note

A virtual machine only contains a single CD-ROM device.