-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
proxmox_kvm: Create VM without providing vmid not idempotent #6911
Comments
Files identified in the description: If these files are incorrect, please update the |
@wozniaka I think the previous behavior was wrong. Proxmox API allows you to create/have multiple VMs with the same name. Previously the module didn't let that, but we shouldn't restrict something which is a feature by design in API. |
@felixfontein or @russoz would like to hear your thoughts about that. |
@UnderGreen I can understand that but can't module support this scenario by explicitly providing different pairs of However, I must admit that, in this case, getting Maybe module can provide some sort of switch between two use cases? |
I hate to add more params to the module as it already contains about twenty of them, but we need some sort of |
In any case notice of the changes for the user experience should be added to the module docs. |
Summary
When I try to run playbook that uses
community.general.proxmox_kvm
module to create a new VM without specifying itsvmid
and with the samename
more than one time, new one with differentvmid
is always created.Module behaviour changed with version
7.1.0
due to issue #6155.Possible solution is to change the following:
community.general/plugins/modules/proxmox_kvm.py
Lines 1265 to 1273 in 2e0079c
to something like that:
Issue Type
Bug Report
Component Name
proxmox_kvm
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Steps to Reproduce
Run following playbook at least to times. With each run new VM named
test-vm
with differentvmid
is created.In this test case fist playbook run creates a VM named
test-vm
withvmid: 100
.Expected Results
After discovering that VM with name
test-vm
already exists and novmid
was provided module shouldn't make any changes (changed: false
, unlessupdate: true
or related flags are set) and return info about previously created one (as in7.0.0
)First run:
Second run:
Actual Results
Multiple VM instances with different
vmid
and the samename
are created every playbook run.First run:
Second run:
Code of Conduct
The text was updated successfully, but these errors were encountered: