Proxmox Cookbook - Wasim Ahmed - E-Book

Proxmox Cookbook E-Book

Wasim Ahmed

0,0
39,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Proxmox VE's intuitive interface, high availability, and unique central management system puts it on par with the world’s best virtualization platforms. Its simplicity and high quality of service is what makes it the foremost choice for most system administrators.
Starting with a step-by-step installation of Proxmox nodes along with an illustrated tour of Proxmox graphical user interface where you will spend most of your time managing a cluster, this book will get you up and running with the mechanisms of Proxmox VE. Various entities such as Cluster, Storage, and Firewall are also covered in an easy to understand format. You will then explore various backup solutions and restore mechanisms, thus learning to keep your applications and servers safe. Next, you will see how to upgrade a Proxmox node with a new release and apply update patches through GUI or CLI.
Monitoring resources and virtual machines is required on an enterprise level, to maintain performance and uptime; to achieve this, we learn how to monitor host machine resources and troubleshoot common issues in the setup. Finally, we will walk through some advanced configurations for VM followed by a list of commands used for Proxmox and Ceph cluster through CLI.
With this focused and detailed guide you will learn to work your way around with Proxmox VE quickly and add to your skillset.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 317

Veröffentlichungsjahr: 2015

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Proxmox Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Installing Proxmox
Introduction
Hardware requirements
Minimum hardware
Recommended hardware
Preparing for installation
Getting ready
How to do it…
There's more…
Installing Proxmox on a bare metal node
Getting ready
How to do it…
There's more…
Installing Proxmox on a Debian system
Getting ready
How to do it...
There's more…
A Proxmox subscription
Disabling a Proxmox subscription
Getting ready
How to do it…
How it works…
Applying a Proxmox subscription
Getting ready
How to do it…
There's more…
Setting up a Proxmox package repository
Getting ready
How to do it…
How it works…
There's more…
Seeking support
The forum
Wiki/Documentation
Customer portals and tickets
Proxmox mailing lists
The Proxmox bug tracker
2. Getting to Know the Proxmox GUI
Introduction
Accessing the Proxmox GUI
Getting ready
How to do it…
How it works…
Viewing styles
Getting ready
How to do it…
How it works…
Displaying Server View
Displaying Folder View
Displaying Storage View
Displaying Pool View
Accessing datacenter-specific menus
Getting ready
How to do it…
How it works…
Datacenter | Search menu
Datacenter | Summary menu
Datacenter | Options menu
Datacenter | Storage menu
Datacenter | Backup menu
Datacenter | Users menu
Datacenter | Groups menu
Datacenter | Pools menu
Datacenter | <Pool_name> | Members tab
Datacenter | <Pool_name> | Permissions tab
Datacenter | Permissions menu
Datacenter | Roles menu
Datacenter | Authentication menu
Datacenter | Authentication | Add | Active Directory Server menu
Datacenter | HA menu
Datacenter | Firewall menu
Datacenter | Firewall | Rules menu
Datacenter | Firewall | Security Group menu
Datacenter | Firewall | Alias menu
Datacenter | Firewall | IPSet menu
Datacenter | Firewall | Options menu
Datacenter | Support menu
Accessing node-specific menus
Getting ready
How to do it…
How it works…
Node | Search menu
Node | Summary menu
Node | Services menu
Node | Network menu
Node | DNS menu
Node | Time menu
Node | Syslog menu
Node | Bootlog menu
Node | Task History menu
Node | UBC menu
Node | Subscription menu
Node | Firewall menu
Node | Firewall | Rules menu
Node | Firewall | Options menu
Node | Firewall | Log menu
Node | Updates menu
Node | Ceph menu
Node | Ceph | Status menu
Node | Ceph | Config menu
Node | Ceph | Monitor menu
Node | Ceph | Disks menu
Node | Ceph | OSD menu
Node | Ceph | Pools menu
Node | Ceph | Crush menu
Node | Ceph | Log menu
Node management menu
Accessing KVM-specific menus
Getting ready
How to do it…
How it works…
KVM | Summary menu
KVM | Hardware menu
KVM | Options menu
KVM | Task History menu
KVM | Monitor menu
KVM | Backup menu
KVM | Snapshots menu
KVM | Firewall menu
KVM | Permissions menu
Accessing OpenVZ-specific menus
Getting ready
How to do it…
How it works…
OpenVZ | Summary menu
OpenVZ | Resources menu
OpenVZ | Network menu
OpenVZ | DNS menu
OpenVZ | Options menu
OpenVZ | Task History menu
OpenVZ | UBC menu
OpenVZ | Backup menu
OpenVZ | Firewall menu
OpenVZ | Permissions menu
3. Cluster and VM Management
Introduction
Creating a Proxmox cluster
Getting ready
How to do it…
How it works…
There's more…
See also
Adding nodes to a cluster
Getting ready
How to do it…
How it works…
Removing nodes from a cluster
Getting ready
How to do it…
Rejoining a removed node into a cluster
Getting ready
How to do it…
There's more…
Understanding the Proxmox cluster filesystem
Getting ready
How it works…
There's more…
See also
Managing the ISO and OpenVZ templates
Getting ready
How to do it…
How it works…
There's more…
Creating a KVM-based virtual machine
Getting ready
How to do it…
There's more…
Creating an OpenVZ container
Getting ready
How to do it…
There's more…
Migrating a virtual machine
Getting ready
How to do it…
How to do it…
How it works…
Cloning a virtual machine
Getting ready
How to do it…
There's more…
Managing a virtual disk image
How to do it…
Managing OpenVZ containers
How to do it…
Understanding OpenVZ user bean counters
How to do it…
How it works…
See also
4. Network Configurations
Introduction
Configuring a basic network
Getting ready
How to do it…
There's more…
Configuring a bridge
Getting ready
How to do it…
How it works…
There's more…
Configuring VLAN
Getting ready
How to do it…
How it works…
Configuring network bonding
Getting ready
How to do it…
There's more…
Configuring Network Address Translation
Getting ready
How to do it…
How it works…
Configuring Infiniband
Getting ready
How to do it…
How it works…
Configuring a VM network interface
Getting ready
How to do it…
Configuring High Availability
Getting ready
How to do it…
There's more…
5. Firewall Configurations
Introduction
Zones
Security groups
IPSets
Rules
Macros
Protocols
Configuring a cluster-specific firewall
Enabling a cluster firewall
Getting ready
How to do it…
How it works…
Managing a security group
Getting ready
How to do it…
Managing IPSets
Getting ready
How to do it…
Configuring a host-specific firewall
Getting ready
How to do it…
How it works…
Configuring a VM-specific firewall
Getting ready
How to do it…
How it works…
Integrating a Suricata IPS
Getting ready
How to do it…
How it works…
Commonly-used firewall CLI commands
Getting ready
How to do it...
There's more…
Logging a firewall
Getting ready
How to do it…
How it works…
See also
6. Storage Configurations
Introduction
Local storage
Shared storage
Ceph storage
MON
OSD
OSD Journal
MDS
CRUSH map
PG
Pools
Basic storage configurations
How to do it…
Installing the FreeNAS storage
Getting ready
How to do it…
There's more…
Connecting the iSCSI storage
Getting ready
How to do it…
How it works…
There's more…
Connecting the LVM storage
Getting ready
How to do it…
Adding the LVM storage with local devices
Creating LVM with a shared storage as the backend
How it works…
There's more…
Connecting the NFS storage
Getting ready
How to do it…
There's more…
Connecting the Ceph RBD storage
Getting ready
How to do it...
Installing Ceph on Proxmox
Initializing the Ceph configuration
Configuring Ceph through the Proxmox GUI
Managing Ceph pools
Connecting RBD to Proxmox
Monitoring the Ceph storage
How it works…
See also
Connecting the ZFS storage
Getting ready
How to do it…
Creating a ZFS pool and attaching it to a Proxmox cluster
Sharing the ZFS storage between Proxmox nodes
How it works…
Connecting the GlusterFS storage
Getting ready…
How to do it…
How it works…
7. Backup and Restore
Introduction
Types of backup
Full backup
Snapshot
Suspend
Stop
Backup compression
LZO
GZIP
Snapshots
Configuring a backup storage
Getting ready
How to do it...
Scheduling backups
Getting ready
How to do it…
How it works…
Performing a manual backup
Getting ready
How to do it…
Managing snapshots
Getting ready
How to do it…
Restoring a backup
Getting ready
How to do it…
Configuring a backup with vzdump.conf
How to do it...
#bwlimit
#lockwait
#stopwait
#script
#exclude-path
Backing up through the command line
How to do it...
Restoring through the command line
How to do it...
8. Updating and Upgrading Proxmox
Introduction
Updating Proxmox through the GUI
Getting ready
How to do it…
How it works…
Updating Proxmox through the CLI
How to do it…
Updating after a change in subscription
Getting ready
How to do it…
How it works…
Rebooting dilemmas after an update
How to do it…
There's more…
9. Monitoring Proxmox
Introduction
Monitoring with Zabbix
Getting ready
Adding a host to the Zabbix server
How to do it…
How it works…
There's more…
Adding the OpenVZ Zabbix template
How to do it…
How it works…
See also
Extending the OpenVZ Zabbix template
How to do it…
How it works…
See also
Proxmox built-in monitoring
How to do it…
Configuring the disk health notifications
How to do it…
Configuring SNMP in Proxmox
How to do it…
Monitoring a Ceph cluster with the Ceph dashboard
Getting ready
How to do it…
How it works…
There's more...
10. Advanced Configurations for VMs
Introduction
Configuring sound in a KVM VM
Getting ready
How to do it…
Configuring a PCI passthrough
How to do it…
Configuring a PCI Express/GPU passthrough
Getting ready
How to do it…
There's more…
Configuring a USB passthrough
How to do it…
Configuring a hotplug
Getting ready
How to do it…
Nesting virtual machines
Getting ready
How to do it…
Isolating multiple subnets
Getting ready
How to do it…
There's more…
11. The CLI Command Reference
Introduction
Proxmox commands
How to do it…
Node-related commands
Cluster-related commands
Storage-related commands
KVM-based VM-related commands
There's more...
OpenVZ container-related commands
How to do it…
There's more...
Ceph commands
How to do it…
Gluster commands
How to do it…
There's more...
ZFS commands
How to do it…
There's more...
Index

