POSIX-linux 编译安装libvirt依赖包;
1.yum install device-mapper-devel
2.yum install libpciaccess-devel
3.yum -y install libnl-devel
4.初步编译配置完成;
总结,通常系统情况下Ruiy维护的OS系统,在手动自定义编译libvirt时需添加的依赖包用如下yum -y install libpciaccess-devel libnl-devel device-mapper-devel;
5,一句话概括hypervisors
libvirt supports many different kinds of virtualization (often referred to as "drivers司机" or "hypervisors管理员")
linux 抓取硬件序列号
厂商在主板里烧入的序列号(SN)是唯一的,可以作为一台服务器的唯一索引。通过Linux下的dmidecode命令可以很方便地抓取到服务器的序列号。
但是由于各家厂商对SMBios的刷写规范不太一样,我们需要做一些兼容的操作。
简单总结了一下,见下表
厂商 一般抓取方法 Dell dmidecode -s system-serial-number HP dmidecode -s system-serial-number IBM dmidecode -s system-serial-number Huawei dmidecode -s system-serial-number(华为机架式服务器) 或 dmidecode -s baseboard-serial-number(华为刀片) |
用一段shell来覆盖所有的机型,如下:
get_sn(){ local mySN=`dmidecode -s system-serial-number | grep - v '#' `
if echo "${mySN}" | grep -qiE "^NotSpecified|^None|^ToBeFilledByO.E.M.|O.E.M." ; then
mySN=`dmidecode -s baseboard-serial-number`
fi
#对于RHEL4和CentOS4,dmidecode不支持-s参数,需要采用不同的SN获取方法
if grep -q 'release 4' /etc/redhat-release ; then
mySN=`dmidecode | grep -A5 'System Information' | grep 'Serial Number' | awk '{print $3}' | sed 's/^[ t]*//g' | sed 's/[ t]$//g' `
fi
echo $mySN
} |
希望对服务器运维有帮助
Not all hypervisors supported by libvirt require a running libvirtd
. If you want to connect to a VMware ESX/ESXi or GSX server then libvirtd
is not necessary. See the VMware ESX page for details
http://www.aikaiyuan.com/2900.html [db2 for centos]