540 likes | 823 Views
Linux Containers. Jason Arneil Solutions Architect e-DBA Ltd. Linux Containers. Types of Virtualisation. Linux Containers. Resource Management. Demo. jarneil.wordpress.com. @ jarneil. About Red Stack Technology. Virtualisation. Hardware Virtualisation. Software Virtualisation.
E N D
Linux Containers Jason Arneil Solutions Architect e-DBA Ltd
Linux Containers Types of Virtualisation Linux Containers Resource Management Demo
jarneil.wordpress.com @jarneil
Virtualisation HardwareVirtualisation SoftwareVirtualisation O/SPartitions
“containers can just be thought of as a collection of processes, separated from the main host processes via a set of resource namespaces and constrained via control groups resource tunables”
VM1 VM2 Guest O/S Guest O/S Container 1 Container 2 Virtual Machine Monitor Hypervisor O/S Virtulisation Driver Support Standard Host O/S Hardware Hardware
cpuset /cgroup/cpusetcpu /cgroup/cpucpuacct/cgroup/cpuacctmemory /cgroup/memorydevices /cgroup/devicesfreezer /cgroup/freezernet_cls/cgroup/net_cls blkio /cgroup/blkio
LXC is a userspace interface for the Linux kernel containment features.
lxc-create: No config file specified, using the default config/etc/lxc/default.confHost is OracleServer6.4Create configuration file /container/cont1/configDownloading release 6.latest for x86_64Loaded plugins: refresh-packagekit, securityol6_latest | 1.4 kB 00:00 ol6_latest/primary | 33 MB 00:04 ol6_latest 22589/22589 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package chkconfig.x86_64 0:1.3.49.3-2.el6_4.1 will be installed--> Processing Dependency: libc.so.6(GLIBC_2.2.5)(64bit) for package: chkconfig-1.3.49.3-2.el6_4.1.x86_64 --> Processing Dependency: libc.so.6(GLIBC_2.8)(64bit) for package: chkconfig-1.3.49.3-2.el6_4.1.x86_64 . .
Complete! Rebuilding rpm database Configuring container for Oracle Linux 6.4 Added container user:oraclepassword:oracle Added container user:rootpassword:root Container : /container/cont1/rootfs Config: /container/cont1/config Network : eth0 (veth) on virbr0 'oracle' template installed 'cont1' created
ls-lh/container/cont1/ -rw-r--r--. 1 root root 2.1K Nov 25 09:06 config-rw-r--r--. 1 root root 195 Nov 25 09:06 fstabdr-xr-xr-x. 21 root root 4.0K Nov 25 09:08 rootfs
root 2771 2748 0 4738 1164 0 10:04 pts/0 00:00:00 | \_ lxc-start -n cont1 root 2775 2771 0 4819 1496 0 10:04 ? 00:00:00 | \_ /sbin/init root 3005 2775 0 2291 604 0 10:04 ? 00:00:00 | \_ /sbin/dhclient -H cont1 -1 -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0 root 3028 2775 0 44888 1344 0 10:04 ? 00:00:00 | \_ /sbin/rsyslogd -i /var/run/syslogd.pid -c 5 root 3070 2775 0 16575 1160 0 10:04 ? 00:00:00 | \_ /usr/sbin/sshd root 3081 2775 0 1027 576 0 10:04 pts/1 00:00:00 | \_ /sbin/mingetty /dev/tty1 root 3083 2775 0 1027 572 0 10:04 pts/2 00:00:00 | \_ /sbin/mingetty /dev/tty2 root 3085 2775 0 1027 572 0 10:04 pts/3 00:00:00 | \_ /sbin/mingetty /dev/tty3 root 3087 2775 0 1027 576 0 10:04 pts/4 00:00:00 | \_ /sbin/mingetty /dev/tty4 root 3208 2775 0 1027 568 0 10:23 pts/5 00:00:00 | \_ /sbin/mingetty /dev/console
Tweaking configuration Copying rootfs... Updating rootfs... 'cont2' created