TWiki> CF Web>Linux>LinuxContainers (revision 3)EditAttach

Linux Containers

Many of CSCF's servers run using LXC (LinuX Containers) (see: http://en.wikipedia.org/wiki/LXC )

Here we document the most useful commands for working with these containers

Background information

Names of current container host servers

  • https://cs.uwaterloo.ca/cscf/student/hosts currently contains a list of many container hosts. To access the hostname use the domain ".cloud.cs.uwaterloo.ca" or ".storage.cs.uwaterloo.ca". (I'm currently not sure what difference ther is to using either). You might also be able to search Infoblox and find host names that way.
There is another page somewhere which lists what containers are on each host, but I cannot find that right now. When someone finds it, they should put it here.

Listing the containers on a server

  • lxc-ls

root@mc-cloud002-n1:# lxc-ls
bs002.student.cs.uwaterloo.ca  db2a.student.cs.uwaterloo.ca  mails.student.cs.uwaterloo.ca     postgres060.student.cs.uwaterloo.ca
bs004.student.cs.uwaterloo.ca  flexlm202.cscf.uwaterloo.ca   mysql070.student.cs.uwaterloo.ca  region.student.cs.uwaterloo.ca
bs004.student.cs.uwaterloo.ca  flexlm202.cscf.uwaterloo.ca    mysql070.student.cs.uwaterloo.ca                                            postgres060.student.cs.uwaterloo.ca
db2a.student.cs.uwaterloo.ca   mails.student.cs.uwaterloo.ca  postgres060.student.cs.uwaterloo.ca  region.student.cs.uwaterloo.ca

  • lxc-ls -l
root@mc-cloud002-n1:# lxc-ls -l
total 0
drwxr-xr-x 1 root root 56 Nov 13 16:52 bs002.student.cs.uwaterloo.ca
drwxr-xr-x 1 root root 56 Nov 15 12:47 bs004.student.cs.uwaterloo.ca
drwxr-xr-x 1 root root 56 Feb 11 17:26 db2a.student.cs.uwaterloo.ca
drwxr-xr-x 1 root root 56 Sep  5 21:57 flexlm202.cscf.uwaterloo.ca
drwxr-xr-x 1 root root 62 Oct  3 17:37 mails.student.cs.uwaterloo.ca
drwxr-xr-x 1 root root 56 Nov 29 15:23 mysql070.student.cs.uwaterloo.ca
drwxr-xr-x 1 root root 56 Aug 17 19:24 postgres060.student.cs.uwaterloo.ca
drwxr-xr-x 1 root root 56 Jul 19  2012 region.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:16 bs004.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Feb 11 17:19 db2a.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:16 flexlm202.cscf.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:16 mails.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:23 mysql070.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:16 postgres060.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:16 postgres060.student.cs.uwaterloo.ca
drwxr-xr-x 2 root root 0 Nov 29 15:16 region.student.cs.uwaterloo.ca

Get information about a container

  • lxc-info --name <container name>

a running system

root@mc-cloud002-n1:# lxc-info --name  mails.student.cs.uwaterloo.ca
state:   RUNNING
pid:      8331

a stopped system

root@mc-cloud002-n1:# lxc-info --name db2a.cloud.cs.uwaterloo.ca
state:   STOPPED
lxc-info: 'db2a.cloud.cs.uwaterloo.ca' is not running

Accessing the console

  • lxc-console --name <container name>
root@mc-cloud002-n1:# lxc-console --name mails.student.cs.uwaterloo.ca

Type <Ctrl+a q> to exit the console

Ubuntu 12.04 LTS mails tty1

mails login: 
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2013-04-05 - AdrianPepper
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback