PREETHI RAMESH
2011-Oct-07 11:28 UTC
[libvirt-users] Libvirt newbie, need help with doubts
Hi, These are my doubts: 1. I tried live migration of Ubuntu 11.04 from the one physical machine to another using the migrate() function. I connected via tcp in the destination URI and migrated successfully(lesser than 2 seconds). I tried running virsh list --all on the destination PM and confirmed that the VM had been migrated successfully. When I tried checking ps aux | grep vmname where vmname was the name of the VM migrated, I could see that on the source PM the thread was still active with the PID though the machine had been migrated successfully. Shouldn't the vmname not be listed at all on the source PM's side,if it has been completely migrated? Isn't 2 seconds too little(considering the memory allotted to the VM was 128MB and I'm using a 100Mbps LAN switch, time taken=size/speed~10 seconds). Why is virsh list --all showing me that the VM migrated to be shutdown on the source PM? If it's been completely migrated, shouldn't the entry be removed completely? 2. Is there any way to set the CPU limit in terms of % of CPU used on a VCPU using libvirt function? As in, if I want my VM to use just 10% of VCPU 1. 3. I'm developing an application in Java to monitor VM usage(Memory,CPU, Network etc). Are there any easily integrable graph plotting applications I could integrate with? Thanks for your time. Regards, Preethi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20111007/11dfad54/attachment.htm>
On 10/07/2011 05:28 AM, PREETHI RAMESH wrote:> Hi, > These are my doubts:I'll answer what I can, but you'll have to hope that others chime in as well.> > 1. I tried live migration of Ubuntu 11.04 from the one physical machine to > another using the migrate() function. I connected via tcp in the destination > URI and migrated successfully(lesser than 2 seconds). I tried running virsh > list --all on the destination PM and confirmed that the VM had been migrated > successfully. > > When I tried checking ps aux | grep vmname where vmname was the name of the > VM migrated, I could see that on the source PM the thread was still active > with the PID though the machine had been migrated successfully.That's odd - either the migration was still going on at the time of your ps, or something else went wrong. What version of libvirt are you using on source and destination? Migration should not complete until the qemu process on the source has gone away. Are you sure you were interpreting the ps listing correctly?> > Shouldn't the vmname not be listed at all on the source PM's side,if it has > been completely migrated? > > Isn't 2 seconds too little(considering the memory allotted to the VM was > 128MB and I'm using a 100Mbps LAN switch, time taken=size/speed~10 seconds).Not necessarily. Migration can go faster than the memory size if the source can prove that some of the memory is untouched, and can therefore convey that information to the destination without copying entire blocks of 0 over the line. That is, qemu can do some forms of compression to speed up migration.> > Why is virsh list --all showing me that the VM migrated to be shutdown on > the source PM? If it's been completely migrated, shouldn't the entry be > removed completely?You probably didn't specify 'virsh migrate --persistent --undefinesource' - the --persistent flag says to keep the guest definition persistent on the definition, and the --undefinesource says to remove the guest definition on the source (all on successful migration, of course). Without --persistent, the guest is transient; and without --undefinesource, 'virsh list --all' will still list the guest configuration on the source (and it is up to you to only run the guest on one of the two machines at a given time, although recent improvements in sanlock or fcntl lock managers can help prevent accidental running of the same guest from two machines).> > 2. Is there any way to set the CPU limit in terms of % of CPU used on a VCPU > using libvirt function? As in, if I want my VM to use just 10% of VCPU 1.To limit a guests' use of a VCPU, you have to do that within the guest. You probably meant to ask whether you can constrain a guest using 100% of its VCPU to only consume 10% of the physical CPU on the host that is providing the VCPU to the guest. And yes, with recent additions to the xml regarding cpu tuning, you can do something like that: http://libvirt.org/formatdomain.html#elementsCPUTuning> > 3. I'm developing an application in Java to monitor VM usage(Memory,CPU, > Network etc). Are there any easily integrable graph plotting applications I > could integrate with?Sorry, I can't answer this one. -- Eric Blake eblake at redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Forwarding to the list (this was mistakenly sent to just me) On 10/07/2011 11:32 AM, Mohammed Naser wrote:> On 2011-10-07, at 12:13 PM, Eric Blake<eblake at redhat.com> wrote: > >> On 10/07/2011 05:28 AM, PREETHI RAMESH wrote:>>> >>> 3. I'm developing an application in Java to monitor VM usage(Memory,CPU, >>> Network etc). Are there any easily integrable graph plotting applications I >>> could integrate with? >> >> Sorry, I can't answer this one. > > There is a plugin that collects resource details of libvirt for > collectd. I believe that collectd collects data in an RRD database and > I'm sure you can find an RRD charting library for Java. > >> >> -- >> Eric Blake eblake at redhat.com +1-801-349-2682 >> Libvirt virtualization library http://libvirt.org >> >> _______________________________________________ >> libvirt-users mailing list >> libvirt-users at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-users > > Regards, > Mohammed Naser > > Sent from my iPhone-- Eric Blake eblake at redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org