Proxmox Cookbook

Proxmox Cookbook

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: August 2015

Production reference: 1250815

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78398-090-1

www.packtpub.com

Credits

Author

Wasim Ahmed

Reviewers

Rudy Jauregui

Jorge Moratilla

Yacine Sebihi

Mark Verboom

Commissioning Editor

Kartikey Pandey

Acquisition Editor

Subho Gupta

Content Development Editor

Samantha Gonsalves

Technical Editor

Rahul C. Shah

Copy Editor

Sonia Michelle Cheema

Project Coordinator

Kinjal Bari

Proofreader

Safis Editing

Indexer

Monica Ajmera Mehta

Graphics

Jason Monteiro

Abhinash Sahu

Production Coordinator

Arvindkumar Gupta

Cover Work

Arvindkumar Gupta

About the Author

Wasim Ahmed, born in Bangladesh, is now a citizen of Canada and a veteran of the IT world. He first came into contact with computers in 1992, and since then, he's never looked back. Over the years, he has acquired an in-depth knowledge and understanding of network, virtualization, big data storage, and network security. By profession, Wasim is the CEO of an IT support and cloud service provider company based out of Calgary, Alberta. He provides his services to many companies and organizations on a daily basis. His strength is his experience, which he's gained from learning and serving clients regularly. He strives to find the most effective solution for a problem at the most competitive prices. He has built over 20 enterprise production virtual infrastructures from scratch using Proxmox and the Ceph storage system.

