Following https://www.ovirt.org/develop/incremental-backup-guide/incremental-backup-guide.html#enabling-incremental-backup-on-an-existing-virtual-machine, what about the uri module?
 It seems to do the job like this:

- name: Get incremental disk status
  hosts: all
  gather_facts: no
  vars:
    vm_name: hirondelle1-bas 
    server: air-dev
    incr_state: incremental
    body: |-
          <disk_attachment>
              <disk>
                 <backup>{{incr_state}}</backup>
              </disk>
          </disk_attachment>
  tasks:

    - block:
      - name: authenticate to ovirt
        include_tasks: ovirt_auth.yaml
      - name: Get disk status
        ovirt_vm_info:
          auth: "{{ ovirt_auth }}"
          pattern: name="{{inventory_hostname_short}}"
          follows: ['disk_attachments']
        register: result
      - set_fact:
          disk_id: "{{ result.ovirt_vms[0].disk_attachments| map(attribute='disk.id')|list }}"
          vm_id: "{{ result.ovirt_vms[0].id }}" 
      - name: Update disk incremental state 
        ansible.builtin.uri:
          url: https://{{server}}.v100.abes.fr/ovirt-engine/api/vms/{{vm_id}}/diskattachments/{{item}}
          user: admin@internal
          password: "{{ovirt_password}}"
          method: PUT
          body: "{{body}}"
          validate_certs: no
          headers:
            Content-type: "application/xml"
        loop: "{{disk_id}}"
        loop_control:
          label: "{{item}}"
      delegate_to: localhost  


De : Arik Hadas <ahadas@redhat.com>
Envoyé : samedi 19 novembre 2022 21:58
À : Nathanaël Blanchet <blanchet@abes.fr>
Cc : users <users@ovirt.org>
Objet : Re: [ovirt-users] activate incremental backup on disk with ansible ovirt_disk module
 


On Thu, Nov 17, 2022 at 7:30 PM Nathanaël Blanchet via Users <users@ovirt.org> wrote:

Hello,

I've struggled for hours with enabling incremental backup on disk level with the ansible ovirt.ovirt.ovirt_disk module:

- name: modify incremental backup state
ovirt.ovirt.ovirt_disk:
auth: "{{ ovirt_auth }}"
id: "{{disk_id}}"
backup: "incremental"

But the disk never gets into an incremental state.

What's the matter?

Enabling 'incremental backup' for a disk may require changing its format (from RAW to QCOW) and that, among other reasons, lead to modeling this as an action on the disk rather than an update of its state.
There's an open PR for adding this action to Ansible: https://github.com/oVirt/ovirt-ansible-collection/pull/601

PS: I know I can do the same with curl, but this is not what I want.

Thank you

-- 
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
_______________________________________________
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/HCIL6XTF6RSDPFMH42MGAGSFWRYHWYVP/