Search icon CANCEL
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
zł59.99 zł80.99
Paperback
zł100.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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
Table of content icon View table of contents Preview book icon Preview Book

OpenVZ Essentials

Chapter 2. OS Templates and Creating Containers

In the previous chapter, we went over how to set up and install OpenVZ. In this chapter, we are going to walk through the download of OS templates that we will be using as default templates for our containers. Then, we will discuss how to create the container itself and add the default configurations necessary to make the container operational.

These are the topics that we are going to cover in this chapter:

  • What are OS templates?
  • How to download templates to your server?
  • How to properly choose a container ID?
  • How to create a container?
  • How to set the hostname, IP address, and DNS server for the container?

Getting started with OS templates

OS templates are packed container files of a Linux distribution that we can use to quickly install a new container on our node. We can use multiple distributions of Linux on the OpenVZ node. We are not confined to use the same distribution that is installed on the server itself.

You cannot, however, use Windows templates because OpenVZ is an OS-level virtualization technology. The packaged files inside the template files contain everything that is needed to run the container, including boot files, libraries, and system utilities.

Downloading OS templates

Two ways to download OS templates are explained in this section—one method is by using vztmpl-dl and the other method is a manual method.

Using vztmpl-dl to download OS templates

OpenVZ comes with a tool named vztmpl-dl that can help you download OS templates easily and effectively. You will use two options with vztmpl-dl, which are explained as follows:

  • vztmpl-dl --list-remote: This command will provide...

Selecting an OS template

After figuring out what CTID you would like to use for your container, the next step is to choose the OS template that you want to use for your container. In the Downloading OS templates section, we chose to use the OS template for CentOS 6 for our example. You can list the available templates by using ls on the /vz/template/cache directory.

Creating a container

After selecting which OS template you are going to use, you need to create a container in the next step. To create the container, you will need to use the vzctl create command. In order to use the vzctl create command, you have to supply the command with arguments for both the container ID that you chose (101) and also the OS template that you chose (centos-6-x86.tar.gz). You will also use the basic configuration file for the installation (ve-basic.conf-sample). We will talk more about this file shortly.

To create the VPS container, perform the following steps:

  1. Firstly, execute the following command:
    vzctl create...

Container configuration

The final steps that we need to take are to configure our new container to start up on boot. So, when we reset the server, the containers will automatically boot. We also need to configure the network settings for the container: hostname, IP address, and name server information. Finally, we will need to provide the container with a root password.

To configure these settings, we will use the vzctl set command. This command will allow you to add, remove, and modify configuration settings inside the container's conf file, which is located at /etc/vz/conf/ and named 101.conf.

Configuring a container to start on boot

We will use vzctl set to modify the onboot option inside the container's config file which will be set to yes using the --onboot flag. This will allow the container to automatically boot when the node is restarted. We will also use the --save flag to tell the command to save the changes to the configuration file.

To set the onboot option to yes, use...

Summary

In this chapter, we learned how to download an OS template that we can use to quickly create a VPS container that is using CentOS, Fedora, Scientific Linux, SUSE, Debian, or Ubuntu. We also learned how to use the vzctl create command to create a VPS container on the node.

Finally, we learned about the vzlist command that can list the VPS containers that are created on the server and also learned about the vzctl command that we use to change settings from the containers configuration file, including starting the container on node boot; how to set the hostname, IP address, name server; and changing the root password.

In the next chapter, we will learn how to start, stop, suspend, and resume containers. We will also learn how to destroy, mount, and unmount containers; set file and disk quotas for containers; and create snapshots of containers in order to back up, restore, or migrate a container to another server.

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
Estimated delivery fee Deliver to Poland

Premium delivery 7 - 10 business days

zł110.95
(Includes tracking information)

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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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
Estimated delivery fee Deliver to Poland

Premium delivery 7 - 10 business days

zł110.95
(Includes tracking information)

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
$19.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
$199.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 zł20 each
Feature tick icon Exclusive print discounts
$279.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 zł20 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 516.97
OpenVZ Essentials
zł100.99
Mastering Proxmox
zł193.99
Learning Docker
zł221.99
Total 516.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 the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela