
Hi, I'm just trying to figure out how to use run-once via shell.. [oVirt shell (connected)]# action vm vm_name start --run-once does not work, and there is no help for "action vm start".. Does anybody have an idea on how to use run once via shell and how to pass cloud-init data over it? -- Mit freundlichen Grüßen / Regards Sven Kieske Systemadministrator Mittwald CM Service GmbH & Co. KG Königsberger Straße 6 32339 Espelkamp T: +49-5772-293-100 F: +49-5772-293-333 https://www.mittwald.de Geschäftsführer: Robert Meyer St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen

On 03/24/2014 11:18 AM, Sven Kieske wrote:
If you type "action vm vm_name start" and then hit tab twice it should display the available command line options. In your case you are interested in the "initialization-cloud_init" options: [oVirt shell (connected)]# action vm vm_name start <TAB><TAB> ... vm-initialization-cloud_init-authorized_keys-authorized_key vm-initialization-cloud_init-hostname vm-initialization-cloud_init-network-dns-search_domains-host vm-initialization-cloud_init-network-dns-servers-host vm-initialization-cloud_init-network-nics-nic vm-initialization-cloud_init-payload_files-payload_file vm-initialization-cloud_init-regenerate_ssh_keys vm-initialization-cloud_init-timezone vm-initialization-cloud_init-users-user ... You should then be able to use these options as follows: [oVirt shell (connected)]# action vm vm_name start --vm-initialization-cloud_init-hostname your_host_name However, I think there is a bug in this particular option, the hostname, that will prevent using it. The name should be "host", not "hostname". As this is probably the first thing you will need the net result is that you won't be able to use it currently. I'm investigating it and will let you know if there is a workaround. -- 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.

Hi, with the 3.3 shell I just got the following tab options: [oVirt shell (connected)]# action vm test start async pause vm-domain-user-password vm-os-cmdline vm-placement_policy-affinity vm-stateless correlation_id vm-display-type vm-domain-user-username vm-os-initRd vm-placement_policy-host-id grace_period-expiry vm-domain-name vm-os-boot vm-os-kernel vm-placement_policy-host-name can I use newer cli versions with older engines? it's a 3.3.3-2 engine Am 24.03.2014 14:56, schrieb Juan Hernandez:
-- Mit freundlichen Grüßen / Regards Sven Kieske Systemadministrator Mittwald CM Service GmbH & Co. KG Königsberger Straße 6 32339 Espelkamp T: +49-5772-293-100 F: +49-5772-293-333 https://www.mittwald.de Geschäftsführer: Robert Meyer St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen

On 03/24/2014 03:15 PM, Sven Kieske wrote:
In general you can use a newer version of the SDKs and CLI with an older engine, as the RESTAPI is backwards compatible. However, some options of the newer SDKs and CLI won't work, as the support in the engine side won't exist. In this particular case you probably have an old version of the Python SDK (the CLI sits on top of the Python SDK). To have the cloud-init support you need at least version 3.3.3.0 of the ovirt-engine-sdk-python package (better to use the latest, 3.3.3.1). In addition, as I mentioned before, there is a bug around the "hostname" attribute, it should have been "host-address". Auto-completion will tell you that the option is --vm-initialization-cloud_init-hostname, but actually it should be --vm-initialization-cloud_init-host-address. Typing that manually should work. I opened the following bug to track this issue: https://bugzilla.redhat.com/1080033
-- 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.

thanks for pointing me in the right direction! Bonusquestion: Is it possible to use shell variables or to pipe them somehow for script usage? What I found in the wiki seems not to work ( ${VAR} )? -- Mit freundlichen Grüßen / Regards Sven Kieske Systemadministrator Mittwald CM Service GmbH & Co. KG Königsberger Straße 6 32339 Espelkamp T: +49-5772-293-100 F: +49-5772-293-333 https://www.mittwald.de Geschäftsführer: Robert Meyer St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen

On 03/24/2014 05:40 PM, Sven Kieske wrote:
It isn't possible to use shell variables from within ovirt-shell propmpt, but you can pass a command to it: # VAR=myvm # ovirt-shell --execute-command "show vm ${VAR}" Or you can use here documents: # VAR=myvm # ovirt-shell <<. show vm ${VAR} . -- 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.
participants (2)
-
Juan Hernandez
-
Sven Kieske