ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 338 forks source link

Problem using snapshot_id while using module vmware_guest_snapshot #2236

Open Rakesh2904 opened 1 day ago

Rakesh2904 commented 1 day ago
SUMMARY

While using snapshot_id to delete the snapshot using module vmware_guest_snapshot , I get the below error

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
2.9.27
COLLECTION VERSION
ansible-galaxy collection list | grep community.vmware
community.vmware                         4.1.0
CONFIGURATION
python version = 3.8.16
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
Rakesh2904 commented 22 hours ago

The reason for me to try and use snapshot_id is because when snapshot_name is like this 'VM Snapshot 05/11/2024, 14:20:05' and when I try to delete it I get the error '"msg": "Couldn't find any snapshots with specified name: VM Snapshot 05/11/2024, 14:20:05 on VM: ".

Also this name is fetched dynamically inside the play and the json result is as below

"guest_snapshots": { "snapshots": [ { "id": 164, "name": "VM Snapshot 05%2f11%2f2024, 14:20:05", "description": "This is a test snapshot, can be deleted any time", "creation_time": "2024-11-05T08:50:20.310483+00:00", "state": "poweredOff" },

But I've tried to delete the snapshot by hard coding the snapshot name by copy pasting directly from vCenter to the task but still I've the same error.

So I'd need to have a fix to have to delete snapshot when name is like this or using snapshot_id