[vm-bhyve] Windows 2012 and 2016 servers guests would not stop

Victor Sudakov vas at mpeks.tomsk.su
Thu Apr 25 15:04:09 UTC 2019


Stephen Stuart wrote:
> I call this in /etc/rc.shutdown.local to shut all VMs down gracefully and
> wait, perhaps a variant would help you.
> 
> #!/bin/sh
> 
> INTERVAL=5
> /usr/bin/killall -TERM bhyve
> echo -n "/dev/vmm:"
> while test -d /dev/vmm ; do
>     echo -n "" $(/bin/ls /dev/vmm | /usr/bin/wc -w)
>     /bin/sleep $INTERVAL
> done
> echo " 0"

Thanks for reminding me about /etc/rc.shutdown.local. I've tested a
solution today and it seems working.

1. Start apcupsd with --term-on-powerfail
apcupsd_enable="YES"
apcupsd_flags="--term-on-powerfail"

2. Put the following line into /etc/rc.shutdown.local
test -f /var/run/powerfail && /usr/local/sbin/apcupsd --killpower

Now, when the UPS power is exhausted, apcupsd starts the shutdown
procedure and exits. The system shuts down without any haste, as it
pleases, and at the very end "apcupsd --killpower" is called and
poweroffs the UPS.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49 at fidonet http://vas.tomsk.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20190425/3ce9f94b/attachment.sig>


More information about the freebsd-virtualization mailing list