-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
modules/proxmox_kvm: initial support for online migrations #6448
modules/proxmox_kvm: initial support for online migrations #6448
Conversation
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.
Thanks for your contribution! Without knowing proxmox_kvm the change looks good on a first glance.
@@ -1256,6 +1283,18 @@ def main(): | |||
except Exception as e: | |||
module.fail_json(vmid=vmid, msg='Unable to revert settings on VM {0} with vmid {1}: Maybe is not a pending task... '.format(name, vmid) + str(e)) | |||
|
|||
if migrate: |
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.
I find it a bit strange that this overrides state=absent
, but then the other options above do it the same way.
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.
Well as it is, migrate
would fail on the proxmox.get_vm(vmid)
if it does not exist in the cluster, but indeed it will never ensure states when migrate
(or previous actions) is True
. The way I see it, users need to define several tasks: one for managing the state and one or more for specific actions (clone
, delete
, revert
and migrate
).
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.
Nevermind, I just re-read this part and clone
does not prevent state management. We could do the same for migrate
, but having state
and migrate
as mutually exclusive options seems easier to implement.
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.
Also lacking familiarity with proxmox, but also agreeing it looks good.
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
@tyxieblub thanks for your contribution! |
SUMMARY
I found myself wanting to use the
proxmox_kvm
module to migrate VM on different hosts, so I propose this change to do that by adding themigrate
option, which isFalse
by default (to prevent any breaking of existing playbooks).ISSUE TYPE
COMPONENT NAME
proxmox_kvm