[libvirt] libvirt and physical hardware devices

Greetings. I am interested in finding out what kinds of physical hardware data can be pulled out of libvirt at present. In particular, I'm interested in sourcing: 1. All the processor information that would be revealed from /proc/cpuinfo -cpu # -core # -# cores total -model -family -cpuid_lvl -speed -cache -vendor -flags 2. The following network device paramters: -interface name -mac address -current ip address -current netmask -current broadcast -current link bandwidth This post (https://www.redhat.com/archives/libvir-list/2009-June/msg00236.html) seemed promising at least wrt. network stuff, and I was wondering if it ever went anywhere. So my overall questions: 1. Is this data (specifically, all of it) tracked and exposed by libvirt at present? 2. If not, are there any plans to do so? I know it is possible to find out this data using /proc/cpuinfo and the various socket ioctls, but would like to avoid relying on those if possible. Thanks, -Arjun Roy

Arjun Roy wrote:
Greetings.
I am interested in finding out what kinds of physical hardware data can be pulled out of libvirt at present. In particular, I'm interested in sourcing:
1. All the processor information that would be revealed from /proc/cpuinfo -cpu # -core # -# cores total -model -family -cpuid_lvl -speed -cache -vendor -flags
Some of this info is presented. See the output of 'virsh nodeinfo' and the <host> section in 'virsh capabilities'. Some of the missing pieces here like cpu flags need to be exposed though (for application migration checks, etc.) The place to put it at this point is likely in capabilities.
2. The following network device paramters:
-interface name -mac address -current ip address -current netmask -current broadcast -current link bandwidth
This post (https://www.redhat.com/archives/libvir-list/2009-June/msg00236.html) seemed promising at least wrt. network stuff, and I was wondering if it ever went anywhere.
All this is slated to be integrated into libvirt by the end of the month AFAIK. - Cole

On 07/08/2009 05:01 PM, Arjun Roy wrote:
Greetings.
I am interested in finding out what kinds of physical hardware data can be pulled out of libvirt at present. In particular, I'm interested in sourcing:
1. All the processor information that would be revealed from /proc/cpuinfo -cpu # -core # -# cores total -model -family -cpuid_lvl -speed -cache -vendor -flags
2. The following network device paramters:
-interface name -mac address -current ip address -current netmask -current broadcast -current link bandwidth
This post (https://www.redhat.com/archives/libvir-list/2009-June/msg00236.html) seemed promising at least wrt. network stuff, and I was wondering if it ever went anywhere.
So my overall questions: 1. Is this data (specifically, all of it) tracked and exposed by libvirt at present?
For networking, the first two items will be available in the next release of libvirt. The last 4 are not. Yet.
2. If not, are there any plans to do so?
Yes, the discussion you point to petered out due to everybody being pre-occupied (it may have continued longer on the netcf mailing list), but it's definitely intended to go in. If I recall correctly, the plan is to add that functionality to netcf, then publish it via libvirt's RPC. lutter - am I remembering correctly?

On Wed, Jul 08, 2009 at 05:01:48PM -0400, Arjun Roy wrote:
Greetings.
I am interested in finding out what kinds of physical hardware data can be pulled out of libvirt at present. In particular, I'm interested in sourcing:
1. All the processor information that would be revealed from /proc/cpuinfo -cpu # -core # -# cores total -model
Yes
-family -cpuid_lvl
Don't have these two
-speed
Yes
-cache -vendor -flags
Dont have these three (well a couple of flags, but certainly not all).
2. The following network device paramters:
-interface name -mac address -current ip address -current netmask -current broadcast -current link bandwidth
The virInterface APis will have everything except link bandwidth. Not sure where you get that info from, but we could add it Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On 07/09/2009 05:46 AM, Daniel P. Berrange wrote:
-family -cpuid_lvl
Don't have these tw
-cache -vendor -flags
Dont have these three (well a couple of flags, but certainly not all).
Are there any plans to add it? The information is tracked by ovirt, and it would be nice to not have to regex scrape the output from /proc/cpuinfo :)
The virInterface APis will have everything except link bandwidth. Not sure where you get that info from, but we could add it
Sounds good - which release of libvirt will have all of that, and when? The link bandwidth is as reported by ethtool - the exotic "SIOCETHTOOL" ioctl. A quick snippet: struct ifreq ifr; struct ethtool_cmd ecmd; ecmd.cmd = ETHTOOL_GSET; ifr.ifr_data = (caddr_t)&ecmd; int ret = ioctl(sock, SIOCETHTOOL,&ifr); if (ecmd.supported& SUPPORTED_10000baseT_Full) { ... } etc. -Arjun
participants (4)
-
Arjun Roy
-
Cole Robinson
-
Daniel P. Berrange
-
Laine Stump