Libvirt management Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.

Slides:



Advertisements
Similar presentations
Building Portals to access Grid Middleware National Technical University of Athens Konstantinos Dolkas, On behalf of Andreas Menychtas.
Advertisements

Chapter 20 Oracle Secure Backup.
NWCLUG 01/05/2010 Jared Moore Xen Open Source Virtualization.
Operating-System Structures
CCNA2 MODULE 5.
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Macros for Beginners Patrick Armatis University of Michigan-Dearborn.
Chapter 9 Managing a Cisco Internetwork Cisco Router Components Bootstrap - Brings up the router during initialization POST - Checks basic functionality;
1 Semester 2 Module 2 Introduction to Routers Yuda college of business James Chen
Sybex CCNA Chapter 7: Managing a Cisco Internetwork Instructor & Todd Lammle.
Condor Project Computer Sciences Department University of Wisconsin-Madison Virtual Machines in Condor.
Telnet/SSH: Connecting to Hosts Internet Technology1.
1 Semester 2 Module 3 Configuring a Router Yuda college of business James Chen
Linux Filesystem Management
CISCO ROUTER.  The Cisco router IOS  Enhanced editing  Administrative functions  Hostnames  Banners  Passwords  Interface descriptions  Verifying.
Chapter 6 Router Configuration Sem 2V2. Configuration files can come from the console NVRAM TFTP server. The router has several modes:  privileged mode.
Customized cloud platform for computing on your terms !
Building service testbeds on FIRE D5.2.5 Virtual Cluster on Federated Cloud Demonstration Kit August 2012 Version 1.0 Copyright © 2012 CESGA. All rights.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 10 Manage Remote Access.
Hands-On Virtual Computing
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Module 7: Fundamentals of Administering Windows Server 2008.
Operating Systems TexPREP Summer Camp Computer Science.
MCTS Guide to Microsoft Windows Server 2008 Applications Infrastructure Configuration (Exam # ) Chapter Four Windows Server 2008 Remote Desktop Services,
Using OUI to install Oracle9i Release 2 on an OpenVMS System.
Basic Router Configuration 1.1 Global configuration Cisco allows us to configure the router to support various protocols and interfaces. The router stores.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
PSeries Advanced Technical Support © 2002 IBM Corporation Presentation subtitle: 20pt Arial Regular, teal R045 | G182 | B179 Recommended maximum length:
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
Sybex CCNA Chapter 4: Cisco’s IOS and SDM Instructor & Todd Lammle.
1 Router Fundamentals (Ref. CCNA5 Introduction to Networks 2.1, 6.3)
Define and describe operating systems which contain a Command Line Interface (CLI) Define and describe operating systems which contain a Graphical User.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
BABCA Software Operating Systems (OS) aka Systems Software A set of instructions that coordinate all the activities among computer hardware resources.
Routers 1st semester
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Router Initialization steps.
Chapter 2: Configure a Network Operating System
THE WINDOWS OPERATING SYSTEM Computer Basics 1.2.
Click to add text © 2004 IBM Corporation IBM ^ z/VM Basic Structures and Commands Control Program.
COMPUTER NETWORK AND DESIGN
KVM tutorial #3 Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
SSH. 2 SSH – Secure Shell SSH is a cryptographic protocol – Implemented in software originally for remote login applications – One most popular software.
CITA 171 Section 1 DOS/Windows Introduction. DOS Disk operating system (DOS) –Term most often associated with MS-DOS –Single-tasking operating system.
Introduction to KVM Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
KVM tutorial #2 Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
OPERATING SYSTEM REVIEW. System Software The programs that control and maintain the operation of the computer and its devices The two parts of system.
Windows Server 2003 { First Steps and Administration} Benedikt Riedel MCSE + Messaging
2Operating Systems  Program that runs on a computer  Manages hardware resources  Allows for execution of programs  Acts as an intermediary between.
Intro To Virtualization Mohammed Morsi
Secure remote management with virtualization Daniel P. Berrangé.
Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010
Chapter Objectives In this chapter, you will learn:
Instructor Materials Chapter 2: Configure a Network Operating System
Chapter 2: Configure a Network Operating System
Operating & Configuring a Cisco IOS Device
Virtualization with libvirt Kashyap Chamarthy
Chapter 5: Using System Software
Creation and migration flows
Chapter 2: System Structures
TexPREP Summer Camp Computer Science
OPNFV Arno Installation & Validation Walk-Through
Chapter 2: Configure a Network Operating System
HC Hyper-V Module GUI Portal VPS Templates Web Console
OPS235: Lab 2 Virtual Machines – Part II
Instructor & Todd Lammle
Instructor & Todd Lammle
* Introduction to Cloud computing * Introduction to OpenStack * OpenStack Design & Architecture * Demonstration of OpenStack Cloud.
Remote Computing Services Cloud connection Distributed system
Chapter 7 Network Applications
Overview of Computer system
Presentation transcript:

Libvirt management Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010

What is libvirt A collection of software that provides a convenient way to manage virtual machines and other virtualization functionality, such as storage and network interface management.  an API library  a daemon (libvirtd)  a command line utility (virsh) Libvirt's goal is to expose all useful hypervisor features Andrea Chierici2

Major functionalities VM management Remote machine support Storage management Network interface management Virtual NAT and Route base networking  virbr0 Andrea Chierici3

virsh command line interface tool for managing guests and the hypervisor built on the libvirt management API and operates in similar way to the xen “xm” command and the graphical guest Manager (virt-manager) virsh can be used in read-only mode by unprivileged users Andrea Chierici4

XML sample quattortest 60756d ae-2b4a-f301f96e hvm destroy restart /usr/libexec/qemu-kvm Andrea Chierici5

virsh command reference CommandDescription helpPrints basic help information. listLists all guests. dumpxml Outputs the XML configuration file for the guest. create Creates a guest from an XML configuration file and starts the new guest. startStarts an inactive guest. destroyForces a guest to stop. define Outputs an XML configuration file for a guest. domidDisplays the guest's ID. domuuidDisplays the guest's UUID. dominfoDisplays guest information. domnameDisplays the guest's name. domstateDisplays the state of a guest. quitQuits the interactive terminal. rebootReboots a guest. restore Restores a previously saved guest stored in a file. resumeResumes a paused guest. save Save the present state of a guest to a file. shutdownGracefully shuts down a guest. suspendPauses a guest. undefine Deletes all files associated with a guest. migrate Migrates a guest to another host. Andrea Chierici6 CommandDescription setmemSets the allocated memory for a guest. setmaxmemSets maximum memory limit for the hypervisor. setvcpus Changes number of virtual CPUs assigned to a guest. vcpuinfoDisplays virtual CPU information about a guest. vcpupinControls the virtual CPU affinity of a guest. domblkstat Displays block device statistics for a running guest. domifstat Displays network interface statistics for a running guest. attach-device Attach a device to a guest, using a device definition in an XML file. attach-diskAttaches a new disk device to a guest. attach-interfaceAttaches a new network interface to a guest. detach-device Detach a device from a guest, takes the same kind of XML descriptions as command attach- device. detach-diskDetach a disk device from a guest. detach-interfaceDetach a network interface from a guest.

Virsh edit Recommended way to make changes to an existing VM configuration virsh edit  This command will open a text editor containing the existing VM XML  any changes that are made and saved will be checked for errors when the editor exits. If no errors are found, the changes are made permanent. Andrea Chierici7

virsh examples Connect to a hypervisor session with virsh: # virsh connect {hostname OR URL}  Where is the machine name of the hypervisor. To initiate a read-only connection, append the above command with -readonly. Creating a guest from a configuration file  Guests can be created from XML configuration files.  You can copy existing XML from previously created guests or use the dumpxml option (refer to Creating a virtual machine XML dump (configuration file)).Creating a virtual machine XML dump (configuration file)  To create a guest with virsh from an XML file: # virsh create configuration_file.xml Editing a guest's configuration file  Instead of using the dumpxml option (refer to Creating a virtual machine XML dump (configuration file)) guests can be edited either while they run or while they are offline.Creating a virtual machine XML dump (configuration file)  The virsh edit command provides this functionality. For example, to edit the guest named softwaretesting: # virsh edit softwaretesting Andrea Chierici8

virsh examples Shut down a guest # virsh shutdown {domain-id, domain-name or domain-uuid}  You can control the behavior of the rebooting guest by modifying the on_shutdown parameter in the guest's configuration file. Displaying the guests: to display the guest list and their current states with virsh: # virsh list Migrating guests with virsh  A guest can be migrated to another host with virsh. Add --live for live migration. The migrate command accepts parameters in the following format: # virsh migrate --live GuestName DestinationURL  The --live parameter is optional. Add the --live parameter for live migrations. Andrea Chierici9

QEMU monitor Libvirt deliberately does not enable user access to the QEMU monitor. Interacting with the monitor behind libvirt's back can cause reported virtual machine state to be out of sync, which will likely end with errors. Andrea Chierici10

Remote management with SSH libvirt management connection securely tunneled over an SSH connection to manage the remote machines All the authentication is done using SSH public key cryptography and passwords or passphrases gathered by your local SSH agent.  the VNC console for each guest virtual machine is tunneled over SSH. Andrea Chierici11

Password less SSH access for virt-manager $ssh-keygen -t rsa $ssh-copy-id -i ~/.ssh/id_rsa.pub password: Optional: add the passphrase to the ssh- agent $ssh-add ~/.ssh/id_rsa.pub Andrea Chierici12

Accessing remote hosts with virt-manager Remote hosts can be managed with the virt- manager GUI tool. SSH keys must belong to the user executing virt-manager for password-less login to work.  Start virt-manager.  Open the File->Add Connection menu.  Input values for the hypervisor type, the connection, Connection->Remote tunnel over SSH, and enter the desired hostname, then click connection. Andrea Chierici13

How to configure management access to libvirt through SSH management access to libvirt is controlled through membership to a unix group (libvirt) groupadd libvirt In the /etc/libvirt/libvirtd.conf file, uncomment these two lines: #unix_sock_group = "libvirt" #unix_sock_rw_perms = "0770" Restart libvirt daemon Add the desired users to this unix group: $usermod -G libvirt -a username1 Andrea Chierici14

Verify it works $ virsh -c Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # hostname host1.libvirt.org Andrea Chierici15