Disk images for virtual machines

Similar documents
Systems Administration Introduction to OSPF

AFACT Cloud Computing Working Group. Chia Hung Kao Institute for Information Industry

Virtual Systems with qemu

Virtualization in Linux KVM + QEMU

IOS110. Virtualization 5/27/2014 1

How to create a Virtual machine from a Macrium image backup

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

Onboarding VMs to Cisco OpenStack Private Cloud

Operating Systems Virtualization mechanisms

Installing Sun's VirtualBox on Windows XP and setting up an Ubuntu VM

Week Overview. Installing Linux Linux on your Desktop Virtualization Basic Linux system administration

13.1 Backup virtual machines running on VMware ESXi / ESX Server

Database Virtualization

Bringing the Eko VM Home (302)

Tom Eastep Linuxfest NW April 26-27, 2008 Bellingham, Washington

Virtualization in Linux. DCLUG talk Przemek Klosowski October 2011

IOmark-VM. DotHill AssuredSAN Pro Test Report: VM a Test Report Date: 16, August

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Oracle VM Server Recovery Guide. Version 8.2

Virtualization Technologies

IBM. Kernel Virtual Machine (KVM) Best practices for KVM

Chapter 12 File Management

Chapter 12 File Management. Roadmap

Mirantis

Comparing Virtualization Technologies

Linux Virtualization Nesting and Management

Operating System Structures

Server and Storage Virtualization. Virtualization. Overview. 5 Reasons to Virtualize

How To Align A File System In Virtual Environments

End to End Defense against Rootkits in Cloud Environment. Design- Part 2

IOmark- VDI. HP HP ConvergedSystem 242- HC StoreVirtual Test Report: VDI- HC b Test Report Date: 27, April

Introduction to KVM. By Sheng-wei Lee #

Restoring a Windows 8.1 system from complete HDD failure - drivesnapshot

Open Source Virtualization

Analysis on Virtualization Technologies in Cloud

Maximizing VMware ESX Performance Through Defragmentation of Guest Systems. Presented by

Backup with OpenNebula Anh Vu Le Quy

Virtualization Awareness

Advanced Server Virtualization: Vmware and Microsoft Platforms in the Virtual Data Center

How To Fix A Fault Fault Fault Management In A Vsphere 5 Vsphe5 Vsphee5 V2.5.5 (Vmfs) Vspheron 5 (Vsphere5) (Vmf5) V

Avoiding Performance Bottlenecks in Hyper-V

Virtual Machines. Virtualization

ClearPath MCP Software Series Compatibility Guide

Competitive Analysis Retrospect And Our Competition

CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.." HOST COMPUTER

Definitions. Hardware Full virtualization Para virtualization Hosted hypervisor Type I hypervisor. Native (bare metal) hypervisor Type II hypervisor

ECT362 Installing Linux Virtual Machine in KL322

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

Pete s All Things Sun: Comparing Solaris to RedHat Enterprise and AIX Virtualization Features

Server and Storage Virtualization

A+ Guide to Software: Managing, Maintaining, and Troubleshooting, 5e. Chapter 3 Installing Windows

Performance Management in a Virtual Environment. Eric Siebert Author and vexpert. whitepaper

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

Deploy and test ovirt using nested virtualization environments. Mark Wu

Deploying a Virtual Machine (Instance) using a Template via CloudStack UI in v4.5.x (procedure valid until Oct 2015)

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Bare Metal Backup And Restore

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

Virtualization and Other Tricks.

Vembu BDR v Release Notes. Major features in v Other features in Vembu BDR. Cloud Disaster Recovery Service. VMware UltraBlaze.

IOmark- VDI. Nimbus Data Gemini Test Report: VDI a Test Report Date: 6, September

7 Myths about Backup & DR in Virtual Environments

Download Virtualization Software Download a Linux-based OS Creating a Virtual Machine using VirtualBox: VM name

Block Level Backups with EMC NetWorker

Using VMware Workstation

Virtualization with Oracle VM VirtualBox Installing Windows XP Guest OS

Before we can talk about virtualization security, we need to delineate the differences between the

Gavin Payne Senior Consultant.

Anh Quach, Matthew Rajman, Bienvenido Rodriguez, Brian Rodriguez, Michael Roefs, Ahmed Shaikh

LiveBackup. Jagane Sundar

Accessing RCS IBM Console in Windows Using Linux Virtual Machine

Symantec Ghost Solution Suite (GSS) and Vista Frequently Asked Questions

About the VM-Series Firewall

A Virtualized Linux Integrity Subsystem for Trusted Cloud Computing

Virtualization Technology (or how my Windows computer gave birth to a bunch of Linux computers)

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

Efficient Load Balancing using VM Migration by QEMU-KVM

Table of Contents. Online backup Manager User s Guide

Understanding Core storage, logical volumes, and Fusion drives.

Virtual Hosting & Virtual Machines

Cloud Sure - Virtual Machines

The Art of Virtualization with Free Software

KVM Virtualization in RHEL 7 Made Easy

INSTALLING SAS 9.2 PHASE 3 ON WINDOWS OPERATING SYSTEMS

Vembu BDR v2.1.0 BETA

Installing VMware Tools on Clearswift v4 Gateways

Enabling Technologies for Distributed and Cloud Computing

Nutanix NOS 4.0 vs. Scale Computing HC3

Operating Systems CSE 410, Spring File Management. Stephen Wagner Michigan State University

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Virtualization and the U2 Databases

Performance Tuning of Virtual Servers TAC9872. John A. Davis Senior Consulting Engineer

WHITE PAPER. Permabit Albireo Data Optimization Software. Benefits of Albireo for Virtual Servers. January Permabit Technology Corporation

