2023年1月6日 星期五

Detect if a VM is running in Google Compute Engine

Detect if a VM is running in Compute Engine

sudo dmidecode -s system-product-name | grep "Google Compute Engine"
這個需要 root 權限,實際上是去讀取 /sys/firmware/dmi/tables/DMI
用 strings /sys/firmware/dmi/tables/DMI | grep "Google Compute Engine" 也行

若程式沒有 root 權限,可以去讀取 /etc/hosts 有沒有包含 Added by Google 字樣
grep "Added by Google" /etc/hosts

沒有留言:

VMware ESXi 6.5 VMXNET3 known issue

VMware ESXi 6.5 VMXNET3 網卡在遇到 Linux Kernel >= 4.8 時, 會有不定時 Kernel panic 的問題,狀況是機器會自己重開機 ESXi 中的 Event 可以看到 The CPU has been disabled by t...