Uploaded image for project: 'Ansible Cloud Automation'
  1. Ansible Cloud Automation
  2. ACA-1486

snapshot_management role errors when specifying VM by UUID/MOID and folder is defined too

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Moderate

      The snapshot_management role can be used to manage snapshot of a given VM. According to the documentation the VM can be identified by either

      • UUID
      • MOID
      • folder + VM name

      If in the playbook calling the role `snapshot_management_folder` is defined and VM is identified either by `snapshot_management_uuid` or by `snapshot_management_moid`, the role is failing with the error:

      fatal: [localhost]: FAILED! => {"changed": false, "msg": "parameters are required together: name, folder"} 

       

      Example playbook:

          - name: "Create snapshot for VM with MOID {{ vm_moid }}"
            ansible.builtin.import_role:
              name: cloud.vmware_ops.snapshot_management
            vars:
              snapshot_management_hostname: "{{ vcenter_hostname }}"
              snapshot_management_username: "{{ vcenter_username }}"
              snapshot_management_password: "{{ vcenter_password }}"
              snapshot_management_validate_certs: false
              snapshot_management_cluster: "Eco-Cluster"
              snapshot_management_folder: "/e2e-qe"
              snapshot_management_datacenter: "Eco-Datacenter"
              snapshot_management_moid: "{{ vm_moid }}"
              snapshot_management_state: "present"
              snapshot_management_snapshot_name: "snapshot-1"

       

      If `snapshot_management_folder` is not defined then the role works as expected.

      I expect that if  `snapshot_management_uuid` or `snapshot_management_moid` are provided the VM name is not needed even if folder variable is defined.

            dbarda Danielle Barda
            epassaro@redhat.com Elsa Passaro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: