Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using snapshot_id while using module vmware_guest_snapshot #2236

Open
Rakesh2904 opened this issue Nov 5, 2024 · 3 comments
Open

Comments

@Rakesh2904
Copy link

SUMMARY

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

ISSUE TYPE
  • "Unsupported parameters for (vmware_guest_snapshot) module: snapshot_id Supported parameters include: datacenter, description, folder, hostname, memory_dump, moid, name, name_match, new_description, new_snapshot_name, password, port, proxy_host, proxy_port, quiesce, remove_children, snapshot_name, state, use_instance_uuid, username, uuid, validate_certs",
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
Copy link
Author

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: <vm_name>".

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

@sky-joker
Copy link
Collaborator

Hi @Rakesh2904

I noticed that your Ansible version is outdated.
If possible, could you provide the trace log using the command below?

ansible-playbook -i INVENTORY PLAYBOOK -vvv

This will help me confirm whether the path to the module being called by Ansible is correct.

@Rakesh2904
Copy link
Author

Rakesh2904 commented Dec 4, 2024

Hello @sky-joker

Below are the details

ansible-playbook 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.8.16 (default, May 31 2023, 12:44:21) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)]


{
"msg": "Unable to manage snapshots for non-existing VM <vm_name>",
"invocation": {
"module_args": {
"hostname": "",
"username": "",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"validate_certs": false,
"datacenter": "",
"folder": "",
"name": "<vm_name>",
"snapshot_name": "VM Snapshot 04/12/2024, 09:15:39",
"state": "absent",
"port": 443,
"name_match": "first",
"use_instance_uuid": false,
"description": "",
"quiesce": false,
"memory_dump": false,
"remove_children": false,
"proxy_host": null,
"proxy_port": null,
"uuid": null,
"moid": null,
"new_snapshot_name": null,
"new_description": null
}
},
"_ansible_no_log": false,
"changed": false
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants