#disk info of host
hzguanqiang@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@debian:~$ vir version
Compiled against library: libvirt 1.1.0
Using library: libvirt 1.1.0
Using API: LXC 1.1.0
Running hypervisor: LXC 3.2.46
hzguanqiang@debian:~$ vir list
Id
Name
State
----------------------------------------------------
6096
instance-00000037
running
27981
instance-00000038
running
30846
instance-0000001a
running
hzguanqiang@debian:~$ vir
lxc-enter-namespace instance-00000037 /bin/df -hl
libvirt: error : argument unsupported:
Security model cannot be entered
hzguanqiang@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
Then I logged into the lxc container :
hzguanqiang@debian:~$ ssh -i id_rsa
ubuntu@10.160.70.2
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux
3.2.46-openstack-amd64 x86_64)
* Documentation:
https://help.ubuntu.com/
System information as of Wed Aug 7
10:49:35 UTC 2013
System load:
0.62
Processes:
31
Usage of /: 20.9% of
19.69GB Users logged in: 1
Memory usage:
51%
IP address for eth0: 10.160.70.2
Swap usage: 0%
Graph this data and manage this system at
https://landscape.canonical.com/
Get cloud support with Ubuntu Advantage
Cloud Guest:
http://www.ubuntu.com/business/services/cloud
Use Juju to deploy your cloud instances
and workloads:
https://juju.ubuntu.com/#cloud-precise
Last login: Wed Aug 7 10:49:35 2013 from
10.160.70.3
ubuntu@lxc1:~$ df -hl
Filesystem
Size Used Avail Use% Mounted on
/dev/loop2
20G 11G 8.3G 57% /
devfs
64K 8.0K 56K 13% /dev
tmpfs
64K 0 64K 0%
/sys/fs/cgroup
none
4.8G 6.4M 4.8G 1% /run
none
5.0M 0 5.0M 0% /run/lock
none
24G 0 24G 0%
/run/shm