
Hi, I'm trying to find out there a sort of API or ovirt CLI/SDK in order to be able to interact with my ovirt VMS and associated resources. In my architecture, I have an Ovirt virtualization host, with a self-hosted engine VM to manage VMs. From the host I have the virsh command to list VMs status, but this doesn't really let me get into VMs management actions like : create, delete, get, reboot, get VMs wide informations (IPs, name, disks.....) So each time I have to login to the hosted engine web admin page to explore VM, but I'd really like to play with my Ovirt resources from my command line or programatically. The ovirt API documentation I've found is really poor, I don't know if someone here has already got the same need and had a good solution. Thanks for your help. Regards, Eugène NG -- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au* * chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*

On Thu, Feb 27, 2020 at 11:45 AM Eugène Ngontang <sympavali@gmail.com> wrote:
Hi,
I'm trying to find out there a sort of API or ovirt CLI/SDK in order to be able to interact with my ovirt VMS and associated resources.
In my architecture, I have an Ovirt virtualization host, with a self-hosted engine VM to manage VMs.
From the host I have the virsh command to list VMs status, but this doesn't really let me get into VMs management actions like : create, delete, get, reboot, get VMs wide informations (IPs, name, disks.....) So each time I have to login to the hosted engine web admin page to explore VM, but I'd really like to play with my Ovirt resources from my command line or programatically.
The ovirt API documentation I've found is really poor, I don't know if someone here has already got the same need and had a good solution.
Did you try one of the SDKs? Also the ansible modules are useful for many cases. Good luck and best regards, -- Didi

Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that. But I'll find a solution. Le jeu. 27 févr. 2020 à 10:47, Yedidyah Bar David <didi@redhat.com> a écrit :
On Thu, Feb 27, 2020 at 11:45 AM Eugène Ngontang <sympavali@gmail.com> wrote:
Hi,
I'm trying to find out there a sort of API or ovirt CLI/SDK in order to
be able to interact with my ovirt VMS and associated resources.
In my architecture, I have an Ovirt virtualization host, with a
self-hosted engine VM to manage VMs.
From the host I have the virsh command to list VMs status, but this
doesn't really let me get into VMs management actions like : create, delete, get, reboot, get VMs wide informations (IPs, name, disks.....)
So each time I have to login to the hosted engine web admin page to explore VM, but I'd really like to play with my Ovirt resources from my command line or programatically.
The ovirt API documentation I've found is really poor, I don't know if someone here has already got the same need and had a good solution.
Did you try one of the SDKs?
Also the ansible modules are useful for many cases.
Good luck and best regards, -- Didi
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au* * chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*

On Thu, Feb 27, 2020 at 11:53 AM Eugène Ngontang <sympavali@gmail.com> wrote:
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that.
This is up to you, of course. For a project that uses heavily the ansible modules, see ovirt-ansible-hosted-engine-setup. For one that uses the python SDK, see ovirt-system-tests. The SDK itself also has a very useful collection of examples.
But I'll find a solution.
Good luck and best regards, -- Didi

Le 27/02/2020 à 11:00, Yedidyah Bar David a écrit :
On Thu, Feb 27, 2020 at 11:53 AM Eugène Ngontang <sympavali@gmail.com> wrote:
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that.
Why not? You're the next devops :) I was used to use ovirt-shell (removed from 4.4), and instead of it I control now all my vms with ansible playbooks: * consultation with ovirt-*_inf with appropriate filters (combine , dict2items) and conditions (when, until) * interaction with other modules (with present/absent statement for all parameters) I precise I am not a developer but once I took the habit with a proper environment (venv, IDE, loops, structured playbook and roles, dict struct, etc..), I was able do what I want, or rather what the API let me do. Before begining, I should advice you to take the time to study the structure of the output of the registered variable Here is a piece of my commonly used playbooks to check status of wanted vms: - name: template ovirt pour tester les modules hosts: localhost connection: local tasks: - block: - include: ovirt_auth.yaml tags: auth,change - name: vmfacts ovirt_vm_info: auth: "{{ ovirt_auth }}" pattern: "name=vm5 or name=vm8" register: vm_info - debug: var=vm_info.ovirt_vms # msg: "{{vm_info.ovirt_vms | map(attribute='status')|list}}" - name: "Génération d'un dictionnaire avec combine" set_fact: vm_status: "{{ vm_status|default({})|combine({item.name: item.status}) }}" loop: "{{vm_info.ovirt_vms}}" when: item.status == "up" - debug: msg: "{{vm_status}}" always: - include: ovirt_auth_revoke.yaml tags: auth,change Good luck!
This is up to you, of course.
For a project that uses heavily the ansible modules, see ovirt-ansible-hosted-engine-setup.
For one that uses the python SDK, see ovirt-system-tests. The SDK itself also has a very useful collection of examples.
But I'll find a solution. Good luck and best regards,
-- Nathanaël Blanchet Supervision réseau SIRE 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr

