python调用libvirt_使用python libvirt获取运行域信息

这篇博客介绍了Python中Libvirt库的两个关键函数:virDomain::listDomainsID()和virDomain::info()。前者用于获取当前运行的域的整数ID列表,后者返回关于域的状态、最大内存、当前内存使用、虚拟CPU数量和CPU时间等信息。
摘要由CSDN通过智能技术生成

从文档:

http://www.libvirt.org/python.html

There is a couple of function who don't map directly to their C counterparts due to specificities in their argument conversions:

* virConnectListDomains is replaced by virDomain::listDomainsID(self) which returns a list of the integer ID for the currently running domains

* virDomainGetInfo is replaced by virDomain::info() which returns a list of

1. state: one of the state values (virDomainState)

2. maxMemory: the maximum memory used by the domain

3. memory: the current amount of memory used by the domain

4. nbVirtCPU: the number of virtual CPU

5. cpuTime: the time used by the domain in nanoseconds

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值