-
Notifications
You must be signed in to change notification settings - Fork 37
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
reboot nodes after cloudinit #160
base: main
Are you sure you want to change the base?
Conversation
I like the idea of rebooting VMs if We could simply set in cloud-init: power_state:
mode: reboot
condition: ${update} However, a reboot can cause an error in remot-exec that waits for cloud-init to finish. So we need to figure out, how to prevent this. |
One way of doing it would be to duplicate the remote-exec block within the This way, if the reboot happens, the error (lost connection) will be ignored, and the second provisioner will wait for cloud-init to finish. If cloud-init does not finish, the second provisioner will throw an error. In such case, the second provisioner should have the timeout set to 1 minute or something like that. This is just a quick-fix that would probably work, but I would prefer a more reliable approach (if possible). |
reading cloud-init documentation, it looks like cloud-init will report that it is done before the reboot is executed. as such, we should block on from power state docs:
fwiw i've initialized my nodes probably 100 times over the past week with reboot mode and haven't run into any issues |
I would prefer the cloud-init --wait > /dev/null Regarding the reboot, I always run into the following error:
To me, it seems that either the VM is terminated too quickly or cloud-init reports the exit status too late. However, I suggest that we add the second remote provisioner, where the first one will be ignored on error and the second one will connect to the VM once its rebooted. This way we also ensure that VMs are properly started after the reboot. Any thoughts on that? |
I think that power_state:
mode: reboot
condition: ${update}
delay: 5 Any thoughts against this approach? |
ah - just realized that https://cloudinit.readthedocs.io/en/latest/reference/modules.html#power-state-change |
while debugging #159 i noticed that after the package upgrades that kubitect applies when
updateOnBoot
istrue
, ubuntu reports that it needs a reboot to apply those upgrades. this change reboots the nodes using cloudinit after everything is done.i'd also like to get your thoughts on whether or not this should be configurable / if
updateOnBoot
should be the one that sets reboot powerstate