Virtualizace

Tomas Krajca, xkrajca@fi.muni.cz

Obsah

VM ~ hypervisor(host, guest1...guestn)
Guestn ~ VHDDs + VNICs + VPrinters + VCPUs + VRAM + ... + VT

Motivation

Benefits

Shortcomings

Types of virtualization

Virtual managers

Virtual hard drives

Demo (Qemu/RHEL)

        # yum install -y qemu
        # qemu-img create -f raw qemu-hdd.raw 5G 
        Formatting 'qemu-hdd.raw', fmt=raw size=5368709120 
        # qemu-system-i386 -hda ./qemu-hdd.raw -m 512 -net nic -net user -localtime -boot d -cdrom ubuntu-12.04.1-server-i386.iso -vnc :1 # install
        # # net: 10.0.2.0/24, DHCP, VLAN0, GW .2, DNS .3
        # qemu-system-i386 -hda ./qemu-hdd.raw -m 512 -net nic -net user -localtime -vnc :1 # boot
        # # migration ~ copy/move virtual hard drive, launch again
        # cp ./qemu-hdd.raw /backup/qemu-hdd.raw # backup
        # qemu-img info ./qemu-hdd.raw
        image: qemu-hdd.raw
        file format: raw
        virtual size: 5.0G (5368709120 bytes)
        disk size: 387M
        # fdisk -l qemu-hdd.raw 
        Disk qemu-hdd.raw: 5368 MB, 5368709120 bytes
        255 heads, 63 sectors/track, 652 cylinders, total 10485760 sectors
        Units = sectors of 1 * 512 = 512 bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disk identifier: 0x000427f0

               Device Boot      Start         End      Blocks   Id  System
        qemu-hdd.raw1            2048     9437183     4717568   83  Linux
        qemu-hdd.raw2         9439230    10483711      522241    5  Extended
        qemu-hdd.raw5         9439232    10483711      522240   82  Linux swap / Solaris
        # mount -o loop,offset=$((2048*512)) qemu-hdd.raw tmp/

Literatura