检测服务器是否是虚拟化,如KVM,VM等

1.执行如下,若无输出证明是物理机,如果输出如VMware,KVM等证明是虚拟的

复制代码
lscpu | grep Hypervisor

2.Manufacturer会输出厂商如戴尔等,不会输出Red Hat

复制代码
sudo dmidecode -t system

输出如下:

Manufacturer: Red Hat

Product Name: KVM

Version: RHEL 7.6.0 PC (i440FX + PIIX, 1996)

UUID: 480d3f2e-29c7-8a7a-f5e2-d2f9d719ac3f

正常输出如下:

dmidecode 3.2

Getting SMBIOS data from sysfs.

SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes

System Information

Manufacturer: Dell

Product Name: C6220

Version: Not Specified

Serial Number: 7HN6ML1

UUID: 4c4c4544-0031

Wake-up Type: Power Switch

SKU Number: N/A

Family: Server

Handle 0x001A, DMI type 15, 29 bytes

System Event Log

Area Length: 20176 bytes

Header Start Offset: 0x0000

Header Length: 32 bytes

Data Start Offset: 0x0020

Access Method: General-purpose non-volatile data functions

Access Address: 0x0000

Status: Valid, Not Full

Change Token: 0x12345678

Header Format: OEM-specific

Supported Log Type Descriptors: 3

Descriptor 1: POST memory resize

Data Format 1: None

Descriptor 2: POST error

Data Format 2: POST results bitmap

Descriptor 3: Log area reset/cleared

Data Format 3: None

Handle 0x0036, DMI type 32, 20 bytes

System Boot Information

Status: No errors detected

相关推荐
运维行者_6 小时前
企业无线网络监控的挑战与智能化演进趋势
大数据·运维·服务器·网络·数据库
2603_955279706 小时前
Cursor + GitOps:自动化运维新姿势
运维·自动化
Waay7 小时前
面试口述版:个人对 Prometheus 完整理解
运维·学习·云原生·面试·职场和发展·kubernetes·prometheus
三8447 小时前
文件查找/文件压缩/解压缩
linux·运维·服务器
小猪写代码7 小时前
Linux 管道(Pipeline)作业
linux·运维·服务器
桌面运维家7 小时前
如何用半缓存云桌面将服务器硬盘容量扩展至本地终端?
运维·服务器·缓存
Jurio.8 小时前
Codex App SSH 远程开发教程:本地连接远程服务器项目
服务器·ssh·远程工作·codex
激情的学姐8 小时前
【大型网站技术实践】初级篇:借助Nginx搭建反向代理服务器
运维·nginx
ai_coder_ai8 小时前
编写自动化脚本,在自己后端服务中使用Open Api进行设备相关操作
java·运维·自动化
会周易的程序员9 小时前
microLog 的本地日志读取接口 log_reader — 本地日志文件读取工具开发指南
linux·物联网·架构·嵌入式·日志·iot·aiot