Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
OpenVZ Essentials
OpenVZ Essentials

OpenVZ Essentials: Create and administer virtualized containers on your server using the robust OpenVZ

eBook
€9.99 €14.99
Paperback
€18.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

OpenVZ Essentials

Chapter 1. Installing OpenVZ

In this chapter, we are going to explain what OpenVZ is and the system requirements we need to install OpenVZ on our system. Then we are going to walk through configuring yum to use the OpenVZ repo and install the vzkernel.

Finally, we are going to talk about installing additional packages to help manage containers on the node—vzctl to create, configure, and remove containers and vzquota to manage quotas.

What is OS-level virtualization?

OS-level virtualization is a type of virtualization that is kernel-based. It depends on a host OS to manage, create, and configure containers on the host server through a specialized kernel.

Another type of virtualization is bare bones virtualization; this type of virtualization differs from the OS-level virtualization by providing a small OS that is booted instead of a host OS such as Windows or Linux. This type of virtualization is used to reduce the resource overhead on the host OS.

What is OpenVZ?

OpenVZ is a OS-level virtualization software that allows you to run isolated, secured containers that use a modified version of the Linux kernel to split the physical server to allow you to run multiple isolated containers, sometimes also called virtual private servers, that act as their own independent servers and have their own properties that are:

  • Root account
  • Users
  • Filesystem and quotas
  • Processes
  • Memory limits
  • CPU quotas
  • Network configuration

Each of the containers shares the same hardware and resources from a single physical server called a node.

The operating systems on the server cannot be mixed; they must run the same operating system as the physical server. Since you are using Linux for OpenVZ, you can only install Linux containers, although you can use different distributions of Linux for each of your containers.

System requirements

For this book, you are going to use CentOS 6.5 as the distribution OS in all the examples. You can also follow RHEL6.5, Scientific Linux, or Debian 7 along with this book. At the time of this writing, the OpenVZ kernel version that is available is vzkernel 2.6.32 and will be the OpenVZ kernel that is used throughout the rest of this book.

For hardware specifications, the following are recommended:

  • IBM PC compatible computer
  • Intel Core i7, Xeon E7, and AMD Opteron
  • A minimum of 128 MB of RAM; 2 GB or more is recommended
  • A hard drive with at least 80 GB of space
  • A 10/100/1000 network card

For network specifications, the following are recommended:

  • A local area network for the server
  • A valid Internet connection
  • A valid IP address for the server
  • A valid IP address for each container

Note

Please note that the previously listed requirements are recommended to get you started with learning how to use OpenVZ. On a live server, you will want to increase the RAM and CPU as the number of your containers grows on the server. It is not unusual to see a server with three to four CPUs with two or more cores at 3.4 GHz per core and 90 GB of RAM.

The disk partition scheme

You will create a / partition for Centos 6.5 and a swap partition to manage the virtual memory on the server and a /vz partition to store the containers that are created on the server.

When installing your Linux distribution, you will want to configure your disk partition scheme to the following:

Partition

Size

/

4-12 GB

Swap

Twice the amount of RAM

/vz

Rest of the space on the drive

The yum configuration

First, we will start by adding the OpenVZ repo to the repos.d directory under /etc/yum/; you can do this by running the following command:

wget -P /etc/yum.repos.d/ http://ftp.openvz.org/openvz.repo

In the previous example, we use the wget command to download the openvz.repo file from ftp.openvz.org to install openvz.repo on your server.

Then, import the OpenVZ GPG key used to sign the packages by running the following command:

rpm --import http://ftp.openvz.org/RPM-GPG-Key-OpenVZ

In the previous example, we use the rpm command to import the GPG key for openvz.repo to validate the package as a signed package.

Installing vzkernel

Vzkernel is the core of OpenVZ; it is essentially a modified version of the Linux kernel that allows you to run containers on your server.

To install vzkernel, you will want to run the following command:

yum install vzkernel

In the previous example, we use the yum command with the install option to install vzkernel on our server.

Installing vzctl and vzquota

In this section, we are going to go over the additional tools that are needed to install the vzkernel. The tools are as follows:

  • vzctl: This is an OpenVZ utility tool that allows you to directly interface with the containers. You can use this utility to start, stop, suspend, destroy, and create containers. We will go over this utility and it's usage in more detail in a future chapter.
  • vzquota: This is an OpenVZ utility that allows you to configure disk quotas on your server. You can use this utility to initialize, turn quotas on, turn quotas off, set limits, and show quota stats. We will go over this utility and it's usage in more detail in a following chapter.

To install the utilities, you will need to run the following command:

yum install vzctl vzquota

In the previous example, we use the yum command to install the packages for vzctl, vzquota, and ploop on the server.

Restarting the server

The last step you need to perform is rebooting your server by executing the following command. When the server comes back up, your OpenVZ installation will be complete and you will have a running OpenVZ server.

shutdown -r now

Summary

In this chapter, we discussed what OpenVZ is and walked through the system requirements to install OpenVZ, including hardware and networking requirements. Finally, we walked through the steps needed to install OpenVZ—configuring yum, and installing the vzkernel and additional utilities: vzctl and vzquota.

