[libvirt-users] How to monitor a lxc container started by libvirt_lxc from inside ?

Hi Guys, When I created a lxc container by libvirt, I logged into the lxc container and noticed that info under /proc/ dir did not match the lxc container resource. Is the /proc dir in lxc container just showing the same thing as the lxc host? If I want to monitor the realtime resource usage inside the lxc container, What should I do? -------------- Best regards! GuanQiang 2013-07-23

On Tue, Jul 23, 2013 at 04:56:30PM +0800, hzguanqiang wrote:
Hi Guys, When I created a lxc container by libvirt, I logged into the lxc container and noticed that info under /proc/ dir did not match the lxc container resource. Is the /proc dir in lxc container just showing the same thing as the lxc host? If I want to monitor the realtime resource usage inside the lxc container, What should I do?
At this time, the only files in /proc that are virtualized are the /proc/$PID/* files for each process, and the /proc/meminfo global file. All the other files reflect global host state. Are there particular files in /proc/NNNN that you want to see virtualized in the future ? Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Hello. Can someone shed some light on the copy-storage-all feature? There are many hits on google. My current questions are. 1. is it possible to do a migrate --live --copy-storage-all .... without shared storage? 2. Do i need to have a preexisting image on the destination node? 3. Is this still true: The current implementation of --copy-storage-all uses a qemu interface that upstream qemu developers are reluctant to support, and risks running into problems. We have patches under review to use a new NBD server for migration when targeting qemu 1.4 with libvirt 1.0.2, with much less risk thanks and best regards t.

[please don't commandeer unrelated threads - when starting a new topic, make sure you are NOT setting in-reply-to] On 07/23/2013 06:33 AM, Thomas Stein wrote:
Hello.
Can someone shed some light on the copy-storage-all feature? There are many hits on google. My current questions are.
1. is it possible to do a migrate --live --copy-storage-all .... without shared storage?
Yes, that's the point of --copy-storage-all.
2. Do i need to have a preexisting image on the destination node?
I know there has been some work to get to the point of not having to pre-create images on the destination, but am not sure of the current state of that work. Fastest might be to just try it and see; the error message should be sane if it still isn't implemented.
3. Is this still true:
The current implementation of --copy-storage-all uses a qemu interface that upstream qemu developers are reluctant to support, and risks running into problems. We have patches under review to use a new NBD server for migration when targeting qemu 1.4 with libvirt 1.0.2, with much less risk
What version of libvirt and qemu are you using? Newer libvirt is indeed able to use NBD migration for a much cleaner result. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Am 23.07.13 15:22, schrieb Eric Blake:
[please don't commandeer unrelated threads - when starting a new topic, make sure you are NOT setting in-reply-to]
I'm sorry. You're right.
On 07/23/2013 06:33 AM, Thomas Stein wrote:
Hello.
Can someone shed some light on the copy-storage-all feature? There are many hits on google. My current questions are.
1. is it possible to do a migrate --live --copy-storage-all .... without shared storage?
Yes, that's the point of --copy-storage-all.
2. Do i need to have a preexisting image on the destination node?
I know there has been some work to get to the point of not having to pre-create images on the destination, but am not sure of the current state of that work. Fastest might be to just try it and see; the error message should be sane if it still isn't implemented.
3. Is this still true:
The current implementation of --copy-storage-all uses a qemu interface that upstream qemu developers are reluctant to support, and risks running into problems. We have patches under review to use a new NBD server for migration when targeting qemu 1.4 with libvirt 1.0.2, with much less risk
What version of libvirt and qemu are you using? Newer libvirt is indeed able to use NBD migration for a much cleaner result.
qemu-1.4.2 and libvirt-1.1.0. Do i have to use specific options for nbd migration? thank you thomas

On 07/23/2013 07:29 AM, Thomas Stein wrote:
The current implementation of --copy-storage-all uses a qemu interface that upstream qemu developers are reluctant to support, and risks running into problems. We have patches under review to use a new NBD server for migration when targeting qemu 1.4 with libvirt 1.0.2, with much less risk
What version of libvirt and qemu are you using? Newer libvirt is indeed able to use NBD migration for a much cleaner result.
qemu-1.4.2 and libvirt-1.1.0. Do i have to use specific options for nbd migration?
Libvirt automatically uses NBD migration if it is available, with no extra effort on your part. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 2013-07-23 18:14, "Daniel P. Berrange" <berrange@redhat.com> wrote:
On Tue, Jul 23, 2013 at 04:56:30PM +0800, hzguanqiang wrote: Hi Guys, When I created a lxc container by libvirt, I logged into the lxc container and noticed that info under /proc/ dir did not match the lxc container resource. Is the /proc dir in lxc container just showing the same thing as the lxc host? If I want to monitor the realtime resource usage inside the lxc container, What should I do?
At this time, the only files in /proc that are virtualized are the /proc/$PID/* files for each process, and the /proc/meminfo global file. All the other files reflect global host state.
Are there particular files in /proc/NNNN that you want to see virtualized in the future ?
Well, I used to monitor a kvm vm by a script reading info from files such as /proc/stat, /proc/loadavg, /proc/meminfo, /proc/diskstats, /proc/net/dev. Through those files under /proc, I can get the whole statistic info of the vm including cpu/memory/disk/net. If I want to do the same work in lxc supported by libvirt, How can I make it? BTW, I know virt-top can do such things. But what I want is a programming way such as libvirt interface. ------------------ Best regards! GuanQiang 2013-07-24

On 07/24/2013 10:28 AM, hzguanqiang wrote:
On 2013-07-23 18:14, "Daniel P. Berrange" <berrange@redhat.com> wrote:
On Tue, Jul 23, 2013 at 04:56:30PM +0800, hzguanqiang wrote: Hi Guys, When I created a lxc container by libvirt, I logged into the lxc container and noticed that info under /proc/ dir did not match the lxc container resource. Is the /proc dir in lxc container just showing the same thing as the lxc host? If I want to monitor the realtime resource usage inside the lxc container, What should I do?
At this time, the only files in /proc that are virtualized are the /proc/$PID/* files for each process, and the /proc/meminfo global file. All the other files reflect global host state.
Are there particular files in /proc/NNNN that you want to see virtualized in the future ?
Well, I used to monitor a kvm vm by a script reading info from files such as /proc/stat, /proc/loadavg, /proc/meminfo, /proc/diskstats, /proc/net/dev. Through those files under /proc, I can get the whole statistic info of the vm including cpu/memory/disk/net.
If I want to do the same work in lxc supported by libvirt, How can I make it?
/proc/net/dev has already been isolated, /proc/meminfo is virtualized through fuse filesystem. it's difficult to virtualize these proc files in kernel,I think if you want these files to be virtualized,you can achieve this in the same way we virtualize /proc/meminfo.

On 07/24/2013 10:28 AM, hzguanqiang wrote:
On 2013-07-23 18:14, "Daniel P. Berrange" <berrange@redhat.com> wrote:
On Tue, Jul 23, 2013 at 04:56:30PM +0800, hzguanqiang wrote: Hi Guys, When I created a lxc container by libvirt, I logged into the lxc container and noticed that info under /proc/ dir did not match the lxc container resource. Is the /proc dir in lxc container just showing the same thing as the lxc host? If I want to monitor the realtime resource usage inside the lxc container, What should I do?
At this time, the only files in /proc that are virtualized are the /proc/$PID/* files for each process, and the /proc/meminfo global file. All the other files reflect global host state.
Are there particular files in /proc/NNNN that you want to see virtualized in the future ?
Well, I used to monitor a kvm vm by a script reading info from files such as /proc/stat, /proc/loadavg, /proc/meminfo, /proc/diskstats, /proc/net/dev. Through those files under /proc, I can get the whole statistic info of the vm including cpu/memory/disk/net.
If I want to do the same work in lxc supported by libvirt, How can I make it? BTW, I know virt-top can do such things. But what I want is a programming way such as libvirt interface.
virt-top is the tool running on host, it's more like a manager tool. I believe these /proc/ files haven't been virtualized by lxc-tools too.

On 2013-07-24 12:01, Gao feng <gaofeng@cn.fujitsu.com> wrote:
On 07/24/2013 10:28 AM, hzguanqiang wrote: On 2013-07-23 18:14, "Daniel P. Berrange" <berrange@redhat.com> wrote:
On Tue, Jul 23, 2013 at 04:56:30PM +0800, hzguanqiang wrote: Hi Guys, When I created a lxc container by libvirt, I logged into the lxc container and noticed that info under /proc/ dir did not match the lxc container resource. Is the /proc dir in lxc container just showing the same thing as the lxc host? If I want to monitor the realtime resource usage inside the lxc container, What should I do?
At this time, the only files in /proc that are virtualized are the /proc/$PID/* files for each process, and the /proc/meminfo global file. All the other files reflect global host state.
Are there particular files in /proc/NNNN that you want to see virtualized in the future ?
Well, I used to monitor a kvm vm by a script reading info from files such as /proc/stat, /proc/loadavg, /proc/meminfo, /proc/diskstats, /proc/net/dev. Through those files under /proc, I can get the whole statistic info of the vm including cpu/memory/disk/net.
If I want to do the same work in lxc supported by libvirt, How can I make it? BTW, I know virt-top can do such things. But what I want is a programming way such as libvirt interface.
virt-top is the tool running on host, it's more like a manager tool. I believe these /proc/ files haven't been virtualized by lxc-tools too.
It seems that it's hard to do the same monitoring inside lxc as kvm. Then from outside, on host, are there any usable libvirt interface to obtain the lxc vm stat info? ------------------ Best regards! GuanQiang 2013-07-24
participants (5)
-
Daniel P. Berrange
-
Eric Blake
-
Gao feng
-
hzguanqiang
-
Thomas Stein