-
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 - Allow creation of VM with existing name but new vmid #6709
proxmox_kvm - Allow creation of VM with existing name but new vmid #6709
Conversation
@@ -1419,11 +1413,19 @@ def main(): | |||
else: | |||
module.fail_json(vmid=vmid, msg="creation of qemu VM %s with vmid %s failed with exception=%s" % (name, vmid, e)) | |||
|
|||
if update: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here - that code should be executed when the catch block hasn't fired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tests for the case when vmid
matches existing vmid
and another one to check if vmid
is new, but name
matches another VM in the cluster.
This comment was marked as outdated.
This comment was marked as outdated.
changelogs/fragments/6709-proxmox-create-vm-with-existing-name.yml
Outdated
Show resolved
Hide resolved
….yml Co-authored-by: Felix Fontein <felix@fontein.de>
Backport to stable-6: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply fb04dc3 on top of patchback/backports/stable-6/fb04dc3db26af26d1787934c93d4d9180186923f/pr-6709 Backporting merged PR #6709 into main
🤖 @patchback |
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #6729 🤖 @patchback |
@UnderGreen thanks for your contribution! |
…6709) * proxmox_kvm - Allow creation of VM with existing name but new vmid * Fix pylint and pep8 errors * Add changelog fragment * Move status variable outside of try block * Add assertion for calling get_vm_node function * Use try/catch for module_utils functions * Update changelogs/fragments/6709-proxmox-create-vm-with-existing-name.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit fb04dc3)
…f VM with existing name but new vmid (#6729) proxmox_kvm - Allow creation of VM with existing name but new vmid (#6709) * proxmox_kvm - Allow creation of VM with existing name but new vmid * Fix pylint and pep8 errors * Add changelog fragment * Move status variable outside of try block * Add assertion for calling get_vm_node function * Use try/catch for module_utils functions * Update changelogs/fragments/6709-proxmox-create-vm-with-existing-name.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit fb04dc3) Co-authored-by: Sergei Antipov <greendayonfire@gmail.com>
SUMMARY
Fixes #6155.
Allow to create a VM if vmid is provided and it doesn't exist in the cluster, but name for that VM already exists.
ISSUE TYPE
COMPONENT NAME
proxmox_kvm
ADDITIONAL INFORMATION