[CentOS] How to list virt machine size with virsh?

Fri Dec 9 12:29:53 UTC 2011
Theo Band <theo.band at greenpeak.com>

On 12/09/2011 01:18 PM, James Hogarth wrote:
>> What I miss in that overview is the memory size of clients. I found
>> "virsh dominfo <client>" but that is for just that one client (and I
>> have several running).
>> The same question for "xm top". I found that there seems to exist
>> virt-top, but I could not find this in a repository for Centos5.
>>
> For the memory thing off the top of my head I can't think of anything
> in a single command... but a quick virsh list | awk '$2 ~ /running/
> {print $1}' | while read guest; do virsh dominfo $guest | grep
> memorything .... adapted slightly since that's untested and just
> quickly knocked out from rough memory shoudl help...
>
> With regards to virt-top that's on CentOS 6 .... for the underlying
> hosts you really want to be on C6 rather than C5 at this point due to
> much improved libvirt/kvm features - things like ksm and transparent
> huge pages are new and help... and then things like the newer
> scheduler and kernel is a bonus...
>
> Leave your guests on C5 or whatever they are on while you migrate
> sensibly... but there is no good reason for the hosts systems to be
> runnin C5 at this point... if you are only just starting to migrate
> form xen to kvm seriously get on C6 and do yourself a huge favour...

Funny I was thinking about a similar script line. Then I thought, this
is silly I must have overlooked the obvious. Let's ask the list :-)
The machine is dual bootable (Xen/Kvm). It serves as a backup for two
other machines running Xen (centos5). That's basically the only reason
I'm still on C5. I use drbd to mirror disks.
The best approach for me is to take a new machine with C6 and migrate on
there.

Theo