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@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
See if "xm top" gives you what you need.
I am not using xen so I don't have xm installed.
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.
Using CentOS Xen current with the 5.4 update applied.
I need to move a Windows 2008 installation in LVM2 from one pv/vg/lv to different disk pv/vg/lv.
What are considered safe ways to move it on same machine and retain a copy until sure it reboots?
Turn off (shutdown) in Xen create identical extents in target pv/vg/lv and mount -t ntfs and cp? dd? rsync?
Or pvmove (doesn't look like it retains a copy)?
Is there an equivalent to AIX cplv?
Ben M. wrote:
Using CentOS Xen current with the 5.4 update applied.
I need to move a Windows 2008 installation in LVM2 from one pv/vg/lv to different disk pv/vg/lv.
What are considered safe ways to move it on same machine and retain a copy until sure it reboots?
Turn off (shutdown) in Xen create identical extents in target pv/vg/lv and mount -t ntfs and cp? dd? rsync?
Or pvmove (doesn't look like it retains a copy)?
Is there an equivalent to AIX cplv?
I always use dd when i need to 'move' a LV from one host to the other (can be of course used on the same host)
Ben M. wrote:
Using CentOS Xen current with the 5.4 update applied.
I need to move a Windows 2008 installation in LVM2 from one pv/vg/lv to different disk pv/vg/lv.
What are considered safe ways to move it on same machine and retain a copy until sure it reboots?
Turn off (shutdown) in Xen create identical extents in target pv/vg/lv and mount -t ntfs and cp? dd? rsync?
Or pvmove (doesn't look like it retains a copy)?
Is there an equivalent to AIX cplv?
If you haven't created a volumegroup on the new target disks, add those disks to the old volume group, execute pvmove on the old logical volume, when that's complete, execute vgsplit to create the new volume group. Pvmove is pretty robust, it can restart if it's been interrupted and can be aborted.
Glenn
I read the man on pvmove and it looks very cool, especially the "auto-continue" if there is some sort of system interruption. I plan to try this on a new, non-production machine I am building out, but need to do something right now on the Windows LV.
BUT, according to 'man pvmove' it doesn't have a switch to leave a copy behind, or the old extents in place for a fallback. That makes me a little apprehensive about having something ready to roll back to in its most current "data" state.
I don't think I am in the mood for this to be my first test case. haha. Feel's like a Murphy's Law morning.
RedShift wrote:
Ben M. wrote:
Using CentOS Xen current with the 5.4 update applied.
I need to move a Windows 2008 installation in LVM2 from one pv/vg/lv to different disk pv/vg/lv.
What are considered safe ways to move it on same machine and retain a copy until sure it reboots?
Turn off (shutdown) in Xen create identical extents in target pv/vg/lv and mount -t ntfs and cp? dd? rsync?
Or pvmove (doesn't look like it retains a copy)?
Is there an equivalent to AIX cplv?
If you haven't created a volumegroup on the new target disks, add those disks to the old volume group, execute pvmove on the old logical volume, when that's complete, execute vgsplit to create the new volume group. Pvmove is pretty robust, it can restart if it's been interrupted and can be aborted.
Glenn _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
----- "Ben M." centos@rivint.com wrote:
BUT, according to 'man pvmove' it doesn't have a switch to leave a copy behind, or the old extents in place for a fallback. That makes me a little apprehensive about having something ready to roll back to in its most current "data" state.
Right, it doesn't. To keep downtime minimal, you can shut down the windows guest, create an LVM snapshot of the guest's LV, boot the guest back up, dd from the snapshot to a new LV for your backup, remove the snapshot, and then pvmove. Be patient with pvmove, as it can take a while.
Thanks again Christopher, you continue to be a welcome source of help. Though I have some knowledge gaps on the veracity of snapshots on a "non-ext3" lv I am going to try this and am starting the snapshot.
Does this appear to be a sound procedure? I have one inline question.
1. Shutdown domU source (source lvname = win2k8-source) which is never file mounted in Xen dom0, just "lvm'd". 2. snapshot source win2k8-source to win2k8-snapshot
[How long do I wait before bringing DomU source back up? Is there in indication when it is done? It is approx. 50gig]
3. Bring up domU (Is this necessary if seeking accurate data state, would rather keep offline on a weekend dayrather than lose data entries.) 4. Create identical lv extent space (win3k8-target) on target pv/vg 5. dd if=/dev/vgsnapshotsource/win2k8-snapshot of=/dev/vgtarget/win2k8-target 6. Shutdown DomU, change xen win2k8-source domU conf file phy: reference to win2k8-target 6a. Drop snapshot, rename source lv to win2k8-old 7. Start "new" domU. 8. test extensively, if works, run for few a day or two. Keep *-old as fallback for a week or so. Then move to an archive using dd.
Christopher G. Stach II wrote:
----- "Ben M." centos@rivint.com wrote:
BUT, according to 'man pvmove' it doesn't have a switch to leave a copy behind, or the old extents in place for a fallback. That makes me a little apprehensive about having something ready to roll back to in its most current "data" state.
Right, it doesn't. To keep downtime minimal, you can shut down the windows guest, create an LVM snapshot of the guest's LV, boot the guest back up, dd from the snapshot to a new LV for your backup, remove the snapshot, and then pvmove. Be patient with pvmove, as it can take a while.
On Sat, Oct 24, 2009 at 11:14 AM, Neil Aggarwal neil@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
----- "Neil Aggarwal" neil@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.