In the next chapter, you are going to learn how to download and use OS templates to create containers on the server as well as how to create a container and set up the hostname, IP address, and DNS for it.

Left arrow icon Right arrow icon

Description

If you are a system administrator or Linux professional who wants to learn to set up, install, and manage OpenVZ containers on a server to implement OS-level virtualization, then this book is for you. Along with elementary knowledge of Linux programming, you need to have a conceptual understanding of system components and functions.

What you will learn

  • Set up OpenVZ for your server infrastructure
  • Download and configure OS templates for containers
  • Understand how to use Vzctl for container administration
  • Create and configure containers as per their utilization
  • Manage resources on your server
  • Install and manage webbased management software on the server
  • Manage multipleserver infrastructure with OpenVZ
  • Discover how to configure your containers effectively

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 11, 2014
Length: 110 pages
Edition : 1st
Language : English
ISBN-13 : 9781782167327
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Nov 11, 2014
Length: 110 pages
Edition : 1st
Language : English
ISBN-13 : 9781782167327
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 96.97
OpenVZ Essentials
€18.99
Mastering Proxmox
€35.99
Learning Docker
€41.99
Total 96.97 Stars icon

Table of Contents

7 Chapters
1. Installing OpenVZ Chevron down icon Chevron up icon
2. OS Templates and Creating Containers Chevron down icon Chevron up icon
3. OpenVZ Container Administration Chevron down icon Chevron up icon
4. Server Administration Using OpenVZ Chevron down icon Chevron up icon
5. Using OpenVZ Web Panel – Part One Chevron down icon Chevron up icon
6. Using OpenVZ Web Panel – Part Two Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(4 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
MoneyPit Mar 31, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If your use to Virtual Machines on Windows and Mac, such as VM Workstation or VMWare and you want to do something similar on the Linux side, then this book is for you. It helps your learn and create containers which are very similar to virtual machines. It covers the details of the free OpenVZ with tons of command line references. It also dedicates two chapters to a graphical user interface for managing these OpenVZ containers, or VPS's. Highly recommend this book if your interested in VPS for Linux.
Amazon Verified review Amazon
BT INC. Apr 09, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Prior to reading this book I had no knowledge whatsoever of OpenVZ and after reading the book, I feel very comfortable with how OpenVZ works and with what it can do. As a book for beginners it really does a nice job of starting at zero and building from there. Some books will assume certain knowledge on the user's part and leave out important details that are needed to configure something or get something running. This book doesn't do that at all. Having said that, if you are somewhat familiar with OpenVZ or are comfortable as a system admin then you might feel like some of the information is redundant and unnecessary. Those parts are obvious and easy to jump past without missing anything.As a book written for beginners to intermediate users it is a great starting point and it is very well written. It is organised well enough to be used as reference later on as well. Overall, if you're looking for a good introductory book to OpenVZ I recommend this book.
Amazon Verified review Amazon
Unimon Sep 30, 2021
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The publish date of this book is 2014. If you're an OpenVZ user, and apparently there aren't many these days despite the usefulness of the system, this book can serve as a handy reference, or if you want to nominate your spouse or kids as the control ops for your operation. OpenVZ is the open source that Virtuozzo is built on (the pay-for version that supports scaling and clustering). OpenVZ is still in Version 7 (10/2021) so surprisingly, this book is still very relevant.Seriously, OpenVZ is a very slick and comfortable-to-user container virtualization system. Some VPS vendors still use it. It is super light-weight, allowing you to get many Linux instances running on your hardware, which can be quite humble and still make use of OVZ.The book does not have information about installing OpenVZ, which is a good thing because if it did, it would already be totally obsolete.Instead, the book focuses on operations on a Virtual Machine in the course of it's life cycle. In this regard, there have been no significant changes over the past 7 years.What has changed drastically is how you obtain and install the software. Currently it comes in three major forms:(1) An instance you can buy in the AWS Marketplace. Spin it up, and you've got your own full-fledged virtualizer in the cloud.(2) OpenVZ version 7 - not your version 7 from 2014 when the book was written, the current release supports its' own distro of Linux: VzLinux.org (!!) When you download OpenVZ, it's already set up for you as a Linux system running OpenVZ v7 under VzLinux. Burn it onto bare metal, virtualize it under VirtualBox, boot it from a USB. There are crazy cool things you can do with this.(3) Virtuozzo is the pay-for version that can be clustered, and the storage scaled.This book will not teach you to do any of the things I've mentioned. It's an operator manual. But, if you're an advanced Linux hacker, you will find this a handy reference for the lightweight powerful tool that OpenVZ is. Think of it as LXC/LXD light.(3)
Amazon Verified review Amazon
Amazon Kunde Jun 16, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
It is a good book to begin with OpenVZ as a system administrator. It shows all the commands you need to create and configure a machine.Said that, what you are not going to find here is a deeper understading, for exemple:Why OpenVZ uses their own kernel?Who is involved in the development and how often would you find updates?How the UBC Parameters relate to each other?Am I able to change the UBC Parameter is real time?How that affects the machine?Can I use other filesystems or just ploop?vzdump.....Once you have learn the basic, you can use the book as a quick reference if you do not remember the exact parameter.p.s.: The "quota" command does not exist in the last version.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.