Wasim is well known for his reluctance to accept a technology based on its description alone, and putting it through rigorous tests to check its validity. Any new technology that his company provides goes through months of continuous testing before it is accepted. Proxmox has made the cut superbly.

I would like to thank all the staff at Proxmox for their support and dedication to the hypervisor community. I would also like to thank Packt Publishing for their vision of putting forward this one-of-a kind book on such a subject and their support through the journey of writing this book.

About the Reviewers

Rudy Jauregui is a site reliability engineer at Adyoulike, a French company providing the first native advertising platform for web editors around the world.

Being a Linux system administrator for important cloud hosting providers, he naturally specializes in DevOps engineering and is now working on large distributed infrastructures that receive a high amount of daily traffic. Since he's very passionate about open source and new technologies, he keeps trying new open source solutions, which are available on GitHub, and is convinced that open source technologies are the key to success in the IT world.

When on vacation, he likes to travel all around the world and meet different kinds of people in a bid to absorb their culture and knowledge. He has also become involved in skydiving and is trying to attain a B Certificate. You can follow him on Twitter at @rustx64.

Jorge Moratilla has a bachelor's degree in computer science and has worked for Internet companies since 1998. He has worked as a contractor for companies such as Sun Microsystems and Oracle. His passions are teaching and optimizing workloads of developers and production systems using automation techniques. He has worked at Sun Microsystems as a certified instructor and field engineer for several years. Jorge has a varied background and has worked with different products, such as Sun Solaris, Linux, LDAP services, and CheckPoint. Recently, he has worked with configuration management products, such as Puppet or Chef, on some assignments and has also taken part in Madrid DevOps (a group of technicians devoted to Continuous Deployment and DevOps culture) as a coordinator. He promotes the adoption of a culture of continuous improvement in enterprises and start-ups as the foundation for achieving great things. You can meet him at the talks and hangouts he organizes for the community.