Windows NT File System. Outline. Hardware Basics. Ausgewählte Betriebssysteme Institut Betriebssysteme Fakultät Informatik

System Structures. Services Interface Structure

Presented By Quentin Hartman System Administrator InsightsNow, Inc. IT Pro Forum 4/17/2007 itproforum.org

Outline. Windows NT File System. Hardware Basics. Win2K File System Formats. NTFS Cluster Sizes NTFS

Evaluation of the deduplication file system "Opendedup"

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

Enabling Technologies for Distributed Computing

Transcription:

Disk images for virtual machines November 12, 2013 Disk images for virtual machines November 12, 2013 1 / 14

Virtual machines have disks The host (on which the virtual machines are running) needs to provide some kind of resource to the virtual machine, that it can use as a disk. There are multiple options: A file on disk (virtual disk image file) A block device (physical disk partition, or logical volume) We typically use disk image files: they are easier to manipulate, copy, compress, etc. Disk images for virtual machines November 12, 2013 2 / 14

What are we trying to do? Each virtual machine (VM) is going to need a disk image. If we are only going to create a single machine, it s pretty easy: Done! create VM create disk image attach ISO image start VM install operating system What if we want to install 2 machines? We could probably install a second time. Or use an automated tool like vmbuilder. What about when we have to build 5? 40? And do this every week, to teach a class? Disk images for virtual machines November 12, 2013 3 / 14

About disk images... There are in fact two different disk image types we can use: A preallocated disk image (1:1 blocks): a 10 GB disk image reserves 10 GB of disk space, regardless of whether the virtual machine guests uses 1 GB or 10 GB (allocated at creation time) An extensible disk image, useful for growing on demand Disk images for virtual machines November 12, 2013 4 / 14

Disk images - pros / cons There is a tradeoff in the above: A preallocated disk image means just that: the entire space allocated to the disk is zero ed out (meaning that the file is created, then zeros are written to it until all the space allocated is filled up). This may be slower at first if the disk is big (writing zeros to, say, a 100GB file), but means the VM s disk IO will be faster later since it doesn t have to wait for the host OS to grow the file. But unused space on the VM disk is still allocated on the HOST filesystem... An extensible disk image uses a special disk format (in KVM: QCOW2) where the image file grows over time, as the guest VM starts using more and more disk space. From the VM point of view, it sees a full size disk, but the hypervisor is actually lying to the VM, and is allocating the disk blocks on the HOST side. Downside is slower performance and fragmentation, upside is less disk use. Disk images for virtual machines November 12, 2013 5 / 14

Disk images - pros / cons Pros Cons Preallocated - Faster IO for VM - Longer init time (first time) - No fragmentation - Uses all disk space right now Growing - Uses less disk (at first) - Slower IO, fragmentation Disk images for virtual machines November 12, 2013 6 / 14

So, what are we trying to achieve? Let s go back to our initial problem statement: we need to deploy multiple machines, all identical. Here are several methods we could use to achieve this: install the OS by hand N times... (No thanks!) run an automated image building system N times (Better, but... ) copy the resulting disk image N times, create a new XML definition for each, with a slightly different MAC address, UUID, and pointing to the right disk file Disk images for virtual machines November 12, 2013 7 / 14

Cloning images The last solution described (copying the disk image N times) is already an improvement, but it will use a lot of disk space and time to copy. For example: 40 machines x 10 GB = 400 GB of disk used. Can we improve this even further? Disk images for virtual machines November 12, 2013 8 / 14

File formats KVM typically supports two file format for disk images: So called raw disks (byte-for-byte disk image, byte 0 = byte 0 of the disk) If you were to do a byte-for-byte copy of a physical disk from an existing machine, you would have a raw image. QEMU-KVM s QCOW2 (Qemu Copy On Write, v.2) format Disk images for virtual machines November 12, 2013 9 / 14

The QCOW2 format QCOW2 files offer a number of features: grow-on-demand compression support encryption support QCOW2 files can either be preallocated, as we discussed earlier, or set to grow on demand. Tools allow you to convert between one form or another (or even between images from other formats, like VMWare or VirtualBox) Disk images for virtual machines November 12, 2013 10 / 14

The QCOW2 format QCOW2 also has a very useful functionality, called copy on write (COW). When programs inside the guest VM write to the virtual disk, the changes are written to the disk image on the host (for example, this could be /var/lib/libvirt/images/master image.qcow2) But maybe we don t to write to master image.qcow2, because it s our reference installation? We could copy the file as many times as we have machines. Or we can use the copy on write feature of QCOW2. Disk images for virtual machines November 12, 2013 11 / 14

Using copy on write We create a new disk image, but instead of copying the existing image, we tell the image creation tool that the new image should use the master image as a backing file. For example: qemu-img create -o backing_file=master_image.qcow2 -f guest1.qcow2 10G This would create a 10GB QCOW2 image called guest1.qcow2, which uses master image.qcow2 as a backing file. The file command tells us this: guest1.qcow2: QEMU QCOW Image (v2), has backing file (path master_image.qcow2), 10737418240 bytes Disk images for virtual machines November 12, 2013 12 / 14

Using copy on write (cont d) How does it work? When the guest VM using guest1.qcow2 reads from its disk, KVM will actually read the block from the master image.qcow2. When the guest VM writes to its disk, KVM will write the changes to the guest1.qcow2) The file master image.qcow2 is never written to. You can use this method to have many guest disks using a single backing file. It s then very easy to reset the machines by deleting the guest*.qcow2 files and create new ones using master image.qcow2 as the backing file. Disk images for virtual machines November 12, 2013 13 / 14

Disk images - sparse files Some filesystems support files with holes - also called sparse files. Example... truncate --size 20GB filename What happens if we run ls -l and du on this file? Disk images for virtual machines November 12, 2013 14 / 14