Echoing what others have said. Ansible is your best option here. On Thu, Feb 27, 2020 at 7:22 AM Nathanaël Blanchet <blanchet@abes.fr> wrote:
Le 27/02/2020 à 11:00, Yedidyah Bar David a écrit :
On Thu, Feb 27, 2020 at 11:53 AM Eugène Ngontang <sympavali@gmail.com> <sympavali@gmail.com> wrote:
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that.
Why not? You're the next devops :)
I was used to use ovirt-shell (removed from 4.4), and instead of it I control now all my vms with ansible playbooks:
- consultation with ovirt-*_inf with appropriate filters (combine , dict2items) and conditions (when, until) - interaction with other modules (with present/absent statement for all parameters)
I precise I am not a developer but once I took the habit with a proper environment (venv, IDE, loops, structured playbook and roles, dict struct, etc..), I was able do what I want, or rather what the API let me do.
Before begining, I should advice you to take the time to study the structure of the output of the registered variable
Here is a piece of my commonly used playbooks to check status of wanted vms: - name: template ovirt pour tester les modules hosts: localhost connection: local tasks: - block: - include: ovirt_auth.yaml tags: auth,change - name: vm facts ovirt_vm_info: auth: "{{ ovirt_auth }}" pattern: "name=vm5 or name=vm8" register: vm_info - debug: var=vm_info.ovirt_vms # msg: "{{vm_info.ovirt_vms | map(attribute='status')|list}}" - name: "Génération d'un dictionnaire avec combine" set_fact: vm_status: "{{ vm_status|default({})|combine({item.name: item.status}) }}" loop: "{{vm_info.ovirt_vms}}" when: item.status == "up" - debug: msg: "{{vm_status}}" always: - include: ovirt_auth_revoke.yaml tags: auth,change
Good luck!
This is up to you, of course.
For a project that uses heavily the ansible modules, see ovirt-ansible-hosted-engine-setup.
For one that uses the python SDK, see ovirt-system-tests. The SDK itself also has a very useful collection of examples.
But I'll find a solution.
Good luck and best regards,
-- Nathanaël Blanchet
Supervision réseau SIRE227 avenue Professeur-Jean-Louis-Viala <https://www.google.com/maps/search/227+avenue+Professeur-Jean-Louis-Viala?entry=gmail&source=g> 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14blanchet@abes.fr
_______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/LDCRW5YXHEMEY7...

