Container Instances – PaaS Compute Options

Containers took virtualization of computing resources to the next level. Virtual machines run on specialized software called hypervisors. In traditional virtualization, you used to create separate virtual machines for isolating environments. For example, if you needed to run a web server, you needed to create a Linux or Windows VM and then install Apache or IIS on top of that. If you needed multiple environments for testing purposes, you needed to create multiple virtual machines. The drawback with this approach is that the resource utilization will be high as the footprint of the VM is large. To understand the concept clearly, let’s take look at the comparison between container and virtual machines (refer to Table 9.2).

TABLE 9.2  Comparison Between Virtual Machines and Containers

FeatureVirtual MachinesContainers
IsolationStrong isolation is offered between different virtual machines and the host operating system.Lightweight isolation from other containers and host. Not offering a strong isolation as compared to VM.
Operating systemRuns a full-fledged operating system including kernel and all binaries.Customized with required services and runs only the user mode portion of an operating system.
FootprintRequires more resources as you are running a full-fledged operating system.Lightweight as you are only running the required binaries.
DeploymentUsing the hypervisor console. For example, Hyper-V Manager, VMware vCenter, etc.Deployed using a container runtime. For example, Docker. Further you can use orchestrators like Kubernetes.
Persistent storageUses a VHD for storing the OS files and data. File shares can be also mounted, which can be consumed by multiple VMs.Container storage is ephemeral. In Azure, you can use Azure Disks and Files to create persistent storage.
Fault toleranceVMs can fail over to another server in a cluster.Containers can be quickly re-created using orchestrators in case of a failure.
Deployment timeTakes two to three minutes on an average.Quick (mostly less than a minute).
Image sizeMost operating systems are in gigabyte size.Mostly in megabtye size.
Image sourceOfficial websites. In Azure you can use Microsoft-endorsed images, Marketplace images, and custom VM images.Images can be stored in Docker Hub, Azure Container Registry, and private repositories.

In Figure 9.11, you can see how virtual machines are different from containers from an architectural perspective.

Containers serve the same purpose of VMs, which is packaging your application along with all the required dependencies. The advantage is they are lightweight in size and can be used to test multiple applications quickly without the need to deploy multiple virtual machines. In the case of VMs, they are virtualized on top of a hypervisor running on the host operating system. However, in the case of containers, they are using a container runtime to run the containers. The container runtime is software that is running on the host machine like the hypervisor. Now that you are aware of the differences, let’s learn more about one of the popular container runtimes, Docker.

0 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms of Use | About | Privacy Policy | Cookies | Accessibility Help | Contact