Qiang Guan
2014-Jul-08 04:02 UTC
[libvirt-users] How to get uuid info inside a lxc container created by libvirt_lxc
Hi , Is there anyway to get uuid info inside a lxc container which is created by libvirt_lxc? For kvm, we can use dmidecode or lshw to get this info inside vm. Is there any tools to do this thing for libvirt lxc? Thanks for any help~ -- ------------ Jackie Best Regards
Eric Blake
2014-Jul-08 04:06 UTC
Re: [libvirt-users] How to get uuid info inside a lxc container created by libvirt_lxc
On 07/07/2014 10:02 PM, Qiang Guan wrote:> Hi , > > Is there anyway to get uuid info inside a lxc container which is created > by libvirt_lxc? > > For kvm, we can use dmidecode or lshw to get this info inside vm. Is > there any tools > to do this thing for libvirt lxc?Per the docs: http://libvirt.org/drvlxc.html#envvars pid 1 inside lxc inherits $container_uuid into its environment variables. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Qiang Guan
2014-Jul-08 04:19 UTC
Re: [libvirt-users] How to get uuid info inside a lxc container created by libvirt_lxc
于 2014年07月08日 12:06, Eric Blake 写道:> On 07/07/2014 10:02 PM, Qiang Guan wrote: >> Hi , >> >> Is there anyway to get uuid info inside a lxc container which is created >> by libvirt_lxc? >> >> For kvm, we can use dmidecode or lshw to get this info inside vm. Is >> there any tools >> to do this thing for libvirt lxc? > Per the docs: > http://libvirt.org/drvlxc.html#envvars > pid 1 inside lxc inherits $container_uuid into its environment variables.Thanks for help. But in my lxc container, It seems no such envvars existed: root@debian:~# ps auxf USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 10652 812 ? Ss 03:42 0:00 init [2] root 1317 0.0 0.4 9956 2572 ? Ss 03:42 0:00 dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0 root 1349 0.0 0.4 9956 2580 ? Ss 03:42 0:00 dhclient -v -pf /run/dhclient.eth1.pid -lf /var/lib/dhcp/dhclient.eth1.leases eth1 root 1493 0.0 0.2 49936 1212 ? Ss 03:42 0:00 /usr/sbin/sshd root 2701 0.0 0.7 71296 3708 ? Ss 04:10 0:00 \_ sshd: root@pts/1 root 2708 0.0 0.3 17876 2008 pts/1 Ss 04:10 0:00 \_ -bash root 3048 0.0 0.2 15308 1112 pts/1 R+ 04:16 0:00 \_ ps auxf root 1518 0.0 0.1 14580 868 pts/0 Ss+ 03:42 0:00 /sbin/getty 38400 console root@debian:~# set | grep uuid root@debian:~# echo $container_uuid root@debian:~# echo $LIBVIRT_LXC_UUID The version of libvirt I used is 1.1.4. Do this libvirt version support the lxc envvars feature?> -- > ------------ > Jackie > Best Regards