-
Notifications
You must be signed in to change notification settings - Fork 24k
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 module hangs with OpenVZ hosts #58868
Comments
Files identified in the description: If these files are inaccurate, please update the |
I believe this is a duplicate of #57768. I am not familiar with OpenVZ but it seems to run containers, not VMs. My best guess is needs_info |
@samdoran Yes, that is exactly the issue:
what about changing the boot time command to:
Maybe the
Even before who -b as this command can be problematic as it does not report seconds.
|
That presents a tricky problem to solve. It's not as simple as prepending the boot time command — we have to see what is available on all those platforms. Further complicating the issue is we have to change the command based on the virtualization platform. I am not sure how to reliably discover that information. |
The Can you please hotfix it for 2.7+ branches? For next major release it can be further analysed or a new option to specify the start time command manually can be introduced. |
The problem with
I am not saying this cannot be solved, just that it is more involved than it seems. |
Yes, the source for What about reading the last reboot time directly from /var/log/wtmp file? This is what
|
@samdoran What fix would you propose and can we fix it locally before the fix will be released? |
@mvorisek I don't have a specific fix in mind. I will have to setup OpenVZ in order to investigate further. |
When this issue is expected to be fixed? |
I do not have an ETA on fixing this since restarting containers was outside the original scope of this module. I will look into it, but am currently focused on the 2.9 release. |
For OpenVZ, Docker, etc. containers all standard restaring commands work out of the box. The only issue is the command to detect that the system has rebooted. Would it be possible to solve this issue by adding an Ansible What do you think about this solution and can you add it to the 2.9 release? |
I thought long and hard about this as well as evaluated some other solutions. In the end, your suggestion of adding a new parameter was the simplest and most reliable solution. Please test with #62680 and let me know if that solves you problem. |
Seems good too me, can you make it for Ansible 2.9 release? |
Since this is adding a new feature and 2.9 is already well past feature freeze, this will be in 2.10. I was trying to find a way to handle this internally and thus be able to add it to 2.9 as a bugfix, but I did not come up with a reliable way to fix it without tons of complexity. |
I understand, but this switch is a bugfix for me. Nothing new, only a possibility for the user to specify own reboot detection command for the edge cases not covered by the module itself (like this bug report with OpenVZ). |
I am running a normal VM which I connect to over a normal Internet connection, reboot always gets stuck. It is an Ubuntu box: 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64) It hangs forever after the reboot :/ This is what I have inside my playbook:
become is set to "true", this is what I get when running verbose: machine.host.name> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/xxx/.ansible/cp/4406263006 -tt machine.host.name'/bin/sh -c '"'"'sudo -H -S -p "[sudo via ansible, key=somekey] password:" -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-blablabla ; cat /proc/sys/kernel/random/boot_id'"'"'"'"'"'"'"'"' && sleep 0'"'"'' It stays there forever, I experimented with the timeouts but this did not help in any way :( |
Ok, nevermind, I have been using Visual Studio Code when testing, seems like the integrated terminal there does not work properly with this module in combination which macOS... :D |
SUMMARY
Currently there is some issue with the reboot module with OpenVZ hosts. The reboot command is executed correctly, all hosts reboots, but the Ansible reboot tasks hangs.
If exactly the same playbook is run on KVM or native host, it finish without any issues.
It should be hot fixed in 2.7+ branches.
ISSUE TYPE
COMPONENT NAME
reboot module
ANSIBLE VERSION
2.7
CONFIGURATION
Debian 9.9 / Ansible 2.8
OS / ENVIRONMENT
Debian 9.9
STEPS TO REPRODUCE
Trigger this reboot handler on OpenVZ hosts
EXPECTED RESULTS
Reboot is executed and once the host is back online, task is marked as changed and the execution of the playbook continues.
ACTUAL RESULTS
(and no more output, the Ansible playbook hangs)
The text was updated successfully, but these errors were encountered: