ansible ovirt module

Hello,

I’m trying to setup vm provisioning for Rhev with the ansible ovirt module. I have installed ovirt-engine-sdk-python-3.4.0.7-1.el6.noarch on my Centos 6.5 Ansible server and created a simple playbook to play around with this. The playbook tries to provision a vm based on a template defined within the Rhev manager:

`

Are their any ovirt users that would like to help with this one?

https://github.com/ansible/ansible/commits/devel/library/cloud/ovirt

I might have a look at this. Not sure if the API has changed over time.
I still have a RHEV setup running where I can test on

Regards,
Vincent

That would be very much appreciated. Ansible is awesome.

If I need to provide more info please let me know.

Regards,

Peter

I was wondering if you had the chance looking in to this already? Just curious.

Hi

We are using ansible internally (unofficially, as the company
standard-which-must-be-followed-regardless is puppet, but that is a
different story), and I ended up re-writing the ovirt module quite a
bit - the existing ovirt module had several problems:

- Error reporting was... not really working

- Support for quotas wasn't there

- Getting information about servers to start VNC console would be nice

and in general, I was not too happy with the code.

Perhaps this will be useful for others? It has only been tested in
our own environment, against one version of RHEV, so it is probably
not ready for prime time yet..

I probably have to approach the legal department here for this,
they're quite touchy about "IP rights" and stuff like that - advice
for this will be appreciated too. I realise this part is outside the
remit of this mailing list, but pointers in the right direction will
be appreciated.

I’d be very interested in a pull request if you’d like to send it along.

My outside understanding was ovirt was starting to taper off in favor of Red Hat investing more in OpenStack, but there’s no reason the module can’t be updated for sure.

(Also, that might not be entirely correct…)

–Michael

This is indeed why I want to see Karl’s module upgrades.

Best way would be via a pull request, on top of the existing module if possible.

Hi,

Just returned from Holiday abroad. I hope to have a look at it in the next few days.

Which version of oVirt are you using and do you by any chance now about changes in the api, because the module worked perfectly on the version we used (3.1).

Regards,
Vincent

Hello,

Hope you had a good holiday :slight_smile: My holiday starts this Friday luckily.

These are the versions we use:

Red Hat Enterprise Virtualization Manager Version: 3.4.1-0.31.el6ev

ansible: 1.6.6

module: ovirt
author: Vincent Van der Kussen
short_description: oVirt/RHEV platform management
description:

  • allows you to create new instances, either from scratch or an image, in addition to deleting or stopping instances on the oVirt/RHEV platform
    version_added: “1.4”

I really don’t know if there are any changes in the API: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/index.html

What I do know is that there is also a problem with the rhevm/ovirt iso up loader which also uses the API.

Hi,

I just tested this from an Ubuntu machine with version 3.4.3.0 of the
SDK. Seems to be working just fine.

$ cat play.yml
- hosts: localhost
  tasks:
  - name: create vm based on template
    ovirt: user=admin@internal url=https://rhevm30.bla.local:8443
instance_name=ansibletest password=xxxxxxx image=CentOS6.4-minimal
zone=production resource_type=template

vincent@bumblebee in ~/tmp
$ ansible-playbook -c local play.yml

PLAY [localhost] **************************************************************

GATHERING FACTS ***************************************************************
ok: [localhost]

TASK: [create vm based on template] *******************************************
changed: [localhost]

PLAY RECAP ********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0

vincent@bumblebee in ~/tmp

Can you try to login in the gui with the credentials provided in your
playbook? Does that work?

Regards,
Vincent

Hello,

In my playbook I had “resource_type=template” which should be “resource_type=new” as shown in your example. So now it works, I can provision a vm with Ansible!! Awesomeness!!

Thank you for your help.

Hello,

When deploying from a template with the ovirt module it creates the vm with the specs that are defined within the template. Is it possible to adjust the specs when provisioning with the ovirt module? So, is it possible to give more cpu, mem or an other instanc_network to a vm provisioned form template with the Ansible ovirt module?

I’ve tried this without success.

Hi,

I don’t know If this can be done on deployment of the template.

An option might be to deploy your template and then alter the resource settings one it’s available. But this should be added to the module.

I currently don’t have access to a rhev/ovirt setup to see what has changed in the API.

Vincent

Hey Vincent,

Thank you for your answer. I would be great to alter the vm settings with your module but I don’t see anything about it in the API documentation either:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.0/html-single/REST_API_Guide/

For now I will try to get the mac address of the created vm through an API call and try to configure the vm with tftp boot and kickstart.

Peter