-
Bug
-
Resolution: Done
-
Undefined
-
None
-
Unspecified
-
False
-
-
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.