Test Day:2012-04-12 Virtualization Test Day-GuestOS

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Test case 1: ISO media inspection)
(Test case 2: Installation)
 
(One intermediate revision by one user not shown)
Line 99: Line 99:
 
   # virt-install --hvm --noreboot  --ram 800 --vnc --name $OSNAME \
 
   # virt-install --hvm --noreboot  --ram 800 --vnc --name $OSNAME \
 
                 --network network=default \
 
                 --network network=default \
                 --disk path=/var/lib/libvirt/images/$OSNAME.qcow2,size=10 \
+
                 --disk path=/var/lib/libvirt/images/$OSNAME.raw,size=10 \
 
                 --cdrom /var/lib/libvirt/images/$OSNAME.iso
 
                 --cdrom /var/lib/libvirt/images/$OSNAME.iso
  

Latest revision as of 09:18, 12 April 2012

Fedora 17 will ship with KVM as the default hypervisor, based on the QEMU 1.0 release. The test day will focus on determining what guest operating systems can be successfully installed and run post-install. It will also check whether libguestfs can inspect the initial install media and resulting disl image.

Contents

[edit] Requirements

You will need

  • a Fedora 17 x86 baremetal host with Intel VT or AMD SVM virtualization capabilities (We are not interested in testing plain QEMU emulation at this time)
  • Installation ISO images for each guest OS you wish to test
  • 10+ GB free disk space (if disk space is tight, you can delete each guest disk after installation, to make space for the next)

[edit] Installing KVM and the virt tools

The minimum required versions are:

  • qemu-kvm-1.0-11.fc17
  • ipxe-roms-qemu-20120328-1.gitaac9718.fc17
  • libvirt-0.9.11-1.fc17
  • libguestfs-tools-c-1.17.19-1.fc17

These are only available in the updates-testing repository. First make sure the rest of your system is fully updated

# yum update

Then pull in the extra pieces:

# yum --enablerepo=updates-testing install libvirt-daemon-kvm virt-manager libguestfs-tools-c

After installation, check whether libvirtd is running:

# systemctl status libvirtd.service

If not then start it

# systemctl start libvirtd.service

[edit] Basic checks

To make sure that the host is correctly configured to be able to run KVM guests run the libvirt host validation tool as root:

 # virt-host-validate qemu
 QEMU: Checking for hardware virtualization                                 : PASS
 QEMU: Checking for device /dev/kvm                                         : PASS
 QEMU: Checking for device /dev/vhost-net                                   : PASS
 QEMU: Checking for device /dev/net/tun                                     : PASS

If any failures are reported, resolve these before continuing with testing.

[edit] Tests

The four test cases which are described on this page should be repeated for each operating system.

Before start on the tests obtain the installation media for the operating to be tested, placing it in the following directory

/var/lib/libvirt/images/

The ISO image should be the primary install media for the OS in question, rather than the LiveCD media.

For example:

# cd /var/lib/libvirt/images
# wget http://mirror.bytemark.co.uk/fedora/linux/releases/16/Fedora/i386/iso/Fedora-16-i386-DVD.iso

To save some typing in the test cases, set an environment variable containing the base of the ISO image name

# export OSNAME=Fedora-16-i386-DVD

[edit] Test case 1: ISO media detection

The first test is to try to inspect the ISO media and see if libosinfo can identify the operating system. Use the 'osinfo-detect' command todo this

# osinfo-detect /path/to/iso/image

This test shall be considered successful if the above commands outputs the name of the operating system on the media

If this fails, file a bug report against the libosinfo component, providing the output of the following command as an attachment to the bug

# isoinfo -d -i /path/to/iso/image

For example a successful invocation on a Fedora 16 DVD looks like this:

# cd /var/lib/libvirt/images
# osinfo-detect $OSNAME.iso 
Media is bootable.
Media is an installer for OS 'Fedora 16'

Even if this test fails, you can still proceed with the other three tests.

[edit] Test case 2: Installation

To install the guest operating system, we will use the command line virt-install tool. Feel free to use virt-manager instead, but be aware that you'll have less opportunity to tune things for rarer operating systems. For testing the basic configuration that is desired is

  • 10 GB qcow2 disk
  • 1 NIC connected to 'default' network (virbr0)
  • Serial console
  • 800 MB RAM (feel free to raise if the OS is known to need more)

Assuming the $OSNAME env variable is still set from earlier, the following command can be used:

 # virt-install --hvm --noreboot  --ram 800 --vnc --name $OSNAME \
                --network network=default \
                --disk path=/var/lib/libvirt/images/$OSNAME.raw,size=10 \
                --cdrom /var/lib/libvirt/images/$OSNAME.iso

For recent windows/linux guests, it is advisable to tell virt-install what the guest OS type is. Take the above command line and add in 2 more options:

 # virt-install ....previous args... --os-type linux --os-variant fedora16

See the virt-install(1) manual page for the full list of supported OS types.

When virt-install launches the guest, a virt-viewer window should appear allowing interaction with the guest OS. Run through the guest OS installer process.

This test shall be considered successful if the guest installation process completes without error, and the guest OS then shuts down.

Bad behaviour requiring bug reports include

  • Installer kernel/OS hang
  • Unsupported disk or NIC interface
  • Disk / network I/O problems / errors

Essentially anything unusual as compared to installing the guest on bare metal.

Some OS may not support the default NIC or disk hardware. There are options for the --network and/or --disk options to virt-install to change the hardware, for example to switch from IDE to SCSI disks, or from e1000 to rtl8139 NICs.

File bugs against the 'virt-install' component if there was no '--os-variant' and the guest required custom hardware to successfully install. File bugs against 'qemu' in the event of any hangs/crashes/other wierd behaviour

If this test fails, skip the next two tests

[edit] Test case 3: Post-install first boot

Assuming a guest OS was successfully installed, it is time to try running it:

# virsh start $OSNAME
# virt-viewer $OSNAME

At the guest login prompt, login as the administrator and try to ping & connect to http://google.com

 # ping google.com
 # wget http://www.google.com  (or equivalent if you don't have wget)

This test shall be considered successful if the installed guest OS image booted & the administrator login was succesful

Be sure to check system logs for any unexpected error messages, and look out for things like unexpectedly slow disk/network I/O. File bugs against the "qemu" component if there were any problems

[edit] Test case 4: Disk image inspection

Assuming a guest OS was successfully installed, it is time to see if libguestfs can identify the disk image:

# virt-inspector /var/lib/libvirt/images/$OSNAME.qcow2

This test shall be considered successful if the above commands outputs an XML document containing an <operatingsystem> element and the following child elements

  • <name>
  • <distro>
  • <arch>
  • <major_version> + <minor_version>
  • <format>installed</installer>

If any of this data is missing, file a bug report against the libguestfs component, providing details of the ISO image you used

[edit] Reporting results

To keep the size of this page managable, results are to be reported on

[edit] Bugs

If you find bugs, please file them using this link:

https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora

For problems installing or booting guests, use the component 'qemu'. For problems inspecting the installation ISOs or disk images, use the component 'libguestfs'. Don't worry too much about getting the component perfect - the maintainers will re-assign bugs if the component is wrong.

[edit] IRC and mailing list

During the test day (2012-04-12) we will be on the #fedora-test-day IRC channel. The rest of the time, find us on #virt (on irc.oftc.net). There is also a Fedora virtualization mailing list.