Skip to main content

Containers Are Not Vms

Containers Are Not VMs.

VM (House)

  1. Full OS to Start with and strip away what's needed.
  2. Virtualization technology.
  3. Everything that sits on a physical Server and pack it in to a single portable binary.

Container (Apartment)

  1. Start with basic and add what's needed.
  2. Application delivery technology.
  3. The abstraction is the application, more specifically a service that helps to make up the application.

Containerization Basics.

Containers are isolated in a host using the two Linux kernel features called namespaces and control groups.

Namespaces
  1. There are six namespaces in Linux (mnt, IPC, net, usr etc.). 
  2. Using these namespaces a container can have its own network interfaces, IP address etc. 
  3. Each container will have its own namespace.
  4. The processes running inside that namespace will not have any privileges outside its namespace.

  • Control Groups
    1. The resources used by a container is managed by Linux control groups. 
    2. CPU and memory resource is assigned to a container using Linux control groups.

    Virtual Machine Basics.

    A VM is essentially an emulation of a real computer that executes programs like a real computer. 
    VMs run on top of a physical machine using a “hypervisor”. A hypervisor, in turn, runs on either a host machine or on “bare-metal”.
    VM On Hypervisor

    1. If one VM is running a more resource heavy application,  allocate more resources to that one than the other VMs running on the same host machine.(represented as fat in diagram)
    2. The VM that is running on the host machine (again, using a hypervisor) is also often called a “guest machine.” 
    3. This guest machine contains both the application and whatever it needs to run that application (e.g. system binaries and libraries). 
    4. It also carries an entire virtualized hardware stack of its own, including virtualized network adapters, storage, and CPU — which means it also has its own full-fledged guest operating system. 
    5. From the inside, the guest machine behaves as its own unit with its own dedicated resources. 
    6. From the outside, we know that it’s a VM — sharing resources provided by the host machine.


  • Hypervisor
    1. Well, since the VM has a virtual operating system of its own, the hypervisor plays an essential role in providing the VMs with a platform to manage and execute this guest operating system. 
    2. It allows for host computers to share their resources amongst the virtual machines that are running as guests on top of them.
    3. More variations to it, if using bare metal hypervisor--> here.
    References Used:
    1. https://blog.docker.com/2016/03/containers-are-not-vms/
    2. https://blog.mikesir87.io/2017/05/docker-is-not-a-hypervisor/
    3. https://devopscube.com/what-is-docker/
    4. https://medium.freecodecamp.org/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b
    5. https://blog.docker.com/2016/03/containers-are-not-vms/
    6. https://stackoverflow.com/questions/48251703/if-docker-runs-natively-on-windows-then-why-does-it-need-hyper-v


    Comments

    Popular posts from this blog

    What Are Containers And VMs ?

    What Are Containers And VMs Container Vs VMs: Containers and VM's are similar in their goals. They both eliminate the need for separate physical hardware. They both isolate an application and its dependencies into a self contained unit so that it can run anywhere. The difference is in the how i.e. the architectural Approach VM uses Hypervisor and guest OS, to accomplish it. Container uses name spaces  control groups etc.. to accomplish it. This allows more efficient use of computing resources Both in terms of energy consumption and cost effectiveness. References Used: https://blog.docker.com/2016/03/containers-are-not-vms/ https://blog.mikesir87.io/2017/05/docker-is-not-a-hypervisor/ https://devopscube.com/what-is-docker/ https://medium.freecodecamp.org/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b https://stackoverflow.com/questions/48251703/if-docker-runs-natively-on-windows-then-why-does-it-need-hyper-v <--Previous    

    Audience And Agenda

    Useful for, Developers. Infra Specialists. Dev/Sys Specialists. towards, Understanding what containers and VMs are. Subtle and sound differences between them. It is NOT, Focussed on any DEVOPS tool/technology. Focussed on any particular method/concept. Talking about advanced usage. Some Pre-requisites before you jump in, Idea of VM and Kernel concepts. Basic OS concepts and OSI. The first series of posts is about basics on VM and Container, Let's get started. Next-->

    Containers In Production

    Containers In Production. Questions That Arise: How do i back up my container ?. How do i patch my container ?. Where does my Application Server Run ? What do i do with my existing monolithic apps ?. References Used: https://blog.docker.com/2016/03/containers-are-not-vms/ https://blog.mikesir87.io/2017/05/docker-is-not-a-hypervisor/ https://devopscube.com/what-is-docker/ https://medium.freecodecamp.org/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b https://blog.docker.com/2016/03/containers-are-not-vms/ https://stackoverflow.com/questions/48251703/if-docker-runs-natively-on-windows-then-why-does-it-need-hyper-v <--Previous       Next-->