0%

判断虚拟机类型是VMware,AWS,Azure的方法

使用dmidecode,如下:

1
2
3
4
5
6
7
8
9
# AWS:
dmidecode -t system | grep Manufacturer
Manufacturer: Amazon EC2
# VMware:
dmidecode -t system | grep Manufacturer
Manufacturer: VMware, Inc
# Azure:
dmidecode -t system | grep Manufacturer
Manufacturer: Microsoft Corporation