Saturday, January 9, 2016

What are Containers?

Virtualization based technologies has been existed from long time now. A Hypervisor or virtual machine Monitor is a piece of computer software, firmware or hardware that creates and run virtual machines. Generally a hypervisor emulates the hardware; it allows running different types of operating system. Each Operating system running will have its own kernel. The guest and Host machine will have its own kernel and the communication between these is done by a abstracted layer of the hypervisor.

In other words a VM is an abstraction of a physical hardware. Each VM has a full server stack from virtualized network adapters to storage, and CPU. This entire hardware stack means that each VM needs a Complete OS. . Each VM instantiation requires starting a full OS.
The above diagram illustrates the way the hypervisor works. This approach generally provides a high level of security between the Host and Guest. The only disadvantage with this approach is that this approach is also usually slower and incurs significant performance overhead due to the hardware emulation.

In order to overcome this performance issues another type of virtualization was introduced called “container virtualization”. The main advantage with this over normal virtualization is that it allows multiple user space instances (Containers) to run simultaneously using the same Host kernel.

So what exactly are containers?
A container is a product of Operating system virtualization which are light weight. These containers groups a set of process and resources like CPU, memory, Disk etc from the host and other containers. This guarantees that the processes running in one container cannot see any process or use any resources outside of the container.

In the containers level, instead of virtual zing the entire server hardware stack, container abstraction occurs at the OS level. In most container systems, the user space is abstracted. That is each user space shares the same OS including the Kernel, Network connection and file system. Since multiple containers use the same Host hardware, the overhead associated with virtualization will not be here.
The above image explains the way the containers works.

Though containers provide us with many benefits over virtuals we do have certain limitations using containers.

1) Type of the Containers – Since the containers will be using the Host Operating system, we cannot create a container with different Operating systems. That is a windows Containers cannot be created on a Linux Host machine since the Kernel is shared.

2) Isolation and security – The isolation and security is not strong since the containers will be using the same Host kernel space.

3) Management – managing of the Containers is still somewhat complex

Where are containers used?
Containers now days are mostly used in a application packing mechanism. There are other types of containers called as Host containers.

Host Containers – Generally Os containers are virtual environments that share the kernel of the host Operating system but provide user space isolation. These can be in other words taught as a Virtual machines. OS containers are useful when you want to run a fleet of identical or different flavors of distros.

Application package Containers – These are the main containers that we use mostly coz these are designed to package and run a single service. Technologies like Docker are used to create these application package containers.

In the next article we will see the more articles about creating containers. More to come, Happy learning.

No comments :

Post a Comment