[libvirt] With different libvirt version, lxc-enter-namespace return Different Execution results.

Daniel P. Berrange berrange at redhat.com
Thu Aug 8 09:06:10 UTC 2013


On Thu, Aug 08, 2013 at 05:00:38PM +0800, hzguanqiang at corp.netease.com wrote:
> On 2013-08-08 16:53 , Daniel P. Berrange wrote:
> On Thu, Aug 08, 2013 at 03:56:35PM +0800, hzguanqiang at corp.netease.com wrote:
> > But when I did the same thing under libvirt of version 1.1.0 with debian host OS, the execution result changed:
> > 
> > #disk info of host
> > hzguanqiang at debian:~$ df -hl
> > Filesystem                                              Size  Used Avail Use% Mounted on
> > rootfs                                                  4.0G  1.6G  2.2G  42% /
> > udev                                                     10M     0   10M   0% /dev
> > tmpfs                                                   4.8G  468K  4.8G   1% /run
> > /dev/disk/by-uuid/12bb656b-4f80-4386-aa07-4bf90a3111b4  4.0G  1.6G  2.2G  42% /
> > tmpfs                                                   5.0M  4.0K  5.0M   1% /run/lock
> > tmpfs                                                   9.9G     0  9.9G   0% /run/shm
> > /dev/sda8                                               428G  112G  313G  27% /home
> > /dev/sda6                                               7.9G  159M  7.8G   2% /tmp
> > /dev/sda5                                                16G  2.7G   14G  17% /var
> > cgroup_root                                              24G     0   24G   0% /sys/fs/cgroup
> > /dev/nbd5                                               1.4G  851M  466M  65% /home/openstack/stack/data/nova/instances/eed45ccb-3707-4815-9ae4-c7a2f56adb64/rootfs
> 
> 
> > hzguanqiang at debian:~$ vir lxc-enter-namespace  instance-00000037 --noseclabel /bin/df -hl
> > Filesystem                                              Size  Used Avail Use% Mounted on
> > rootfs                                                  4.0G  1.6G  2.2G  42% /
> > udev                                                     10M     0   10M   0% /dev
> > tmpfs                                                   4.8G  468K  4.8G   1% /run
> > /dev/disk/by-uuid/12bb656b-4f80-4386-aa07-4bf90a3111b4  4.0G  1.6G  2.2G  42% /
> > tmpfs                                                   5.0M  4.0K  5.0M   1% /run/lock
> > tmpfs                                                   9.9G     0  9.9G   0% /run/shm
> > /dev/sda8                                               428G  112G  313G  27% /home
> > /dev/sda6                                               7.9G  159M  7.8G   2% /tmp
> > /dev/sda5                                                16G  2.7G   14G  17% /var
> > cgroup_root                                              24G     0   24G   0% /sys/fs/cgroup
> > /dev/nbd5                                               1.4G  851M  466M  65% /home/openstack/stack/data/nova/instances/eed45ccb-3707-4815-9ae4-c7a2f56adb64/rootfs
> 
> What does  'ls /proc/self/ns' show on the host ?
> 
> Also what is your guest XML configuration for 'intsance-0000000037' ?
> 
> 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 :|
> 
> 
> Hi Daniel,
> 
> The info you want to see are as following:
> 
> hzguanqiang at debian:~$ ls /proc/self/ns
> ipc  net  uts

That's your problem. The kernel you are running on is too old to support
attaching to the mount namespace. You need to see 'mnt' in the files
there, and also 'pid' and 'user' too for completeness.

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 :|




More information about the libvir-list mailing list