[ovirt-devel] How can users use oVirtCli to complete "run once"?

Juan Hernández jhernand at redhat.com
Tue Mar 8 09:23:48 UTC 2016


On 03/08/2016 10:14 AM, Sandro Bonazzola wrote:
> 
> 
> On Mon, Feb 29, 2016 at 8:21 AM, zhukaijie <kjzhu14 at is.ac.cn
> <mailto:kjzhu14 at is.ac.cn>> wrote:
> 
>     As you know. In web, users can use "RUN ONCE" button to run a VM
>     with some params (such as certain custom properties). But can
>     oVirtCli be used to complete "RUN ONCE"? Thank you.
> 
> 
> Juan?
> 

In the API the "run once" mode is enabled adding a "vm" element to the
action, something like this:

  POST /vms/{vm:id}/start
  <action>
    <vm>
      ...
    </vm>
  </action>

Unfortunately the CLI doesn't have any mechanism to say that you want to
send an empty element. To do it you will need to pass some option that
forces the inclusion of that "vm" element. If you don't want to actually
change anything in the VM then you can just pass the name, which will be
ignored:

  action vm myvm start --vm-name myvm

If you want to do something more complicated, like passing other boot
options, or using cloud-init or sysprep, I'd suggest you consider using
one of the SDKs instead of the CLI.

>  
> 
>     _______________________________________________
>     Devel mailing list
>     Devel at ovirt.org <mailto:Devel at ovirt.org>
>     http://lists.ovirt.org/mailman/listinfo/devel
> 
> 
> 
> 
> -- 
> Sandro Bonazzola
> Better technology. Faster innovation. Powered by community collaboration.
> See how it works at redhat.com <http://redhat.com>
> 
> 
> _______________________________________________
> Devel mailing list
> Devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/devel
> 


-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Devel mailing list