# ansible ovirt module

**URL:** <https://forum.ansible.com/t/ansible-ovirt-module/15757>\
**Category:** Ansible Project\
**Created:** [July 24, 2014, 8:26am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757 "2014-07-24T08:26:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [July 24, 2014, 8:26am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/1 "2014-07-24T08:26:02Z")

</div>

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:

`

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 24, 2014, 11:10am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/2 "2014-07-24T11:10:28Z")

</div>

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

[https://github.com/ansible/ansible/commits/devel/library/cloud/ovirt](https://github.com/ansible/ansible/commits/devel/library/cloud/ovirt)

---

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [July 24, 2014, 11:49am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/3 "2014-07-24T11:49:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [July 24, 2014, 12:31pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/4 "2014-07-24T12:31:29Z")

</div>

That would be very much appreciated. Ansible is awesome.

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

Regards,

Peter

---

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [August 13, 2014, 10:49am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/5 "2014-08-13T10:49:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Karl\_E\_Jorgensen](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Karl\_E\_Jorgensen](https://forum.ansible.com/u/Karl_E_Jorgensen)\
**Post date:** [August 13, 2014, 12:01pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/6 "2014-08-13T12:01:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 13, 2014, 12:34pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/7 "2014-08-13T12:34:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 13, 2014, 1:11pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/8 "2014-08-13T13:11:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [August 13, 2014, 2:42pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/9 "2014-08-13T14:42:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [August 14, 2014, 7:37am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/10 "2014-08-14T07:37:27Z")

</div>

Hello,

Hope you had a good holiday 🙂 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](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.

---

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [August 19, 2014, 7:11am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/11 "2014-08-19T07:11:35Z")

</div>

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  
&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;- name: create vm based on template  
&nbsp;&nbsp;&nbsp;&nbsp;ovirt: user=admin@internal url=[https://rhevm30.bla.local:8443](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

---

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [September 11, 2014, 12:12pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/12 "2014-09-11T12:12:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [November 10, 2014, 11:30am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/13 "2014-11-10T11:30:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [November 10, 2014, 12:44pm UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/14 "2014-11-10T12:44:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_Smallegange](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Peter\_Smallegange](https://forum.ansible.com/u/Peter_Smallegange)\
**Post date:** [November 14, 2014, 10:13am UTC](https://forum.ansible.com/t/ansible-ovirt-module/15757/15 "2014-11-14T10:13:17Z")

</div>

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/](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