Jorge has also reviewed Configuration Management with Chef-Solo, Naveed ur Rahman, Packt Publishing.

I would like to thank my wife, Nuria, and sons, Eduardo and Ruben, for being so understanding and supportive while I was reviewing this book. Also, I would like to thank my dear mom, Milagros, and dad, Toñi, who put in the effort of educating me. Finally, I would like to thank all those who have contributed to my personal and professional development through the years.

Yacine Sebihi is an IT consultant and has over 14 years of experience in Linux , open source, and virtualization. He holds certifications in Cisco Data Center, Linux RHEL, HP Storage SAN, and VMware. Currently, he's preparing for his exams (CCIE Data Center and VMware VCAP550-DCA) and is about to pursue his master's degree in expert cloud computing in France.

His personal blog can be found at http://vdatacenter.info/, where he writes technical articles and shares them with the IT world.. You can find out more about Yacine's technical skills and his personal details on his LinkedIn profile page at https://www.linkedin.com/in/sebihiy.

Mark Verboom has been adept at Unix since he first used it in 1992 (ULTRIX on VAX). With a BSc in software engineering and data communications, Mark has worked in numerous positions as a Unix administrator, consultant, and software engineer. He has branched out into areas, such as network design and administration, virtualization, security, and other non-IT fields, such as electronics and car fuel management systems. Because of this, his skills gradually became too broad to fit one job and led to him starting his own company in 2011, called Kram Solutions.

Outside of work, Mark has a keen interest in cars (modifying and upgrading them), audio books, and 3D printing.

I would like to thank Maika for her patience while reviewing this book.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

Preface

Proxmox is one of the biggest kept secrets in the world of virtualization. It stands tall with other major virtualization players, such as VMWare, Xen, Hyper-V, and so on. Since the first release of Proxmox in 2005, it has become the standard for open source hypervisors. It is loaded with great features, such as clustering, High Availability, major storage plugins, firewalls, full KVM/OpenVZ support, and a price that cannot be beaten by any other virtualization product in the industry. Proxmox provides a rock solid platform to build virtual environments that are scalable to any size and can be managed entirely from a single GUI. In a matter of minutes, a standard Proxmox cluster can be raised and brought into production without any licensing costs.

This book is written to get you familiar with Proxmox by following step-by-step procedures. The steps are broken down in as simple manner as possible, thereby allowing you to cook up a Proxmox cluster with minimal effort. This book can also be used as a quick reference to fall back on when working with a Proxmox hypervisor. Illustrations have been used wherever possible along with a hands-on approach that enables you to retain the knowledge you've acquired for a longer period of time. Different topics and features are categorized in different chapters, making this book an easy read.

Often, we lack a book that is a reference point to get things done quickly. Although there are other books on Proxmox written in greater detail, a book, such as this one, was needed so that you could be brought on board with regard to Proxmox in the least amount of time. Each chapter is written with the aim of doing more and reading less.

What this book covers

Chapter 1, Installing Proxmox, introduces Proxmox and its features. It also shows the types of hardware needed for a Proxmox node, the required repository, and how to install Proxmox in a few steps. At the end of the chapter, you will have a very basic Proxmox cluster up and running, which can be used throughout the book to practice the knowledge you've acquired.

Chapter 2, Getting to Know the Proxmox GUI, introduces the Proxmox graphical user interface (GUI) through illustrations and guides you through the entire menu system of Proxmox. Explanations of the functions of different categories of menus are also provided. Each menu item of different categories has been presented with visual figures along with a description of their functions.

