KVM Virtualization Cookbook

Deploy, manage, and scale virtual instances using Kernel-based Virtual Machines
Preview in Mapt

KVM Virtualization Cookbook

Konstantin Ivanov

1 customer reviews
Deploy, manage, and scale virtual instances using Kernel-based Virtual Machines
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


KVM Virtualization Cookbook Book Cover
KVM Virtualization Cookbook
$ 35.99
$ 25.20
Mastering KVM Virtualization Book Cover
Mastering KVM Virtualization
$ 39.99
$ 28.00
Buy 2 for $35.00
Save $40.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781788294676
Paperback340 pages

Book Description

Virtualization technologies such as KVM allow for better control over the available server resources, by deploying multiple virtual instances on the same physical host, or clusters of compute resources. With KVM it is possible to run various workloads in isolation with the hypervisor layer providing better tenant isolation and higher degree of security.

This book will provide a deep dive into deploying KVM virtual machines using qemu and libvirt and will demonstrate practical examples on how to run, scale, monitor, migrate and backup such instances. You will also discover real production ready recipes on deploying KVM instances with OpenStack and how to programatically manage the life cycle of KVM virtual machines using Python. You will learn numerous tips and techniques which will help you deploy & plan the KVM infrastructure. Next, you will be introduced to the working of libvirt libraries and the iPython development environment.

Finally, you will be able to tune your Linux kernel for high throughput and better performance. By the end of this book, you will gain all the knowledge needed to be an expert in working with the KVM virtualization infrastructure.

Table of Contents

Chapter 1: Getting Started with QEMU and KVM
Introduction
Installing and configuring QEMU
Managing disk images with qemu-img
Preparing images for OS installation with qemu-nbd
Installing a custom OS on the image with debootstrap
Resizing an image
Using pre-existing images
Running virtual machines with qemu-system-*
Starting the QEMU VM with KVM support
Connecting to a running instance with VNC
Chapter 2: Using libvirt to Manage KVM
Introduction
Installing and configuring libvirt
Defining KVM instances
Starting, stopping, and removing KVM instances
Inspecting and editing KVM configs
Building new KVM instances with virt-install and using the console
Managing CPU and memory resources in KVM
Attaching block devices to virtual machines
Sharing directories between a running VM and the host OS
Autostarting KVM instances
Working with storage pools
Managing volumes
Managing secrets
Chapter 3: KVM Networking with libvirt
Introduction
The Linux bridge
The Open vSwitch
Configuring NAT forwarding network
Configuring bridged network
Configuring PCI passthrough network
Manipulating network interfaces
Chapter 4: Migrating KVM Instances
Introduction
Manual offline migration using an iSCSI storage pool
Manual offline migration using GlusterFS shared volumes
Online migration using the virsh command with shared storage
Offline migration using the virsh command and local image
Online migration using the virsh command and local image
Chapter 5: Monitoring and Backup of KVM Virtual Machines
Introduction
Resource usage collection with libvirt
Monitoring KVM instances with Sensu
Simple KVM backups with tar and rsync
Creating snapshots
Listing snapshots
Inspecting snapshots
Editing snapshots
Reverting snapshots
Deleting snapshots
Chapter 6: Deploying KVM Instances with OpenStack
Introduction
Preparing the host for the OpenStack deployment
Installing and configuring the OpenStack Keystone identity service
Installing and configuring the OpenStack Glance image service
Installing and configuring the OpenStack Nova compute service
Installing and configuring the OpenStack Neutron networking service
Building and inspecting KVM instances with OpenStack
Stopping KVM instances with OpenStack
Terminating KVM instances with OpenStack
Chapter 7: Using Python to Build and Manage KVM Instances
Introduction
Installing and using the Python libvirt library
Defining KVM instances with Python
Starting, stopping, and deleting KVM instances with Python
Inspecting KVM instances with Python
Building a simple REST API server with libvirt and bottle
Chapter 8: Kernel Tuning for KVM Performance
Introduction
Tuning the kernel for low I/O latency
Memory tuning for KVM guests
CPU performance options
NUMA tuning with libvirt
Tuning the kernel for network performance

What You Will Learn

  • Deploy different workloads in isolation with KVM virtualization and better utilize the available compute resources
  • Explore the benefits of running applications with KVM and learn to prevent the “bad-neighbor” effect
  • Leveraging various networking technologies in the context of virtualization with Open vSwitch and the Linux bridge.
  • Create KVM instances using Python and inspect running KVM instances
  • Understand Kernel Tuning for enhanced KVM performance and better memory utilization

Authors

Table of Contents

Chapter 1: Getting Started with QEMU and KVM
Introduction
Installing and configuring QEMU
Managing disk images with qemu-img
Preparing images for OS installation with qemu-nbd
Installing a custom OS on the image with debootstrap
Resizing an image
Using pre-existing images
Running virtual machines with qemu-system-*
Starting the QEMU VM with KVM support
Connecting to a running instance with VNC
Chapter 2: Using libvirt to Manage KVM
Introduction
Installing and configuring libvirt
Defining KVM instances
Starting, stopping, and removing KVM instances
Inspecting and editing KVM configs
Building new KVM instances with virt-install and using the console
Managing CPU and memory resources in KVM
Attaching block devices to virtual machines
Sharing directories between a running VM and the host OS
Autostarting KVM instances
Working with storage pools
Managing volumes
Managing secrets
Chapter 3: KVM Networking with libvirt
Introduction
The Linux bridge
The Open vSwitch
Configuring NAT forwarding network
Configuring bridged network
Configuring PCI passthrough network
Manipulating network interfaces
Chapter 4: Migrating KVM Instances
Introduction
Manual offline migration using an iSCSI storage pool
Manual offline migration using GlusterFS shared volumes
Online migration using the virsh command with shared storage
Offline migration using the virsh command and local image
Online migration using the virsh command and local image
Chapter 5: Monitoring and Backup of KVM Virtual Machines
Introduction
Resource usage collection with libvirt
Monitoring KVM instances with Sensu
Simple KVM backups with tar and rsync
Creating snapshots
Listing snapshots
Inspecting snapshots
Editing snapshots
Reverting snapshots
Deleting snapshots
Chapter 6: Deploying KVM Instances with OpenStack
Introduction
Preparing the host for the OpenStack deployment
Installing and configuring the OpenStack Keystone identity service
Installing and configuring the OpenStack Glance image service
Installing and configuring the OpenStack Nova compute service
Installing and configuring the OpenStack Neutron networking service
Building and inspecting KVM instances with OpenStack
Stopping KVM instances with OpenStack
Terminating KVM instances with OpenStack
Chapter 7: Using Python to Build and Manage KVM Instances
Introduction
Installing and using the Python libvirt library
Defining KVM instances with Python
Starting, stopping, and deleting KVM instances with Python
Inspecting KVM instances with Python
Building a simple REST API server with libvirt and bottle
Chapter 8: Kernel Tuning for KVM Performance
Introduction
Tuning the kernel for low I/O latency
Memory tuning for KVM guests
CPU performance options
NUMA tuning with libvirt
Tuning the kernel for network performance

Book Details

ISBN 139781788294676
Paperback340 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering KVM Virtualization Book Cover
Mastering KVM Virtualization
$ 39.99
$ 28.00
IBM Cognos 10 Report Studio Cookbook, Second Edition Book Cover
IBM Cognos 10 Report Studio Cookbook, Second Edition
$ 32.99
$ 23.10
System Center 2016 Virtual Machine Manager Cookbook - Third Edition Book Cover
System Center 2016 Virtual Machine Manager Cookbook - Third Edition
$ 47.99
$ 33.60
VMware Virtual SAN Cookbook Book Cover
VMware Virtual SAN Cookbook
$ 31.99
$ 22.40
Microsoft Application Virtualization Cookbook Book Cover
Microsoft Application Virtualization Cookbook
$ 43.99
$ 30.80
Vagrant Virtual Development Environment Cookbook Book Cover
Vagrant Virtual Development Environment Cookbook
$ 26.99
$ 18.90