Data centers, virtual machines and containers
Where does the server run?
A data center is a facility that houses computing equipment, network connections, power and cooling. A physical server is a real computer in that facility. A virtual machine (VM) is a software-defined computer with allocated hardware resources and its own guest operating system. A container runs an application with packaged dependencies, usually sharing the kernel of its host operating system. A kernel is the core of an operating system that manages hardware and processes.
Virtual machines and the operating system
An operating system, such as Linux, manages resources and lets applications run. Virtualization software called a hypervisor allocates virtual CPUs, memory and other devices to VMs. Imagine a physical host with 16 GiB of memory: two VMs each assigned 4 GiB could run a bookstore and an inventory application. This leaves 8 GiB before host overhead and other reservations; actual capacity depends on configuration. Each guest can run a separate supported operating system. A virtual private server (VPS) is commonly a rented VM-like server offering.
Containers package applications
An image is a template containing application code and needed files such as libraries. A running container is an instance of that image, with isolation and resource controls supplied by the runtime and operating system. Two ordinary Linux containers can run inside one Linux VM and share its kernel. This often reduces overhead compared with two complete guest operating systems, but the actual resource usage depends on the workloads. Portability requires a compatible kernel, runtime and CPU architecture.
Conceptual stack, not a measured deployment
Physical host Hypervisor Linux VM (guest kernel) Container A: bookstore Container B: inventoryChoose by requirements
If the bookstore and another service need different guest operating systems, separate VMs may fit. If they are compatible Linux apps with packaged dependencies, containers can simplify repeatable deployment. A container can run on a VM; these are not mutually exclusive options. Neither mechanism eliminates the need for updates, permissions, backups or monitoring. A host failure can affect everything placed on that host, so isolation alone is not high availability.
Practice: place two apps
Sketch two VMs on one physical host, each with its own operating system. Then sketch two Linux containers sharing one VM kernel. Label the boundaries and explain what happens if the physical host fails. Decide which design is appropriate if one app requires a Windows guest and the other a Linux guest. Next: learn how a cloud provider offers these resources.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Data centers, virtual machines and containers — knowledge check
Apply the concepts to the fictional bookstore and related scenarios.
Two applications require different guest operating systems. Which design directly accommodates that?
Two ordinary Linux containers run inside the same Linux VM. What do they share?
What is the purpose of an application image?
A 16 GiB host assigns 4 GiB to each of two VMs. What is the unassigned amount before overhead?
Two isolated VMs run on one physical machine. That machine loses power. What should you assume?