Chapter 3, Cluster and VM Management, shows you how to create and configure a Proxmox cluster from the ground up. Topics such as virtual machine creation, migration, and cloning are also covered in this chapter. At the end of the chapter, you will be capable enough to manage virtual machines in a Proxmox cluster.

Chapter 4, Network Configurations, shows different network components and how to configure them in Proxmox. In this chapter, you will have a good understanding of how to a create virtual network within a Proxmox cluster and how all the components come together to form a complex network.

Chapter 5, Firewall Configurations, shows how to utilize the Firewall feature of Proxmox. Firewall is a fairly new feature that has enhanced Proxmox significantly. In this chapter, you will learn how to enable and configure a firewall for different entities, such as a data center, node, and VM.

Chapter 6, Storage Configurations, shows different storage plugin options that are available and how to attach them to a Proxmox cluster. Proxmox provides built-in plugins for a major storage type. In this chapter, you will learn how to attach a shared storage with Proxmox and configure it.

Chapter 7, Backup and Restore, shows you how to perform the backup and restore of a virtual machine in a Proxmox cluster. Backup is an important requirement of any network. This chapter shows you how to schedule regular backups, snapshots, and restore data in the event of a disaster.

Chapter 8, Updating and Upgrading Proxmox, shows you the upgrade process to keep a Proxmox node up to date at all times. Keeping a Proxmox node updated is important for an issue-free environment. In this chapter, you will learn the proper procedure to commit updates on a Proxmox node.

Chapter 9, Monitoring Proxmox, shows you the ways in which you can monitor Proxmox and Ceph clusters using the Zabbix and Ceph dashboards. The steps involved in configuring a host or virtual machine that needs to be monitored, are covered along with installation of the Ceph dashboard. At the end of this chapter, you will know how to monitor and configure notifications.

Chapter 10, Advanced Configurations for VMs, shows advanced configuration steps to add features such as sound, PCI passthrough, and more. Advanced configuration extends the ability of a VM beyond just the basics. This chapter shows steps to make this advanced configuration work seamlessly.

Chapter 11, The CLI Command Reference, shows you several lists of the most commonly used commands to manage different aspects of Proxmox, such as a cluster, storage, and so on. This is a reference chapter for quickly finding the most commonly used commands. Commands have been listed in different categories for an easy find.

What you need for this book

This book is designed with a hands-on approach in mind. Therefore, access to a Proxmox cluster or having enough hardware to build a cluster will greatly enhance the value of this book. A minimum of two nodes will be sufficient to practice all the steps described herein.

You will also need to download Proxmox VE 3.4 ISO images from the official Proxmox site. To set up a FreeNAS storage system reader, you will also need to download the ISO image of the FreeNAS 9.3 stable release from the official FreeNAS site. We have used PuTTY to log in to a Proxmox node through SSH, so, a copy of the PuTTY program is also needed. You can use any other SSH programs of your choice. All three of these files can be downloaded from the following links:

To download Proxmox, visit http://proxmox.com/en/downloads/category/iso-images-pve.

To download FreeNAS, visit http://www.freenas.org/download-freenas-release.html.

To download Putty, visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

Who this book is for

This book is perfect for system administrators who want to learn how to implement and administer Proxmox VE environments. Since this book will not cover the basics of Proxmox, a basic understanding of virtualization and networking with the Proxmox VE is required.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also).

To give clear instructions on how to complete a recipe, we use these sections as follows:

Getting ready

This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Once you have the information, simply run the apt-get command to install it through CLI."

A block of code is set as follows:

[OPTIONS] enable: 1 policy_in: DROP [RULES] IN ACCEPT –p tcp –dport 22 IN ACCEPT –p tcp –dport 8006

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

auto vmbr0 iface vmbr0 inet static address 192.168.10.1 netmask 255.255.255.0 bridge_ports none bridge_stp off bridge_fd 0

Any command-line input or output is written as follows:

# cat /etc/apt/sources.listdeb http://ftp.ca.debian.org/debian wheezy main contribdeb http://download.proxmox.com/debian wheezy pve-no-subscriptiondeb http://security.debian.org / wheezy/updates main contrib

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "After the installation is completed, eject the installation disk or the USB media, then click on Reboot."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.

Chapter 1. Installing Proxmox

In this chapter, we are going to cover the following Proxmox basics:

Hardware requirementsPreparing for installationInstalling Proxmox on a bare metal nodeInstalling Proxmox on a Debian systemA Proxmox subscriptionDisabling a Proxmox subscriptionApplying a Proxmox subscriptionSetting up a Proxmox package repositorySeeking support

Introduction

The Proxmox Virtual Environment (VE) is an open source multinode clustered hypervisor built on Debian Linux, and is able to run on commodity hardware, thus eliminating any vendor lock ins. Proxmox is freely available without any features locked. However, a subscription type license is available to enable a enterprise repository to receive well-tested patches and updates. Subscriptions are recommended for a production-level Proxmox environment.

Note

A hypervisor is a software or firmware that creates a layer between native hardware and an operating system to form a virtual environment to create and run virtual machines. A hypervisor emulates the functions of physical hardware to enable virtual machines to see them as physical resources.

Proxmox can be configured to run a virtual environment of just a few nodes with virtual machines or an environment with thousands of nodes. Supporting both KVM and OpenVZ container-based virtual machines, Proxmox VE is a leading hypervisor today. Proxmox has an extremely vibrant community ready to provide help to any free Proxmox users. Also, the expert technical support team of Proxmox is equally capable of handling all corporate users with their mission critical virtual environment.

As mentioned earlier, Proxmox is a multinode environment, meaning that many nodes can form a single cluster where a virtual machine can be moved around to any node within the cluster, thereby allowing a redundant virtual environment. Through a robust Graphical User Interface (GUI), the entire Proxmox cluster can be managed. As of Proxmox VE 3.4, only one cluster is manageable through the GUI.

Here are some of the notable features of the Proxmox VE:

