Skip to content

brand/bhyve: Prevent long delays when shutting down unresponsive VMs#531

Open
hrosenfeld wants to merge 1 commit intoomniosorg:masterfrom
hrosenfeld:shutdown
Open

brand/bhyve: Prevent long delays when shutting down unresponsive VMs#531
hrosenfeld wants to merge 1 commit intoomniosorg:masterfrom
hrosenfeld:shutdown

Conversation

@hrosenfeld
Copy link
Copy Markdown

This code was written by Patrick van der Linden of EFit Partners.

Sometimes a VM can get in a state where it doesn't respond in reasonable time to shutdown request, such as when the OS isn't running yet or isn't running anymore, having crashed or otherwise locked up. In such a case, halting the zone can take a very long time.

This patch reduces the shutdown timeout from 30min to 20s in the default zone shutdown code, and introduces a force-poweroff in case the guest didn't shut down in time.

Here is a sample without the patch applied

:~$` time pfexec zoneadm -z bhwinlab25-02 shutdown
zone 'bhwinlab25-02': unable to shutdown zone

real    6m41.114s
user    0m0.002s
sys     0m0.003s

:~$ time pfexec zoneadm -z bhwinlab25-02 halt

real    30m9.890s
user    0m0.003s
sys     0m0.003s

Here is a sample with the patch applied
The VM shudtowns as expected

:~$ time pfexec zoneadm -z bhwinlab25-02 shutdown

real    0m12.357s
user    0m0.003s
sys     0m0.003s

halting a zone when emulating a non responsive VM is very faster ;)

:~$ time pfexec zoneadm -z bhwinlab25-02 halt

real    0m27.074s
user    0m0.004s
sys     0m0.004s

Sometimes a VM can get in a state where it doesn't respond in reasonable
time to shutdown request, such as when the OS isn't running yet or isn't
running anymore, having crashed or otherwise locked up. In such a case,
halting the zone can take a very long time.

This patch reduces the shutdown timeout from 30min to 20s in the default
zone shutdown code, and introduces a force-poweroff in case the guest
didn't shut down in time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant