Hello: I have a host running two KVM guests. The guests use br0 and each has a static IP address. I am trying to figure out if there is a way to use snmpd on the host to measure the traffic usage of the guests. I do not want to require anything running on the guests since I do not control them. Looking at netstat -in on the host, I see this info: Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg br0 1500 0 237609 0 0 0 13615 0 0 0 BMRU eth0 1500 0 967594 0 0 0 354576 0 0 0 BMRU lo 16436 0 63 0 0 0 63 0 0 0 LRU virbr0 1500 0 0 0 0 0 32 0 0 0 BMRU vnet0 1500 0 29802 0 0 0 306940 0 0 0 BMRU vnet1 1500 0 311556 0 0 0 789331 0 0 0 BMRU Looking at the firewall logs for packets that hit the firewall, I see that vnet1 is connected to guestA and vnet0 is connected to guestB. Is there a better way to determine which vnet is connected to which guest? Also, does the mapping change when I stop and start guests or reboot the host? Thanks, Neil -- Neil Aggarwal, (281)846-8957, www.JAMMConsulting.com Will your e-commerce site go offline if you have a DB server failure, fiber cut, flood, fire, or other disaster? If so, ask about our geographically redundant database system.
See if "xm top" gives you what you need. Neil Aggarwal wrote:> Hello: > > I have a host running two KVM guests. The guests > use br0 and each has a static IP address. > > I am trying to figure out if there is a way to > use snmpd on the host to measure the traffic > usage of the guests. I do not want to require > anything running on the guests since I do not > control them. > > Looking at netstat -in on the host, I see this > info: > > Kernel Interface table > Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP > TX-OVR Flg > br0 1500 0 237609 0 0 0 13615 0 0 0 > BMRU > eth0 1500 0 967594 0 0 0 354576 0 0 0 > BMRU > lo 16436 0 63 0 0 0 63 0 0 0 > LRU > virbr0 1500 0 0 0 0 0 32 0 0 0 > BMRU > vnet0 1500 0 29802 0 0 0 306940 0 0 0 > BMRU > vnet1 1500 0 311556 0 0 0 789331 0 0 0 > BMRU > > Looking at the firewall logs for packets that hit the firewall, > I see that vnet1 is connected to guestA and vnet0 is connected to > guestB. > > Is there a better way to determine which vnet is connected to > which guest? > > Also, does the mapping change when I stop and start guests > or reboot the host? > > Thanks, > Neil > > -- > Neil Aggarwal, (281)846-8957, www.JAMMConsulting.com > Will your e-commerce site go offline if you have > a DB server failure, fiber cut, flood, fire, or other disaster? > If so, ask about our geographically redundant database system. > > _______________________________________________ > CentOS-virt mailing list > CentOS-virt at centos.org > http://lists.centos.org/mailman/listinfo/centos-virt >
On Sat, Oct 24, 2009 at 11:14 AM, Neil Aggarwal <neil at jammconsulting.com> wrote:> Hello: > > I have a host running two KVM guests. ?The guests > use br0 and each has a static IP address.> Is there a better way to determine which vnet is connected to > which guest?I recently learned about a series of virt-xxx commands from a kvm expert. One of the commands, virt-top, will show which vnet is connected to which guest. However, this is not included in the distro. It can be downloaded from: http://et.redhat.com/~rjones/virt-top/ OR EPEL The screenshots page shows a network interface view (press 2 to display it once virt-top is started). Akemi
Christopher G. Stach II
2009-Oct-25 07:30 UTC
[CentOS-virt] Need info on vnet mapping to guests
----- "Neil Aggarwal" <neil at JAMMConsulting.com> wrote:> I am trying to figure out if there is a way to > use snmpd on the host to measure the traffic > usage of the guests. I do not want to require > anything running on the guests since I do not > control them.[...]> Is there a better way to determine which vnet is connected to > which guest?You can put ``virsh domname <domid>'' or just ``virsh list'' with some awk into an snmpd exec script to enumerate the vifs with their domain names.> Also, does the mapping change when I stop and start guests > or reboot the host?Domain IDs do change between guest reboots so you will have to key your graphs with the domain name and not the vif name. -- Christopher G. Stach II