It provides a multinode cluster environment for virtualization. No single node acts as a master, thus eliminating single points of failure.It provides High Availability (HA) of virtual machines.It gives centralized web-based management and a single interface to manage an entire cluster.A console can be accessed through secured VNC, SPICE, and HTML5-based noVNC.It provides support for multiple authentication sources, such as local using Pluggable Authentication Module (PAM), Microsoft ADS, and LDAP.A Proxmox cluster file system (pmxcfs) can be used to store configuration files for real-time replication on all nodes using corosync (http://en.wikipedia.org/wiki/Corosync_%28project%29).It provides role-based permission management for objects VMs, storages, nodes, pools, and so on.Unlike SOAP, REST is not a protocol but combination of various standards such as HTTP, JSON, URI and XML. Visit http://www.restapitutorial.com for information on REST based APIs.It provides a built-in powerful firewall for host nodes and virtual machines.It provides migration of VMs between physical hosts with or without shared storage.It supports mainstream storage types, such as Ceph, NFS, ZFS, Gluster, and iSCSI.It provides cluster-wide logging.

Hardware requirements

Proxmox can be installed on just about any commodity hardware, but in order to have a stable platform, some attention is required when selecting nodes. A setup selected for Proxmox learning can be underpowered and less expansive. While this setup is acceptable for very small environments and home usage, it will not be adequate for production-level setups where stability and redundancy is the minimum requirement.

Minimum hardware

Here are the minimum requirements to install Proxmox on a hardware node:

Processor: Intel or AMD 64-bitMotherboard: Intel VT or AMD-V capable (not required for OpenVZ)Memory: 1 GB RAMNetwork Interface Card (NIC): 1

Based on the minimum requirement of Proxmox, here are examples of Intel and AMD-based hardware configurations that are suitable for learning:

Processor →

Requirement ↓

Intel

AMD

Processor/CPU

i3-4160 3.0 GHz

FX-4300 3.8 GHz

Motherboard

Asus B85M-D Plus 6 x SATA

Asus M5A78L-M/USB3 6 x SATA

Memory

Corsair 1 x 4 GB DDR3

Corsair 1 x 4 GB DDR3

Recommended hardware

To have a stable performing Proxmox cluster, here are the hardware configurations that are recommended:

An Intel or AMD 64-bit processorAn Intel VT or AMD-V capable Dual or Quad CPU motherboard16 GB RAM memoryTwo Network Interface Card (NIC)RAID controller with Battery Backup Unit (BBU)Solid State Drives (SSD) for operating system or SSD for shared storage nodeFencing hardware only if HA is needed

Note

For more details on fencing and HA visit https://pve.proxmox.com/wiki/Fencing.

The following table lists the configurations of a server node that can be used in a production environment:

Requirement

Hardware

Processor/CPU

Intel Xeon E5-2630 v3 2.4 GHz

Motherboard

Intel S2600CP2 Dual LGA2011

Memory

Kingston 16 GB DDR3 Registered ECC

Power supply

Redundant

Note that the example configurations are for reference only. Your requirement will vary depending on the work load and expected performance. Adjust the hardware requirements accordingly by keeping in mind that in a hypervisor more core counts will increase performance of virtual machines rather than higher clock counts of a processor that is used. With a higher core count, more threads can be distributed among processors.

Tip

It is worth mentioning here that it is better to select a CPU with a higher cache amount for a node with large amount of memory to minimize the main memory access and maximize the performance for each CPU cores.

Proxmox is a clustered hypervisor. In order to set up a cluster, a minimum of two nodes are required. For the purpose of following through this book, when selecting hardware, be sure to have enough components to set up two nodes.

Note

For more details on Proxmox, please visit http://www.proxmox.com/.

Although a Proxmox cluster can be set up with just two nodes, a minimum of three nodes are recommended for a production environment.

Note

In a cluster, a quorum is established with a minimum of three votes. Each node is counted as single vote. The cluster health depends on this democratic system where the majority vote wins. So, in a two node cluster, when one node fails the other node can only cast one vote, creating an unresolved situation. With a three node cluster, when one node fails, the total vote from the remaining nodes is two out of possible three votes. Thus, the cluster operation continues. By any means, a two node cluster is not recommended for a production cluster. However, it is still possible to create using instructions by visiting https://pve.proxmox.com/wiki/Two-Node_High_Availability_Cluster.

Preparing for installation

Once the necessary hardware is assembled, in this recipe, we are going to see how to prepare ourselves before installing Proxmox.

Getting ready

We are going to use the Proxmox VE installation disk to install Proxmox. First, we need to prepare a disk with the Proxmox installation ISO image.

How to do it…

Here are the steps to install Proxmox:

Download the Proxmox ISO image by visiting http://proxmox.com/downloads/category/iso-images-pve.Use a burning software to copy the ISO image on to a DVD disk.Boot the physical node from the disk prepared from ISO to start the installation process.

There's more…

Some nodes may not have a ROM drive available to install from a disk. In such cases, it is possible to install Proxmox by transferring an ISO image onto a USB flash drive. Note that in order to boot from USB media, your motherboard must support the USB boot option. Check from the motherboard BIOS before proceeding to the following steps. If the motherboard does not support USB boot option, it may not also support an external USB ROM Drive. In this case, the best way to proceed is to install an ROM drive in the computer or use a newer motherboard if possible. Here are the instructions to transfer an ISO image to a USB and use it as bootable drive:

Use the following steps to do this on Windows:

Download the Proxmox ISO installation image from http://proxmox.com/downloads/category/iso-images-pve.Rename the file extension of the downloaded ISO from .iso to .raw.Download and install the USB image writing application from https://github.com/downloads/openSUSE/kiwi/ImageWriter.exe.

Note

In some Windows 7 versions, the preceding writer may not work. In such scenarios, download and install the ImageUSB from http://www.osforensics.com/tools/write-usb-images.html.

Using the preceding applications, copy the ISO image onto a USB drive.Insert the USB media into the USB port of the physical node and boot from the USB media.

Use the following steps to do this on Linux:

Download the Proxmox ISO installation image from http://proxmox.com/downloads/category/iso-images-pve.Insert the USB media into the USB port of the node and find out the device name of the drive using #fdisk. The name should be in the /dev/XXX format.Use the following command to copy the ISO onto USB media. Use extra caution when using a device name in the following command. The wrong device name will destroy all the data on the device:
#dd if=<Proxmox ISO file> of=/dev/XXX bs=1M
Reboot the node from the USB media to start the installation.

Installing Proxmox on a bare metal node

The Proxmox installation process is guided by a fully graphical interface through various prompts. In this recipe, we are going to follow through creating our first Proxmox node.

Getting ready

Power up and boot the physical node using the installation disk or the USB media we created in the preceding recipe. The following screenshot is how the screen looks after the boot:

How to do it…

At the main installation window after the booting process press Enter to start the installation.On the End