Solved bhyve: more precise process name?

patpro

Active Member

Reaction score: 15
Messages: 230

Hello,

I'm running some VMs on bhyve and when I'm using top on the host, every VM shows as a bhyve process, is there anyway to get a more precise/informative designation?
(note: I'm using sysutils/vm-bhyve to handle/manage my VMs)
 

diego

Member

Reaction score: 28
Messages: 67

Hello,

I'm running some VMs on bhyve and when I'm using top on the host, every VM shows as a bhyve process, is there anyway to get a more precise/informative designation?
(note: I'm using sysutils/vm-bhyve to handle/manage my VMs)
I would recommend to install sysutils/py-glances tool....its just amazing.
You could install via pkg or pip (depending of your python version). Personally I prefer to use pip :)
Have a look an example running two VM's on my laptop:
Code:
CPU%   MEM%  VIRT  RES     PID USER          TIME+ THR  NI S  R/s W/s  Command
1.8    4.1   2.02G 334M  41097 root           1:08 12    0 S    0 0    bhyve: centos8
0.5    1.5   533M  122M  33809 root           0:06 11    0 S    0 0    bhyve: alpine
 
OP
patpro

patpro

Active Member

Reaction score: 15
Messages: 230

hmmm, just tested it, and I do prefer htop (way less messy), but in the end I would love the same info inside regular top :/
 

memreflect

Active Member

Reaction score: 167
Messages: 187

Hello,

I'm running some VMs on bhyve and when I'm using top on the host, every VM shows as a bhyve process, is there anyway to get a more precise/informative designation?
(note: I'm using sysutils/vm-bhyve to handle/manage my VMs)
top -a is what you want, though the output will definitely appear messy, especially since the position of what you're watching can disappear if your host creates many processes. Personally, I prefer cleaner output using ps(1):
Code:
ROOT# ps '-ocommand=' -p`pgrep -d, bhyve`
bhyve: debian (bhyve)
pgrep -d, bhyve will print a comma-separated list of PIDs for process names that contain the string "bhyve", just like grepping for "sh" would match "fish", "ksh", "bash", "zsh", "shell", etc. The PIDs are then used with the -p option of ps. Note that if pgrep(1) finds no such processes, then you'll see an error message from ps.

Note that top(1) does not allow you to watch 2 processes alone solely based on their process ID or process names. Thankfully, sysutils/htop supports the same comma-separated PID list that ps does and displays the entire argument vector like top -a, which means you can use htop -p`pgrep -d, bhyve`.
 
OP
patpro

patpro

Active Member

Reaction score: 15
Messages: 230

Thanks, top -a does the trick, like htop. Your command using ps is nice but I'm looking for a dynamic display and top -a is just what I need :)
 
Top