Module I-7410 Advanced Linux FS-11 Part1: Virtualization with KVM



Similar documents
Linux Virtualization Nesting and Management

Introduction to KVM. By Sheng-wei Lee #

Options in Open Source Virtualization and Cloud Computing. Andrew Hadinyoto Republic Polytechnic

Virtual Systems with qemu

Introduction to Virtualization & KVM

KVM Virtualization in RHEL 7 Made Easy

Enterprise-Class Virtualization with Open Source Technologies

The QEMU/KVM Hypervisor

Regional SEE-GRID-SCI Training for Site Administrators Institute of Physics Belgrade March 5-6, 2009

Installing & Using KVM with Virtual Machine Manager COSC 495

KVM Virtualization in RHEL 6 Made Easy

Set Up the VM-Series Firewall on KVM

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Virtualization for Cloud Computing

Virtualization: Know your options on Ubuntu. Nick Barcet. Ubuntu Server Product Manager

Operating Systems Virtualization mechanisms

PARALLELS SERVER BARE METAL 5.0 README

Professional Xen Visualization

Virtualization Overview

NETWORK EMULATION AND NETKIT

Virtualization. Types of Interfaces

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Virtualization. Dr. Yingwu Zhu

Solution for private cloud computing

Virtualization on Linux Using KVM and libvirt. Matt Surico Long Island Linux Users Group 11 March, 2014

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

The XenServer Product Family:

9/26/2011. What is Virtualization? What are the different types of virtualization.

BHyVe. BSD Hypervisor. Neel Natu Peter Grehan

PARALLELS SERVER 4 BARE METAL README

Date: December 2009 Version: 1.0. How Does Xen Work?

Enabling Technologies for Distributed Computing

Comparing Free Virtualization Products

Dynamic Load Balancing of Virtual Machines using QEMU-KVM

Virtualization. Pradipta De

Full and Para Virtualization

Virtualization Features

Open Source Virtualization

Efficient Load Balancing using VM Migration by QEMU-KVM

Virtualization. Jukka K. Nurminen

October Gluster Virtual Storage Appliance User Guide

Veritas InfoScale 7.0 Virtualization Guide - Linux

Virtualization. Michael Tsai 2015/06/08

Configuring Virtual Blades

How To Install Openstack On Ubuntu (Amd64)

Enabling Technologies for Distributed and Cloud Computing

Deploy and test ovirt using nested virtualization environments. Mark Wu

2972 Linux Options and Best Practices for Scaleup Virtualization

Citrix XenServer Product Frequently Asked Questions

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

Virtual Machines. COMP 3361: Operating Systems I Winter

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

Virtualization Management the ovirt way

Building a Penetration Testing Virtual Computer Laboratory

COS 318: Operating Systems. Virtual Machine Monitors

Red Hat VDI. David Simmons

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Creating Overlay Networks Using Intel Ethernet Converged Network Adapters

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtualization and the U2 Databases

RPM Brotherhood: KVM VIRTUALIZATION TECHNOLOGY

Developing a dynamic, real-time IT infrastructure with Red Hat integrated virtualization

Version 3.7 Technical Whitepaper

Securing your Virtual Datacenter. Part 1: Preventing, Mitigating Privilege Escalation

CSE 501 Monday, September 09, 2013 Kevin Cleary

IOS110. Virtualization 5/27/2014 1

Hypervisor Software and Virtual Machines. Professor Howard Burpee SMCC Computer Technology Dept.

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Toward a practical HPC Cloud : Performance tuning of a virtualized HPC cluster

Servervirualisierung mit Citrix XenServer

Current unresolved challenges and issues in next generation cloud deployments in a virtual environment. Muhammad Adnan Malik

Comparing Virtualization Technologies

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

Converting Linux and Windows Physical and Virtual Machines to Oracle VM Virtual Machines. An Oracle Technical White Paper December 2008

Introduction to ovirt

KVM KERNEL BASED VIRTUAL MACHINE

Virtualization analysis

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

Virtualization Technologies

VIRTUALIZATION 101. Brainstorm Conference 2013 PRESENTER INTRODUCTIONS

Advanced Computer Networks. Network I/O Virtualization

Masters Project Proposal

Automated deployment of virtualization-based research models of distributed computer systems

Virtualizare sub Linux: avantaje si pericole. Dragos Manac

Xen Project 4.4: Features and Futures. Russell Pavlicek Xen Project Evangelist Citrix Systems

Create a virtual machine at your assigned virtual server. Use the following specs

Computing Service Provision in P2P Clouds

PARA-VIRTUALIZATION IMPLEMENTATION IN UBUNTU WITH XEN HYPERVISOR Bachelor Thesis by: Gabriel IRO & Mehmet Batuhan ÖZCAN

Cloud Computing with Red Hat Solutions. Sivaram Shunmugam Red Hat Asia Pacific Pte Ltd.

kvm: Kernel-based Virtual Machine for Linux