Hi gys, Thanks so much for your various feedback. Your ideas are really interesting, I'll lool more in detail into it. Regards, Eugène NG Le jeu. 27 févr. 2020 à 13:56, Jayme <jaymef@gmail.com> a écrit :
Echoing what others have said. Ansible is your best option here.
On Thu, Feb 27, 2020 at 7:22 AM Nathanaël Blanchet <blanchet@abes.fr> wrote:
Le 27/02/2020 à 11:00, Yedidyah Bar David a écrit :
On Thu, Feb 27, 2020 at 11:53 AM Eugène Ngontang <sympavali@gmail.com> <sympavali@gmail.com> wrote:
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that.
Why not? You're the next devops :)
I was used to use ovirt-shell (removed from 4.4), and instead of it I control now all my vms with ansible playbooks:
- consultation with ovirt-*_inf with appropriate filters (combine , dict2items) and conditions (when, until) - interaction with other modules (with present/absent statement for all parameters)
I precise I am not a developer but once I took the habit with a proper environment (venv, IDE, loops, structured playbook and roles, dict struct, etc..), I was able do what I want, or rather what the API let me do.
Before begining, I should advice you to take the time to study the structure of the output of the registered variable
Here is a piece of my commonly used playbooks to check status of wanted vms: - name: template ovirt pour tester les modules hosts: localhost connection: local tasks: - block: - include: ovirt_auth.yaml tags: auth,change - name: vm facts ovirt_vm_info: auth: "{{ ovirt_auth }}" pattern: "name=vm5 or name=vm8" register: vm_info - debug: var=vm_info.ovirt_vms # msg: "{{vm_info.ovirt_vms | map(attribute='status')|list}}" - name: "Génération d'un dictionnaire avec combine" set_fact: vm_status: "{{ vm_status|default({})|combine({item.name: item.status}) }}" loop: "{{vm_info.ovirt_vms}}" when: item.status == "up" - debug: msg: "{{vm_status}}" always: - include: ovirt_auth_revoke.yaml tags: auth,change
Good luck!
This is up to you, of course.
For a project that uses heavily the ansible modules, see ovirt-ansible-hosted-engine-setup.
For one that uses the python SDK, see ovirt-system-tests. The SDK itself also has a very useful collection of examples.
But I'll find a solution.
Good luck and best regards,
-- Nathanaël Blanchet
Supervision réseau SIRE227 avenue Professeur-Jean-Louis-Viala <https://www.google.com/maps/search/227+avenue+Professeur-Jean-Louis-Viala?entry=gmail&source=g> 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14blanchet@abes.fr
_______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/LDCRW5YXHEMEY7...

Hi Eugène can't you use ansible add-hoc commands ? for a common cli to (libvirt, KubeVirt, oVirt, OpenStack, VMware vSphere, GCP and AWS) you could try kcli https://github.com/karmab/kcli/blob/master/doc/index.md ( although I haven't tried it yet). Regards, Paul S. ________________________________ From: Eugène Ngontang <sympavali@gmail.com> Sent: 27 February 2020 09:53 To: Yedidyah Bar David <didi@redhat.com> Cc: users <users@ovirt.org> Subject: [ovirt-users] Re: Ovirt API and CLI Caution External Mail: Do not click any links or open any attachments unless you trust the sender and know that the content is safe. Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that. But I'll find a solution. Le jeu. 27 févr. 2020 à 10:47, Yedidyah Bar David <didi@redhat.com<mailto:didi@redhat.com>> a écrit : On Thu, Feb 27, 2020 at 11:45 AM Eugène Ngontang <sympavali@gmail.com<mailto:sympavali@gmail.com>> wrote:
Hi,
I'm trying to find out there a sort of API or ovirt CLI/SDK in order to be able to interact with my ovirt VMS and associated resources.
In my architecture, I have an Ovirt virtualization host, with a self-hosted engine VM to manage VMs.
From the host I have the virsh command to list VMs status, but this doesn't really let me get into VMs management actions like : create, delete, get, reboot, get VMs wide informations (IPs, name, disks.....) So each time I have to login to the hosted engine web admin page to explore VM, but I'd really like to play with my Ovirt resources from my command line or programatically.
The ovirt API documentation I've found is really poor, I don't know if someone here has already got the same need and had a good solution.
Did you try one of the SDKs? Also the ansible modules are useful for many cases. Good luck and best regards, -- Didi -- LesCDN<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flescdn.com%2F&data=02%7C01%7Cp.staniforth%40leedsbeckett.ac.uk%7C0b0f31ff2bb44fe75bd708d7bb6b6779%7Cd79a81124fbe417aa112cd0fb490d85c%7C0%7C0%7C637183942289183463&sdata=LqmC35AITCJSJAweJmLffgT2Ztn8IHj8BBQmK3BjVKo%3D&reserved=0> engontang@lescdn.com<mailto:engontang@lescdn.com> ------------------------------------------------------------ Aux hommes il faut un chef, et au chef il faut des hommes! L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge! To view the terms under which this email is distributed, please go to:- http://leedsbeckett.ac.uk/disclaimer/email/

