[Bug 242684] sysutils/vm-bhyve: service vm stop

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 17 11:55:19 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242684

            Bug ID: 242684
           Summary: sysutils/vm-bhyve: service vm stop
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs at FreeBSD.org
          Reporter: bernhard at blberger.de
                CC: churchers at gmail.com
             Flags: maintainer-feedback?(churchers at gmail.com)
                CC: churchers at gmail.com

I found a problem with VM-BHYVE.

VM-BHYVE provides a service vm which starts /stop the VM's on system startup
and on system stop. 

The problem is with shutdown of the host system. The script in
/usr/local/etc/rc.d/vm uses "vm stopall" to terminate the VM's. 
vm stopall sends the VM's the signal to shut down the system. if "vm stopall"
is done, the script "/usr/local/etc/rc.d/vm" is done, too, so that the shutdown
process of the host is continued and this is the problem, because "vm stopall"
does not wait until the VM's are really finished and the shutdown processes of
the host are continued, the VM's which are not finished with the schutdown will
be aborted. This leads to broken file systems in the VM's -> fatal

they can easily verify that. Start a VM in a shell a: vm -f start test and now
stop the VM: vm stop test in another shell b and you will see that the command
in shell b is finished faster and the VM in shell a is still in the shutdown
process.  

My suggestion:
In the script:
/usr/local/lib/vm-bhyve/vm-core 
in the function core::stopall() or core::stop()

to add a check function that waits with the continuation until the VM's are
actually finished. so the task: bhyve <vm-name> has disappeared.

This way you can make sure that when the host system is stopped, all VM's are
really stopped.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list