How To Compare Performance Of A Router On A Hypervisor On A Linux Virtualbox 2.5 (Xen) To A Virtualbox (Xeen) Xen-Virtualization (X

RED HAT ENTERPRISE VIRTUALIZATION

Transcription:

Bern University of Applied Sciences Engineering and Information Technology Module I-7410 Advanced Linux FS-11 Part1: Virtualization with KVM By Franz Meyer Version 1.0 February 2011

Virtualization Architecture Full Virtualization Uses a hypervisor to share the underlaying hardware (bare metal hypervisor). It must run at the most privileged level (ring0) The guest operating system need not be modified: It is not aware that the underlaying hardware is virtualized. It runs at lower privilege level. Expect significant performance degradation Apps GuestOS0 Apps GuestOS1 Management Hypervisor or Virtual Machine Manager Hardware: Memory, CPU, Disks, etc. V1.0 2011 by Franz Meyer Slide 2

Hardware Assisted Virtualizatition Some Intel and AMD provide extensions to simplify CPU virtualization (Intel-VT-X, AMD-V). The priniciple: A CPU can operate in host or guest mode. In guest mode the hypervisor sees whether the guest operates in kernel or user space. Privileged operations of the guest transfer control to the hypervisor of the host. The virtualization support reduces the overhead for CPU virtualization of the machine. The hypervisor provides virtual memory mapping between the memory of the physical host and the guest (shadow page tables). V1.0 2011 by Franz Meyer Slide 3

KVM Architecture QEMU Emulation for all unsupported devices (network, disk, display) KVM Driver Support for HW-Virtualization (Intel-VT or AMD-V) Normal Linux Process Apps Apps Apps GuestOS0 GuestOS1 GuestOSn QEMU I/O QEMU I/O QEMU I/O User Space Linux Kernel KVM Driver Hardware: Memory, CPU, Disks, etc. Kernel Space V1.0 2011 by Franz Meyer Slide 4

KVM Architecture QEM is a software that emulates a number of hardware platforms in software. This is time consuming and slows down virtualization. KVM is implemented as a kernel loadable module (kvm driver). It converts the host system in a bare metal hypervisor that supports QEMU for X-86 based kernels. KVM is sometimes called QEMU accelerator. A virtual machine in KVM is implemented as a regular Linux process, scheduled by the standard Linux scheduler. Device emulation is handled by QEMU that provides an emulated BIOS, PCI Bus, USB bus, IDE and SCSI disk controllers, network cards, etc. The KVM code has been incorporated into the Linux kernel since kernel 2.6.20 (2007). Thus, the KVM code improves with the kernel. Notice that XEN code is not part of the Linux kernel. V1.0 2011 by Franz Meyer Slide 5

KVM Pros and Cons Pros Reduces performance degradation by using HW-Virtualization No customization needed on the guest OS QEMU supports various devices (ex. VNC Server - Display) Cons Needs a modified QEMU Not yet as fast as para-virtualized systems No installation-tool yet with debootstrap V1.0 2011 by Franz Meyer Slide 6

KVM Components The following picture shows the most important KVM components Libvirt unifies the management of many different virtualization systems (kvm, qemu, xen, virtualbox, etc, right now 9) virsh libvirt Virt- Manager libvirt Virt- Viewer libvirt Your Mgmt Script libvirt libvirtd: communication between management tools and virtual machines User Space Tools Management API KVM QEMU XEN others V1.0 2011 by Franz Meyer Slide 7

Libvirt - Terminology In libvirt the following terms are used (http://www.libvirt.org) Node: is a single physical Hypervisor: is a layer of software allowing to virtualize a node in a set of virtual machines with possibly different configurations than the node itself Domain is an instance of an operating system (or subsystem in the case of container virtualization) running on a virtualized machine provided by the hypervisor domain domain hypervisor node V1.0 2011 by Franz Meyer Slide 8

Libvirt Management - Tools Virsh (/usr/bin/virsh) Command line tool for libvirt (shell like) Virt-installer (/usr/bin/virt-install, command line tool) Creates guestos.xml and image files based on input parameters Virt-cloner (/usr/bin/virt-clone, command line tool) Clones existing virtual machines Virt-viewer (/usr/bin/virt-viewer) VNC based viewer for virtual machines Used by the other tools Virt-Manager (/usr/bin/virt-manager) GUI-client to libvirt, Can also connect on remote libvirt-daemons Read the manual pages for each of those tools V1.0 2011 by Franz Meyer Slide 9

Libvirt (1) Objective of Libvirt: unifies the management of virtual machines Stores configuration in xml format Supports among other things create/configure/destroy guests create/configure/destroy storage pools create/configure/destroy virtual networks (no bridges) Configuration of libvirt: directory /etc/libvirt File: libvirtd.conf - libvirt daemon configuration file File: qemu.conf - configuration file for the QEMU driver Directory: qemu - configuration xml for kvm/qemu based clients A.xml file for each virtual machine Directory: network -.xml configuration files for virtual networks Directory: storage -.xml configuration files for storage pools V1.0 2011 by Franz Meyer Slide 10

Libvirt (2) Xml schemes are explained in detail here: http://www.libvirt.org Libvirt defines interfaces for programming languages like C, C#, Python, Perl, etc. The libvirtd can be configured to allow network access. V1.0 2011 by Franz Meyer Slide 11

Bridge Management Tools (1) Allows you to create/configure virtual Ethernet bridges Installation (as root): apt get install bridge utils Adding physical interface eth0 to a bridge called br0. Modify file /etc/network/interfaces static case auto eth0 dhcp case auto eth0 iface eth0 inet manual iface eth0 inet manual auto br0 auto br0 iface br0 inet static iface br0 inet dhcp Address 192.168.0.100 bridge_ports eth0 Network 192.168.0.0 bridge_fd 9 Netmask 255.255.255.0 bridge_hello 2 Broadcast 192.168.0.255 bridge_maxage 12 Gateway 192.168.0.1 bridge_stp off bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off V1.0 2011 by Franz Meyer Slide 12

Bridge Management Tools (2) Bridge utilities brctl - ethernet bridge administration Syntax is: brctrl [command] Commands are brctl addbr <name> creates a new instance of the ethernet bridge called <name> brctl delbr <name> deletes the instance <name> of the bridge brctl show <brname> will show some information on the bridge and its attached ports More information: $ man brctl Bridge utilities can be used for the GuestOS configuration in libvirt. V1.0 2011 by Franz Meyer Slide 13

KVM Lab: Part1 (1) Objective Learn how to plan, setup, and manage a small number of guest virtual machines using kvm virtualization You will be familiar with the appropriate tools to do that Libvirt based tools such as virsh: the command line shell to libvirt virt-install: the command line tool to create a guest virt-clone: the command line tool to create a guest virt-viewer: a GUI based tool for displaying the graphical console of a guest Virt-manager: desktop GUI for managing virtual machines V1.0 2011 by Franz Meyer Slide 14

KVM Lab: Part1 (2) Task-1: Prepare your system for kvm and libvirt Step-1: Make sure that virtualization is enabled in the BIOS and that the CPUs of the Lab PC support hardware virtualization. Step-2: Install kvm, libvirtd, virt-installer, virt-viewer, bridge-utils Step-3: Reboot your system Task-2: Configure your network with the following requirements: Configure a bridge called br0 including network interface eth0. Configure a virtual network called internal using the subnet settings associated to your lab-machine. Task-3: Step-1: Create a LVM volume group of 15 Gb that holds virtual machine images. Step-2: Configure a storage pool to hold virtual machine images. Perhaps start with a LV and use the pool later. V1.0 2011 by Franz Meyer Slide 15

KVM Lab Part1 (3) Task-4: Create a guest named router which connects to the bridged ethernet br0 and to the virtual network internal. Step-1: Create basic xml file with the virt install utility and install the GuestOS from an installation CD. Step-2: If the guest is stated automatically stop it and add a second network card in the xml file. Step-3: Start and configure the guestos. Task-5: Similarly to task 4. Create a guest named server which only connects to the virtual network internal. Step-1: Create guest by cloning the first guest (router) Step-2: Remove the second network card from the configuration. Task-6: Check connectivity from a machine on the Netlab network segment to the server across the router. All tasks: document your work. V1.0 2011 by Franz Meyer Slide 16

KVM Lab Part2 (4) Objectives Learn manage guest on different nodes (physical machine) You will be familiar with the techniques to access a common storage, to remotely manage a guest, and to migrate a guest from one node to another node. Remark: It was found that some task do not work properly in Ubuntu-10.4 but more successfully 10.10 or in Debian-squeeze. Task-1: Plan and setup a second node. Are there any restrictions concerning the network topology? Step-1: Get a second disk and setup a Linux distribution and install the kvm software, perhaps clone your existing disk. Step-2: Setup identical virtual networks and bridges. Step-3: Achieve to share the storage for virtual machine images between all nodes, perhaps using NFS. V1.0 2011 by Franz Meyer Slide 17

KVM Lab Part2 (5) Task-2: Install one or more guests in the common storage. Task-3: Manage those guests Step-1: Find out how instances of virtlibd on different nodes communicate. Install the required software. Step-2: Use the virsh utility to start a guest on a remote node. Then connect to that machine or use virt-viewer. Step-3: Use the virsh utility to start a guest on the local node. Then migrate this guest to the remote node. Check that the migration has been successful. Then migrate the guest back to your local machine. Document your work. V1.0 2011 by Franz Meyer Slide 18

Resources KVM - https://help.ubuntu.com/community/kvm Installation Networking Guest Creation Guest Management KVM - http://wiki.debian.org/kvm Libvirt - http://www.libvirt.org Virsh: Managing guests with virsh http/docs.redhat.com V1.0 2011 by Franz Meyer Slide 19