Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
OpenVZ Essentials
OpenVZ Essentials

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

By Mark Furman
$15.99 $10.99
Book Nov 2014 110 pages 1st Edition
eBook
$15.99 $10.99
Print
$24.99
Subscription
$15.99 Monthly
eBook
$15.99 $10.99
Print
$24.99
Subscription
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Nov 11, 2014
Length 110 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781782167327
Languages :
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

Key benefits

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

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


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

Table of Contents

13 Chapters
OpenVZ Essentials Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Installing OpenVZ Chevron down icon Chevron up icon
OS Templates and Creating Containers Chevron down icon Chevron up icon
OpenVZ Container Administration Chevron down icon Chevron up icon
Server Administration Using OpenVZ Chevron down icon Chevron up icon
Using OpenVZ Web Panel – Part One Chevron down icon Chevron up icon
Using OpenVZ Web Panel – Part Two Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.