Watch on Instagram

Network Bytes · Episode 78 · CCNA 1.12

"Virtual machines and hypervisors"

A virtual machine (VM) is a software computer with its own operating system, apps and IP address, running on a shared physical server. The hypervisor shares out the server's real processor, memory and storage between the VMs and keeps them isolated, and a virtual switch connects the VMs to each other and to the physical network.

Posted · About a 1 minute watch, 4 minute read · Take the quiz

Why split a server?

Most physical servers spend much of their time mostly idle: one application rarely needs all of a modern server's processor and memory. Virtualization puts that spare capacity to work by running many smaller computers on one big machine. Think of an apartment building on one plot of land: one building, many separate homes. Fewer physical boxes means less space, power and cooling, and a new server can be created in minutes instead of being bought and racked.

Each apartment is a virtual machine

A virtual machine behaves like a real computer. It has its own operating system (the guest OS), its own apps and its own IP address, for example 10.0.0.21, 10.0.0.22 and 10.0.0.23. From the network's point of view, each VM looks like a separate host. Inside the VM, the operating system sees virtual hardware (a virtual CPU, virtual memory, a virtual disk and a virtual network card) and usually has no idea it shares a box with neighbors.

The hypervisor is the building manager

The hypervisor (also called a virtual machine monitor) is the software that runs the VMs. It:

  • shares out the real processor, memory and storage between the VMs
  • isolates each VM, so one VM cannot read another's memory or crash its neighbors
  • starts, stops and moves VMs

There are two kinds. A type 1 (bare-metal) hypervisor runs directly on the server hardware, which is the picture in the video and the usual choice in data centers. A type 2 (hosted) hypervisor runs as an app on top of a normal operating system, handy for a lab on your laptop.

The virtual switch

VMs need a network too. Inside the server, a virtual switch (vSwitch) connects the VMs' virtual network cards to each other, just like a physical switch connects real computers. Traffic between two VMs on the same server can stay inside the virtual switch. Traffic for the outside world leaves through the server's real network card (NIC) to a physical switch. Often the uplink to that physical switch is a trunk carrying several VLANs, so different VMs can sit in different VLANs.

Try it yourself

If you have a laptop with spare memory, install a free type 2 hypervisor and create a small Linux VM. Open its settings and look at how much memory and how many processor cores you gave it, and at its network adapter mode (NAT or bridged). Then run ip addr inside the VM and ipconfig or ip addr on your laptop: the VM has its own IP address, separate from the laptop's.

Good to know

  • A hypervisor (virtual machine monitor) runs virtual machines and allocates the host's CPU, memory, storage and network to them while isolating them from each other.
  • Type 1 (bare-metal) hypervisors run directly on the hardware; type 2 (hosted) hypervisors run on top of a normal operating system. The video shows the bare-metal picture without naming the types.
  • "Ten computers" is an example; how many VMs fit depends on the hardware and the workloads.
  • Real hypervisors can overcommit memory (promise VMs more memory in total than the server has, betting they will not all use it at once), and the hypervisor needs some memory for itself. The comment question deliberately ignores both.
  • A virtual switch (vSwitch) connects VMs to each other and to the host's physical NICs.
  • CCNA 1.12 also lists containers and VRFs, which this short leaves for later.
  • 10.0.0.x addresses are private example addresses.

For CCNA learners

CCNA exam topic 1.12 Explain virtualization fundamentals (server virtualization, containers, and VRFs). For server virtualization, know what a VM is, what a hypervisor does (shares hardware, isolates VMs), the difference between type 1 and type 2, and that a virtual switch connects VMs to the physical network.

Answer to the comment question

12 virtual machines. The server has 96 GB of memory and each VM gets 8 GB, so 96 ÷ 8 = 12. A thirteenth VM would need 104 GB in total, more than the server has. (In real life the hypervisor keeps some memory for itself, so slightly fewer would fit, unless the hypervisor overcommits memory.)

Test your knowledge

Quick quiz: "Virtual machines and hypervisors"

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What is a virtual machine?
2What does the hypervisor do?
3Two VMs on the same server need to talk to each other. What connects them inside the server?
4Which kind of hypervisor runs directly on the server hardware?

Sources

Video transcript

How can one physical server act like ten separate computers?

Most servers sit mostly idle. So we split one big machine into many smaller ones, like an apartment building on one plot of land.

Each apartment is a virtual machine. It has its own operating system, its own apps and its own IP address, like a real computer.

The building manager is the hypervisor. It shares out the real processor, memory and storage, and keeps each one walled off from its neighbors.

Inside, a virtual switch connects the virtual machines to each other, and out through the server's real network card.

A server has ninety-six gigabytes of memory. Each virtual machine gets eight. Ignoring the hypervisor's own share, how many fit? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons