1 / 52

Linux Containers

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.

twelch
Download Presentation

Linux Containers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linux Containers Jason Arneil Solutions Architect e-DBA Ltd

  2. Linux Containers Types of Virtualisation Linux Containers Resource Management Demo

  3. jarneil.wordpress.com @jarneil

  4. About Red Stack Technology

  5. Virtualisation HardwareVirtualisation SoftwareVirtualisation O/SPartitions

  6. “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”

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

  8. Linux Containers

  9. 2.6.39-400.210.2.el6uek

  10. Why?

  11. Control Groups

  12. cgroup

  13. subsystem

  14. lssubsys -am

  15. cpuset /cgroup/cpusetcpu /cgroup/cpucpuacct/cgroup/cpuacctmemory /cgroup/memorydevices /cgroup/devicesfreezer /cgroup/freezernet_cls/cgroup/net_cls blkio /cgroup/blkio

  16. hierachy

  17. Name Spaces

  18. LXC

  19. LXC is a userspace interface for the Linux kernel containment features.

  20. lxc-create –n cont1 –t oracle -- --release=6.latest

  21. 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 . .

  22. 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

  23. templates

  24. 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

  25. lxc-start -n cont1 –d

  26. lxc-ls

  27. lxc-info –n cont1

  28. ps –elf --forest

  29. 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

  30. lxc-console -n cont1

  31. lxc-clone -o cont1 –n cont2

  32. Tweaking configuration Copying rootfs... Updating rootfs... 'cont2' created

  33. lxc-freeze -n cont1

  34. lxc-unfreeze -n cont1

  35. lxc-cgroup -n cont1 state-object

  36. lxc-shutdown -n cont1

  37. lxc-stop -n cont1

More Related