Eugene, On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote:
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that.
But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following: 1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs) I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high). At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script. I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it? Maybe I will find some time to play with OV4.4 on a test system in order to play with the auto-start features. In my copious amounts of free time. :( Thanks, -derek -- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant

@Derek, You're talking about a client the should up-port, but before having a client, my question is is there a documented API (server) to interact with through that client? Eugene NG Le jeu. 27 févr. 2020 à 14:57, Derek Atkins <derek@ihtfp.com> a écrit :
Eugene,
On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote:
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write playbooks for that.
But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following:
1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs)
I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high).
At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script.
I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it?
Maybe I will find some time to play with OV4.4 on a test system in order to play with the auto-start features. In my copious amounts of free time. :(
Thanks,
-derek
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au* * chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*

Yes. The devs call it "SDK4", which has been around for a few releases now. The CLI, however, uses SDK3, which was removed from Ovirt 4.4. Search for "ovirt-shell". -derek On Fri, February 28, 2020 10:47 am, Eugène Ngontang wrote:
@Derek,
You're talking about a client the should up-port, but before having a client, my question is is there a documented API (server) to interact with through that client?
Eugene NG
Le jeu. 27 févr. 2020 à 14:57, Derek Atkins <derek@ihtfp.com> a écrit :
Eugene,
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write
On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote: playbooks
for that.
But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following:
1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs)
I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high).
At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script.
I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it?
Maybe I will find some time to play with OV4.4 on a test system in order to play with the auto-start features. In my copious amounts of free time. :(
Thanks,
-derek
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant

Yes I know ovirt-shell. But if the Interface (API) is well exposed, we could ourself code add-hoc client to interact with, as we know how it's defined and structured. Please do you have useful links about those SDK4 and others API/CLI related stuff? Regards, Eugène NG Le ven. 28 févr. 2020 à 16:50, Derek Atkins <derek@ihtfp.com> a écrit :
Yes. The devs call it "SDK4", which has been around for a few releases now. The CLI, however, uses SDK3, which was removed from Ovirt 4.4. Search for "ovirt-shell".
-derek
On Fri, February 28, 2020 10:47 am, Eugène Ngontang wrote:
@Derek,
You're talking about a client the should up-port, but before having a client, my question is is there a documented API (server) to interact with through that client?
Eugene NG
Le jeu. 27 févr. 2020 à 14:57, Derek Atkins <derek@ihtfp.com> a écrit :
Eugene,
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write
On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote: playbooks
for that.
But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following:
1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs)
I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high).
At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script.
I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it?
Maybe I will find some time to play with OV4.4 on a test system in order to play with the auto-start features. In my copious amounts of free time. :(
Thanks,
-derek
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au* * chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*

Hi, It took me about 5 seconds to google for "ovirt sdk4" and the first link is: https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk NB: I am not an ovirt dev (nor am I a python programmer, although I do play one on TV sometimes ;-). -derek On Fri, February 28, 2020 1:12 pm, Eugène Ngontang wrote:
Yes I know ovirt-shell.
But if the Interface (API) is well exposed, we could ourself code add-hoc client to interact with, as we know how it's defined and structured.
Please do you have useful links about those SDK4 and others API/CLI related stuff?
Regards, Eugène NG
Le ven. 28 févr. 2020 à 16:50, Derek Atkins <derek@ihtfp.com> a écrit :
Yes. The devs call it "SDK4", which has been around for a few releases now. The CLI, however, uses SDK3, which was removed from Ovirt 4.4. Search for "ovirt-shell".
-derek
On Fri, February 28, 2020 10:47 am, Eugène Ngontang wrote:
@Derek,
You're talking about a client the should up-port, but before having a client, my question is is there a documented API (server) to interact with through that client?
Eugene NG
Le jeu. 27 févr. 2020 à 14:57, Derek Atkins <derek@ihtfp.com> a écrit :
Eugene,
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write
On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote: playbooks
for that.
But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following:
1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs)
I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high).
At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script.
I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it?
Maybe I will find some time to play with OV4.4 on a test system in order to play with the auto-start features. In my copious amounts of free time. :(
Thanks,
-derek
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant

AHAH Dereck, thx for googling, I knew I could google it, that's not an expert stuff, nevertheless as you seemed to be aware of the SDK subject I was wondering if you have links you find yourself useful (even from google), so that I can dive into them. Thx. Eugène NG Le ven. 28 févr. 2020 à 19:54, Derek Atkins <derek@ihtfp.com> a écrit :
Hi,
It took me about 5 seconds to google for "ovirt sdk4" and the first link is: https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk
NB: I am not an ovirt dev (nor am I a python programmer, although I do play one on TV sometimes ;-).
-derek
On Fri, February 28, 2020 1:12 pm, Eugène Ngontang wrote:
Yes I know ovirt-shell.
But if the Interface (API) is well exposed, we could ourself code add-hoc client to interact with, as we know how it's defined and structured.
Please do you have useful links about those SDK4 and others API/CLI related stuff?
Regards, Eugène NG
Le ven. 28 févr. 2020 à 16:50, Derek Atkins <derek@ihtfp.com> a écrit :
Yes. The devs call it "SDK4", which has been around for a few releases now. The CLI, however, uses SDK3, which was removed from Ovirt 4.4. Search for "ovirt-shell".
-derek
On Fri, February 28, 2020 10:47 am, Eugène Ngontang wrote:
@Derek,
You're talking about a client the should up-port, but before having a client, my question is is there a documented API (server) to interact with through that client?
Eugene NG
Le jeu. 27 févr. 2020 à 14:57, Derek Atkins <derek@ihtfp.com> a écrit :
Eugene,
Yes Ansible ovirt_vms module is useful, I use it for provisioning/deployment, but once my VM created, I'd like to administrate/interact with them, I don't think I should write
On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote: playbooks
for that.
But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following:
1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs)
I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high).
At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script.
I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it?
Maybe I will find some time to play with OV4.4 on a test system in order to play with the auto-start features. In my copious amounts of free time. :(
Thanks,
-derek
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au* * chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*

Hi all, On Fri, Feb 28, 2020 at 9:36 PM Eugène Ngontang <sympavali@gmail.com> wrote:
AHAH Dereck, thx for googling,
I knew I could google it, that's not an expert stuff, nevertheless as you seemed to be aware of the SDK subject I was wondering if you have links you find yourself useful (even from google), so that I can dive into them.
I'll partially repeat what I wrote before, but include links, just to make sure: I highly encourage you (and everyone) to have a look at: https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples https://github.com/oVirt/ovirt-ansible/tree/master/examples
Thx. Eugène NG
Le ven. 28 févr. 2020 à 19:54, Derek Atkins <derek@ihtfp.com> a écrit :
Hi,
It took me about 5 seconds to google for "ovirt sdk4" and the first link is: https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk
NB: I am not an ovirt dev (nor am I a python programmer, although I do play one on TV sometimes ;-).
-derek
On Fri, February 28, 2020 1:12 pm, Eugène Ngontang wrote:
Yes I know ovirt-shell.
But if the Interface (API) is well exposed, we could ourself code add-hoc client to interact with, as we know how it's defined and structured.
Please do you have useful links about those SDK4 and others API/CLI related stuff?
Regards, Eugène NG
Le ven. 28 févr. 2020 à 16:50, Derek Atkins <derek@ihtfp.com> a écrit :
Yes. The devs call it "SDK4", which has been around for a few releases now. The CLI, however, uses SDK3, which was removed from Ovirt 4.4. Search for "ovirt-shell".
-derek
On Fri, February 28, 2020 10:47 am, Eugène Ngontang wrote:
@Derek,
You're talking about a client the should up-port, but before having a client, my question is is there a documented API (server) to interact with through that client?
Eugene NG
Le jeu. 27 févr. 2020 à 14:57, Derek Atkins <derek@ihtfp.com> a écrit :
Eugene,
On Thu, February 27, 2020 4:53 am, Eugène Ngontang wrote: > Yes Ansible ovirt_vms module is useful, I use it for > provisioning/deployment, but once my VM created, I'd like to > administrate/interact with them, I don't think I should write playbooks > for > that. > > But I'll find a solution.
I am in a similar boat as you. I wrote some management scripts around ovirt-shell when I first started using ovirt (4.0), in order to mimic some vmware-server features that I needed. I run a single-host hosted-engine environment, so when the system boots up (e.g. from a power failure) I wanted all my VMs to auto-start, and to start in the correct order. I can't use the ovirt power management utilities because it's only a single host. So I wrote a relatively small script around ovirt-shell that would do the following:
1) Wait for the engine to respond 2) Wait for the storage to come online 3) Start my VMs, with appropriate order and delay between (e.g., ensure my DNS server and KDC come up before other VMs)
I know that SOME of these features are now in Ovirt (and I think they are even in 4.4), but my understanding is that they only return the system to previous state and wont auto-start a VM that was cleanly shut down. Also the ordering is, IIUC, somewhat course (low/medium/high).
At this point I plan to delay my deployment of 4.4 or beyond because what I have in 4.3 is working (still), and frankly I have no interest in learning Ansible or Python just to replace what should be a relatively simple script.
I honestly find it very sad that the developers wont up-port ovirt-client to SDK4. If SDK4 is "so good" vs SDK3 then I don't see why it would be hard to do that. And if it IS that hard to do, then how do they expect us to use it?
That's not the point. I was not part of the decision to drop ovirt-shell, but think it made sense. If you need to do complex stuff with it, you practically spend time on learning a new language, which is oVirt-specific, and so won't be useful for you for anything else you might do in the future. If you instead spend time on learning either python or ansible, you learn languages that are useful for other things you might want to automate. I think both of them suite very well the "sysadmin sometimes playing a developer" role. (I played that role myself for ~ 15 years, before joining Red Hat as a "real" developer, so speak from experience...) If you miss ovirt-shell itself (I guess mainly because for very simple things you could do stuff in a single command-line, and that's probably uglier to do with either ansible or python (although doable)), the below project was already mentioned in this thread elsewhere. I never tried it myself: https://github.com/karmab/kcli
Maybe I will find some time to play with OV4.4 on a test system in
order
to play with the auto-start features. In my copious amounts of free time. :(
Thanks,
-derek
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN <http://lescdn.com> engontang@lescdn.com ------------------------------------------------------------ *Aux hommes il faut un chef, et au*
* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!*
-- Derek Atkins 617-623-3745 derek@ihtfp.com www.ihtfp.com Computer and Internet Security Consultant
-- LesCDN engontang@lescdn.com ------------------------------------------------------------ Aux hommes il faut un chef, et au chef il faut des hommes! L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!
-- Didi

I wrote this cli a few years ago: https://github.com/fbacchella/ovirtcmd <https://github.com/fbacchella/ovirtcmd> I'm still using it but didn't have time to improve it since. It might give you some idea.
Le 27 févr. 2020 à 10:43, Eugène Ngontang <sympavali@gmail.com> a écrit :
Hi,
I'm trying to find out there a sort of API or ovirt CLI/SDK in order to be able to interact with my ovirt VMS and associated resources.
In my architecture, I have an Ovirt virtualization host, with a self-hosted engine VM to manage VMs.
From the host I have the virsh command to list VMs status, but this doesn't really let me get into VMs management actions like : create, delete, get, reboot, get VMs wide informations (IPs, name, disks.....) So each time I have to login to the hosted engine web admin page to explore VM, but I'd really like to play with my Ovirt resources from my command line or programatically.
The ovirt API documentation I've found is really poor, I don't know if someone here has already got the same need and had a good solution.
Thanks for your help.
Regards, Eugène NG

On March 3, 2020 9:19:14 AM GMT+02:00, Fabrice Bacchella <fabrice.bacchella@icloud.com> wrote:
I wrote this cli a few years ago:
https://github.com/fbacchella/ovirtcmd <https://github.com/fbacchella/ovirtcmd>
I'm still using it but didn't have time to improve it since. It might give you some idea.
Le 27 févr. 2020 à 10:43, Eugène Ngontang <sympavali@gmail.com> a écrit :
Hi,
I'm trying to find out there a sort of API or ovirt CLI/SDK in order to be able to interact with my ovirt VMS and associated resources.
In my architecture, I have an Ovirt virtualization host, with a self-hosted engine VM to manage VMs.
From the host I have the virsh command to list VMs status, but this doesn't really let me get into VMs management actions like : create, delete, get, reboot, get VMs wide informations (IPs, name, disks.....) So each time I have to login to the hosted engine web admin page to explore VM, but I'd really like to play with my Ovirt resources from my command line or programatically.
The ovirt API documentation I've found is really poor, I don't know if someone here has already got the same need and had a good solution.
Thanks for your help.
Regards, Eugène NG
As I have vrry limited programming skills, I have created some bash scripts using curl to access the API and it's quite easy. Best Regards, Strahil Nikolov
participants (8)
-
Derek Atkins
-
Eugène Ngontang
-
Fabrice Bacchella
-
Jayme
-
Nathanaël Blanchet
-
Staniforth, Paul
-
Strahil Nikolov
-
Yedidyah Bar David