Skip to content
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

bhyve restarts not detected #399

Closed
VVelox opened this issue Apr 15, 2019 · 3 comments
Assignees

Comments

@VVelox
Copy link

@VVelox VVelox commented Apr 15, 2019

Mandatory info for bug reports:

FreeBSD version ( uname -a ): FreeBSD nibbles.vulpes.vvelox.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC amd64

CBSD version ( cbsd version ): 12.0.8

So if I restart a VM from within the VM, the bhyve PID changes. Below is a example of that happening. Where the PID changes there is when issued the reboot command from within the VM.

[root@nibbles]0|/storage/cbsd>cbsd bls
JNAME    JID    VM_RAM  VM_CURMEM  VM_CPUS  PCPU  VM_OS_TYPE  IP4_ADDR        STATUS  VNC_PORT
centos0  92382  4096    324        2        31    linux       192.168.14.128  On      127.0.0.1:5900
win10    0      4096    0          1        0     windows     192.168.16.4    Off     0
[root@nibbles]0|/storage/cbsd>cps -p bhyve
PID   User CPU%  Mem% VM Size RSS    Info       Nice Start Time Command
92382 root 33.90 1.00 49908   333096 Ss+ kqread 0    21:25 18   bhyve: centos0
79956 root  0.00 0.01 12412     3432 Ss+ pause  0    21:25  0   csh -c /bin/sh /storage/cbsd/share/bhyverun.sh -c /storage/cbsd/jails-system/centos0/bhyve.conf -e 1
84962 root  0.00 0.01 12036     3060 Ss+ wait   0    21:25  0   /bin/sh /storage/cbsd/share/bhyverun.sh -c /storage/cbsd/jails-system/centos0/bhyve.conf -e 1
91485 root  0.00 0.01 10648     2116 Ss+ wait   0    21:25  0   /usr/bin/lockf -s -t0 /tmp/bhyveload.centos0.lock env LIB9P_LOGGING=/tmp/cbsd_lib9p.log /usr/bin/nice -n 0 /usr/sbin/bhyve -c cpus=2,so
[root@nibbles]0|/storage/cbsd>cps -p bhyve
PID   User CPU%  Mem% VM Size RSS    Info       Nice Start Time Command
 3282 root 28.40 0.95 49908   318196 Ss+ kqread 0    21:27 17   bhyve: centos0
79956 root  0.00 0.01 12412     3432 Ss+ pause  0    21:25  0   csh -c /bin/sh /storage/cbsd/share/bhyverun.sh -c /storage/cbsd/jails-system/centos0/bhyve.conf -e 1
84962 root  0.00 0.01 12036     3060 Ss+ wait   0    21:25  0   /bin/sh /storage/cbsd/share/bhyverun.sh -c /storage/cbsd/jails-system/centos0/bhyve.conf -e 1
 2347 root  0.00 0.01 10648     2116 Ss+ wait   0    21:27  0   /usr/bin/lockf -s -t0 /tmp/bhyveload.centos0.lock env LIB9P_LOGGING=/tmp/cbsd_lib9p.log /usr/bin/nice -n 0 /usr/sbin/bhyve -c cpus=2,so
[root@nibbles]0|/storage/cbsd>cbsd bls
JNAME    JID    VM_RAM  VM_CURMEM  VM_CPUS  PCPU  VM_OS_TYPE  IP4_ADDR        STATUS  VNC_PORT
centos0  92382  4096    0          2        0     linux       192.168.14.128  On      127.0.0.1:5900
win10    0      4096    0          1        0     windows     192.168.16.4    Off     0
@olevole olevole self-assigned this Apr 15, 2019
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Apr 15, 2019

Thanks! I'll take a look

olevole added a commit that referenced this issue Apr 15, 2019
Use CBSD task to run the deferred task for updating bhyve PID after launching.
This is the work-around for Issue #399
in fact, we need a separated daemon as a bhyve monitor for monitoring
bhyve process or /dev/vmm/ entry via kqueue.
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Apr 15, 2019

This is also true for live migration.

I added fast work-around for updating PID via 'cbsd task' ( you can see this task via 'cbsd taskls' ) - added special args for bset ( cbsd bset vm_pid=auto );
I plan to rewrite 'cbsdd' to beanstalkd-based broker sooner or later. It will solve some problems with
big amount of internal CBSD tasks (or multi-task).

@olevole olevole closed this Apr 15, 2019
olevole added a commit that referenced this issue Apr 15, 2019
it is not very important for offline vm, but important for live migrated vm
inspired by @VVelox via Issue #399
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.