On Fri, Feb 26, 2021 at 9:00 PM Paul Dyer <pmdyermms@gmail.com> wrote:
>
> I am trying curl with the restapi, following the docs, but I get a syntax error.
>
> # curl --cacert '/etc/pki/ovirt-engine/ctg.crt' --request POST --header 'Version: 4' --header 'Content-Type: application/xml' --header 'Accept: application/xml' --user 'admin@internal:psw' "https://baronne.neworleans.com/ovirt-engine/api/vms/636e3bb8-b025-482c-ba5a-e6c075e5aee8/start"
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <fault>
> <detail>For correct usage, see: https://baronne.neworleans.com/ovirt-engine/apidoc#services/vm/methods/start</detail>
Did you look there?
It explains that you need to post "<action/>". I don't know why this
is needed, but this
is how the API works :-)
Base on other examples, you are missing
--data "<action/>"
> <reason>Request syntactically incorrect.</reason>
> </fault>
>
>
> On Fri, Feb 26, 2021 at 10:15 AM Paul Dyer <pmdyermms@gmail.com> wrote:
>>
>> I am trying to use the command line to stop and start vms in ovirt 4.4. Previously, I used virsh on the standalone engine machine, but that has been removed in this release.
>>
>> On the compute host, I am able to use virsh to list vms, and shutdown vms from that list. The start command gives me this error:
>>
>> virsh # start r7-dante
>> error: failed to get domain 'r7-dante'
oVirt vms are not persisted on the host. They exist in oVirt db, and defined
on the host only when the vm is running.
oVirt API is the right place to control the system.
If you want something that is easier to script and does not require low level
API details, you can use the SDK - here is a related example:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm.py
Nir