Re: controlled shutdown of VMs by ups software, before shutting sown the host

From: Paul Vixie <paul_at_redbarn.org>
Date: Mon, 26 Oct 2026 18:30:27 UTC
On Monday, October 26, 2026 10:47:52 a.m. Pacific Daylight Time Bakul Shah wrote:
> On Oct 26, 2026, at 8:31 AM, Paul Vixie <paul@redbarn.org> wrote:
> > On Monday, October 26, 2026 5:21:11 a.m. Pacific Daylight Time void wrote:
> > > ...
> > 
> > ...
> 
> I believe this warrants a PR in the hope that this fixed up right!

I think a general fix is impossible, since bhyve has insufficient insight as to what the guest 
is doing after the ACPI Poweroff signal is transmitted. The guest might use a little or a lot 
of CPU time, or do a little or a lot of I/O, and none of that can be taken as evidence that it 
should be allowed to keep doing whatever it's doing. And there's not going to be a way 
for bhyve to ask the host kernel to delay final shutdown, since the need for shutdown 
may be some emergency like power loss or thermal overrun. 

If we want our guests to end cleanly, ACPI is not the way to ask.

A best efforts approach in the host shutdown path might be to wait some period like 30 
seconds for all processes to be quiet (of both CPU and I/O), similarly to waiting for the 
number of dirty file system pages to reach zero. But sooner or later the time will run out. 
In this example, Void is talking about a UPS reaching its last 5% of capacity, and in my 
view, every guest kernel should be told about that, so that their own local policy can react 
to it.

-- 
Paul Vixie