Product SiteDocumentation Site

14.6.  Actions

The following sections describe the actions associated with vm resources.
The API contains a number of possible actions for virtual machines: start, stop, shutdown, suspend, detach, migrate, export, import, move and ticket.

14.6.1.  Start Action

The start action launches a virtual machine.
Example 14.9. Action to start a virtual machine
POST /rhevm-api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/start HTTP/1.1
Content-type: application/xml

<action/>

The start action allows a vm element to be provided as a parameter. If a vm element is provided, boot-specific properties of the VM will be overridden at start time, using the values from the provided element. The properties will only be overriden for this boot of the virtual machine, and will not be persisted for the next boot.
Example 14.10. Action to start a virtual machine with overridden parameters
POST /rhevm-api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/start HTTP/1.1
Content-type: application/xml

<action>
    <pause>true</pause>
    <vm>
        <host id="02447ac6-bcba-448d-ba2b-f0f453544ed2"/>
        <stateless>true</stateless>
        <display>
            <type>spice</type>
        </display>
        <os>
            <boot dev="cdrom"/>
        </os>
        <cdroms>
            <cdrom>
                <file id="foo.iso"/>
            </cdrom>
        </cdroms>
        <floppies>
            <floppy>
                <file id="bar.vfd"/>
            </floppy>
        </floppies>
    </vm>
</action>