diff --git a/changelogs/fragments/4306-proxmox-fix-error-on-vm-clone.yml b/changelogs/fragments/4306-proxmox-fix-error-on-vm-clone.yml new file mode 100644 index 0000000000..6bba165e50 --- /dev/null +++ b/changelogs/fragments/4306-proxmox-fix-error-on-vm-clone.yml @@ -0,0 +1,2 @@ +bugfixes: + - "proxmox_kvm - fix error in check when creating or cloning (https://github.com/ansible-collections/community.general/pull/4306)." diff --git a/plugins/modules/cloud/misc/proxmox_kvm.py b/plugins/modules/cloud/misc/proxmox_kvm.py index 67dd422e97..6bfb9e2e19 100644 --- a/plugins/modules/cloud/misc/proxmox_kvm.py +++ b/plugins/modules/cloud/misc/proxmox_kvm.py @@ -1210,7 +1210,7 @@ def main(): module.exit_json(changed=False, vmid=existing_vmid, msg="VM with name <%s> already exists" % name) # Ensure the choosen VM id doesn't already exist when cloning - if proxmox.get_vm(newid, ignore_errors=True): + if proxmox.get_vm(newid, ignore_missing=True): module.exit_json(changed=False, vmid=vmid, msg="vmid %s with VM name %s already exists" % (newid, name)) if delete is not None: