Skip to content

Fetaure Request: Check if running configuration is outdated #105

@okryvulia

Description

@okryvulia

vm list displays configured values instead of running. Mark vm name with asterisk when vm needs to be restarted due to pending configuration.

 # vm li
NAME             DATASTORE  LOADER  CPU  MEMORY  VNC           AUTO     STATE
vcloud-helpdesk  default    uefi    2    4G      -             No       Stopped
vcloud-ol10      default    uefi    2    4G      -             No       Stopped
vcloud-oradb*    default    uefi    8    128G    0.0.0.0:5900  No       Running (97531)
vcloud-pkg       default    uefi    8    64g     0.0.0.0:5901  Yes [1]  Running (20143)

Simple patch proposed

--- lib/vm-bhyve/vm-core.orig	2026-02-20 08:52:24.483446000 +0200
+++ lib/vm-bhyve/vm-core	2026-02-20 09:16:26.766863000 +0200
@@ -11,6 +11,7 @@
     local _memory _run _vm _auto _num _vnc _pid
     local _state _pcpu _rss _uptime
     local _format="%s^%s^%s^%s^%s^%s^%s^%s\n"
+    local _cfg_newer
 
     while getopts rv _opt ; do
         case ${_opt} in
@@ -98,6 +99,12 @@
                         continue
                     fi
                 fi
+
+		# check if vm configuration is newer than running
+		_cfg_newer=$(find ${VM_DS_PATH}/${_name} -name ${_name}.conf -newer /dev/vmm/${_name} 2>/dev/null)
+		if [ ${_cfg_newer} ];  then
+		    _name=${_name}"*"
+		fi
 
                 if [ -n "${VM_OPT_VERBOSE}" ]; then
                     printf "${_format}" "${_name}" "${_ds}" "${_loader}" "${_cpu}" "${_memory}" "${_vnc}" "${_auto}" "${_pcpu}" "${_rss}" "${_uptime}" "${_run}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions