Learning Proxmox VE
上QQ阅读APP看书,第一时间看更新

Virtualization with Proxmox VE

It is correct to ultimately understand containerization as a type of virtualization. However, here, we'll look first to conceptually distinguish a virtual machine from a container by focusing on contrasting characteristics.

Simply put, virtualization is a technique through which we provide fully-functional, computing resources without a demand for the resources' physical organization, locations, or relative proximity.

Virtualization technology allows us to share and allocate the resources of a physical computer with multiple execution environments. Without context, virtualization is a vague term. It encapsulates the abstraction of such resources as storage, networks, servers, desktop environments, and even applications from their concrete hardware requirements through software implementation solutions called hypervisors.

Virtualization thus affords us more flexibility, more functionality, and a significant positive impact on our budgets which are often realized with merely the resources we have at hand.

In terms of PVE, virtualization most commonly refers to the abstraction of all aspects of a discrete computing system from its hardware. In this context, virtualization is the creation, in other words, of a virtual machine or VM, with its own operating system and applications.

A VM may be initially understood as a computer that has the same functionality as a physical machine. Likewise, it may be incorporated and communicated with via a network exactly as a machine with physical hardware would. Put yet another way, from inside a VM, we will experience no difference from which we can distinguish it from a physical computer.

The virtual machine, moreover, hasn't the physical footprint of its physical counterparts. The hardware it relies on is, in fact, provided by software that borrows from the hardware resources of a host installed on a physical machine (or bare metal).

Nevertheless, the software components of the virtual machine, from the applications to the operating system, are distinctly separated from those of the host machine. This advantage is realized when it comes to allocating physical space for resources.

For example, we may have a PVE server running a web server, database server, firewall, and log management system—all as discrete virtual machines. Rather than consuming physical space, resources, and labor of maintaining four physical machines, we simply make physical room for the single Proxmox VE server and configure an appropriate virtual LAN as necessary.

In a white paper entitled Putting Server Virtualization to Work, AMD articulates well the benefits of virtualization to businesses and developers (https://www.amd.com/Documents/32951B_Virtual_WP.pdf):

Top 5 business benefits of virtualization:

Increases server utilization

Improves service levels

Streamlines manageability and security

Decreases hardware costs

Reduces facility costs

The benefits of virtualization with a development and test environment:

Lowers capital and space requirements

Lowers power and cooling costs

Increases efficiencies through shorter test cycles

Faster time-to-market

To these benefits, let's add portability and encapsulation: the unique ability to migrate a live VM from one PVE host to another—without suffering a service outage.

Proxmox VE makes the creation and control of virtual machines possible through the combined use of two free and open source technologies: Kernel-based Virtual Machine (or KVM) and (Quick Emulator (QEMU). Used together, we refer to this integration of tools as KVM-QEMU.

KVM

KVM has been an integral part of the Linux kernel since February 2007. This kernel module allows GNU/Linux users and administrators to take advantage of an architecture's hardware virtualization extensions; for our purposes, these extensions are AMD's AMD-V and Intel'sVT-X for the x86_64 architecture.

To really make the most of Proxmox VE's feature set, you'll therefore want to install on an x86_64 machine with a CPU that has integrated virtualization extensions. For a full list of AMD and Intel processors supported by KVM, visit Intel at http://ark.intel.com/Products/VirtualizationTechnology or AMD at http://support.amd.com/en-us/kb-articles/Pages/GPU120AMDRVICPUsHyperVWin8.aspx.

QEMU

QEMU provides an emulation and virtualization interface that can be scripted or otherwise controlled by a user.

Visualizing the relationship between KVM and QEMU

Without Proxmox VE, we could essentially define the hardware, create a virtual disk, and start and stop a virtualized server from the command line using QEMU.

Alternatively, we could rely on any one of an array of GUI frontends for QEMU (a list of GUIs available for various platforms can be found at http://wiki.qemu.org/Links#GUI_Front_Ends).

Of course, working with these solutions is productive only if you're interested in what goes on behind the scenes in PVE when virtual machines are defined. Proxmox VE's management of virtual machines, is itself, managing QEMU through its API.

Note

Managing QEMU from the command line can be tedious. The following is a line from a script that launched Raspbian, a Debian remix intended for the architecture of the Raspberry Pi, on an x86 Intel machine running Ubuntu. When we see how easy it is to manage VMs from Proxmox VE's administrative interfaces, we'll sincerely appreciate that relative simplicity:qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda ./$raspbian_img -hdb swap

If you're familiar with QEMU's emulation features, it's perhaps important to note that we can't manage emulation through the tools and features Proxmox VE provides—despite its reliance on QEMU. From a bash shell provided by Debian, it's possible. However, the emulation can't be controlled through PVE's administration and management interfaces.

OS Virtualization with Proxmox VE

Containers are another type of virtualization. Synonymous with OS virtualization, containers have enjoyed a recent renaissance. In contrast to VMs, containers share operating system components, such as libraries and binaries, with the host operating system; a virtual machine does not.

Visually contrasting virtual machines with containers

Tip

The container advantage

This arrangement potentially allows a container to run leaner and with fewer hardware resources borrowed from the host. For many authors, pundits, and users, containers also offer a demonstrable advantage in terms of speed and efficiency. (However, it should be noted here that as resources such as RAM and more powerful CPUs become cheaper, this advantage will diminish.)

The Proxmox VE container is made possible through LXC from version 4.0 onwards (it's made possible through OpenVZ in previous PVE versions). LXC is the third fundamental technology serving Proxmox VE's ultimate interest. Like KVM and QEMU, LXC (or Linux Containers) is an open source technology. It allows a host to run, and an administrator to manage, multiple operating system instances as isolated containers on a single physical host. Conceptually then, a container very clearly represents a class of virtualization, rather than an opposing concept. Nevertheless, it's helpful to maintain a clear distinction between a virtual machine and a container as we come to terms with PVE.

The ideal implementation of a Proxmox VE guest is contingent on our distinguishing and choosing between a virtual machine solution and a container solution.

Since Proxmox VE containers share components with the host operating system which offers advantages in terms of efficiency, this text will guide you through the creation of containers whenever the intended guest can be fully realized with Debian Jessie as our hypervisor's operating system without sacrificing features.

When our intent is a guest running a Microsoft Windows operating system, for example, a Proxmox VE container ceases to be a solution. In such a case, we turn, instead, to creating a virtual machine. We must rely on a VM precisely because the operating system components that Debian can share with a Linux container are not components that a Microsoft Windows operating system can make use of.