Hi.

If it's any help to you we use packer to create qemu image (in qcow2 format) and then ansible to generate template on ovirt cluster.
For template we used this project: https://github.com/jclaret/packer-templates

With kind regards,
Pavel

On 22/06/2023 08:52, Arik Hadas wrote:


On Mon, Jun 12, 2023 at 12:06 PM destfinal--- via Users <users@ovirt.org> wrote:
Hi,

I use a set of templates, generated in one cluster and re-used in multiple clusters. The clusters do not have direct connections between each other. My dev environment can talk to all the clusters. Currently,

1. I export the templates (as OVAs) to one of the nodes (example: node1.source.cluster), from the ovirt console (https://management.source.cluster)
2. scp the templates to my dev machine (example: scp -r node1.source.cluster:/tmp/ovirt_templates /tmp/ovirt_templates)
3. scp the templates from my dev environment to the target cluster (example: scp /tmp/ovirt_templates node1.target.cluster:/tmp)
4. Import the templates using the ovirt console of the target cluster (https://management.target.cluster)

This is highly a manual job and I am trying to automate the process using ansible. I am unable to work it out using the ovit_template module documentation (https://docs.ansible.com/ansible/latest/collections/ovirt/ovirt/ovirt_template_module.html#ansible-collections-ovirt-ovirt-ovirt-template-module) and could not able to see any other module in this relation.

Has anybody done this before and point me to the right direction? Or if there is a better process than what I follow above, please suggest me one.

you didn't elaborate on what doesn't work for you using Ansible, I suppose the ability to export a template as an OVA is missing, right?
in that case, the following process could work:
1. provision a VM from the template (it can be thin-provisioned vm to save time)
2. export the VM to an OVA
3. remove the VM
4. import the OVA as a template (see "Import external ova template" in the documentation of ovirt_template_module)

it should be possible to import an OVA of a VM as a template from the CLI/Ansible

in addition, if you look for ways to improve the flow you described above, I'd suggest to use shared storage in order to save you from copying the OVA (e.g., configure an NFS share that is mounted to hosts on both environments - export to that NFS share on the source environment and import from that NFS share on the target environment once the export operation completes)
 

Please let me know if you need more information in this regard.

Thanks
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/MZ27S5QXM7R3PM5XB22ZZNWTXHPLMSV6/

_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/OKM6ILDKEQG57XOCJLCIIE3P2X4IRGGO/
-- 
--
Pavel Sipos, Arnes <pavel.sipos@arnes.si>
ARNES, p.p. 7, SI-1001 Ljubljana, Slovenia
T: +386 1 479 88 00
W: www.arnes.si, aai.arnes.si