Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010 KVM tutorial #1 Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010
Installing the virtualization packages Andrea Chierici
Installing KVM packages with Kickstart files In the %packages section of your Kickstart file, append the following package group: %packages @kvm Andrea Chierici
Installing KVM packages on an existing RHEL system The kvm package contains the KVM kernel module providing the KVM hypervisor on the default Red Hat Enterprise Linux kernel. To install the kvm package, run: # yum install kvm Recommended virtualization packages: python-virtinst, libvirt, libvirt-python, virt-manager, libvirt-client Check if service libvirtd is running Andrea Chierici
Virtualized guest prerequisites and considerations Various factors should be considered before creating any virtualized guests. Factors include: Performance Input/output requirements and types of input/output. Storage. Networking and network infrastructure. Guest load and usage for processor and memory resources. Andrea Chierici
Creating guests with virt-install You can use the virt-install command to create virtualized guests from the command line. virt-install is used either interactively or as part of a script to automate the creation of virtual machines virt-install –help Andrea Chierici
virt-install example This example creates a fedora14 guest with the following settings: Uses kvm acceleration X86_64 arch with 512mb ram, 30GB disk space Uses virtual networking Boots from remote kernel and initrd Uses VNC server/viewer # virt-install \ --connect qemu:///system \ --accelerate \ --arch x86_64 --name demo --ram 512 \ --os-variant fedora9 --network network:default \ --disk path=/var/lib/libvirt/images/rhel5support.img,size=30 --vnc --location http://bo.mirror.garr.it/mirrors/fedora/linux/releases/14/Fedora/x86_64/os/ Andrea Chierici
Creating guests with virt-manager Graphical tool for creating and managing virtualized guests Launch the Virtual Machine Manager application from the Applications menu and System Tools submenu. Alternatively, run the virt-manager command as root. Optional: Open a remote hypervisor Select the hypervisor and press the Connect button to connect to the remote hypervisor. Andrea Chierici
Create a new guest Specify name and installation type Easiest is network install Import existing disk image Andrea Chierici
Create a new guest It is recommend that you use the default directory for virtual machine images, /var/lib/libvirt/images/ If you are using a different location, make sure it is added to your SELinux policy and relabeled before you continue with the installation Andrea Chierici
Create a new guest Andrea Chierici
Create a new guest Care for network settings Bridge/NAT MAC address Andrea Chierici
Virt-manager main window Andrea Chierici
Guest details Andrea Chierici
Managing virtual network Andrea Chierici
Creating a virtual network Andrea Chierici
Installing guests with PXE Pre eXecution Environment requires a shared network device, also known as a network bridge The network infrastructure requires DHCP and tftp server properly configured Machine starts, sends a dhcp request with the next-server option, next-server sends kernel and initrd Check under rhel installation tree: SL/55/x86_64/images/pxeboot Andrea Chierici
Installing guests with PXE PXE installation with virt-install Use --pxe parameter at command line PXE installation with virt-manager Andrea Chierici
Installing a fully-virtualized Windows guest Install the machine using a iso image Download the virtio drivers http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-1.1.11-0.iso Mount the iso image on the VM Install the drivers Andrea Chierici
Adding a virtual cd-rom Andrea Chierici
On windows guest Open My Computer and select the CD-ROM drive Select correct installation files Reboot Andrea Chierici