14.7. Exposing downward metrics for virtual machines
As an administrator, you can expose a set of host and virtual machine (VM) metrics to a guest VM by enabling the downwardMetrics feature gate and configuring a downward metrics device. You can view these metrics by using the command line or the vm-dump-metrics tool.
On Red Hat Enterprise Linux (RHEL) 9, use the command line to view downward metrics.
The vm-dump-metrics tool is not supported on the Red Hat Enterprise Linux (RHEL) 9 platform.
14.7.1. Enabling or disabling the downward metrics feature gate in a YAML file リンクのコピーリンクがクリップボードにコピーされました!
To expose downward metrics for a host virtual machine, you can enable the downwardMetrics feature gate by editing a YAML file.
Prerequisites
- You must have administrator privileges to enable the feature gate.
-
You have installed the OpenShift CLI (
oc).
Procedure
Open the HyperConverged custom resource (CR) in your default editor by running the following command:
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnvChoose to enable or disable the downwardMetrics feature gate as follows:
To enable the
downwardMetricsfeature gate, add and then setspec.featureGates.downwardMetricstotrue. For example:apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: featureGates: downwardMetrics: true # ...To disable the
downwardMetricsfeature gate, setspec.featureGates.downwardMetricstofalse. For example:apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: featureGates: downwardMetrics: false # ...