KVMゲスト内のホストCPU温度

KVMゲスト内のホストCPU温度

.NETを使用してlm_sensorsKVMゲストのホストCPU温度を検出しようとしています。

ホストではx86_pkg_temp_列カーネルモジュールが挿入されると、sysfs インターフェイスは/sys/class/thermal/thermal_zone*/temp必要な情報を公開します。

以下はsensors-detectホストシステムのスクリプト出力です。lm-sensors

$ sudo sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# System: LENOVO 20C60065TW [ThinkPad Edge E540] (laptop)
# Kernel: 4.8.8-200.fc24.x86_64 x86_64
# Processor: Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz (6/60/3)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Fedora 24を実行しているKVMゲストにカーネルモジュールを挿入することはできません。

[root@fedora ~]# modprobe -v x86_pkg_temp_thermal
insmod /lib/modules/4.8.8300.fc25.x86_64/kernel/drivers/thermal/x86_pkg_temp_thermal.ko.xz 
modprobe: ERROR: could not insert 'x86_pkg_temp_thermal': No such device
[root@fedora ~]# modprobe -v coretemp
insmod /lib/modules/4.8.8-300.fc25.x86_64/kernel/drivers/hwmon/coretemp.ko.xz 
modprobe: ERROR: could not insert 'coretemp': No such device

ゲストのスクリプト出力は、sensors-detectホストがまだそのような機能を公開していないことを示します。

[root@fedora ~]# sensors-detect 
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# System: QEMU Standard PC (i440FX + PIIX, 1996) [pc-i440fx-2.6]
# Kernel: 4.8.8-300.fc25.x86_64 x86_64
# Processor: Westmere E56xx/L56xx/X56xx (Nehalem-C) (6/44/1)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

KVMゲストに「インテルデジタルサーマルセンサー」を公開する方法はありますか?

ベストアンサー1

仮想化CPUでは温度が発生しないようにしてください。これは予想される動作です。

VM の CPU は仮想なので、実際の CPU に正確に 1 対 1 にマップされないことがあります。

また、仮想環境/VMには、ホスト環境の完全なエミュレーションが見つからないと予想され、パフォーマンス上の理由から望ましくない場合があると予想される違い/トレードオフがあります。

たとえば、一部の仮想化プラットフォームでは、ハードウェア全体をエミュレートするのではなく、ネットワークインターフェイスカードとディスクコントローラを半仮想化するための追加の努力が必要です。パフォーマンスの違いはしばしば数十倍に達する可能性があります。

ホストのハードウェアデータ(温度やその他の監視データなど)をキャプチャするには、仮想マシンの監視に加えて、SNMPサービス設定などのホストを直接監視することをお勧めします。

おすすめ記事