Scott Radvan Dayle Parker Christopher CurranJan Mark HolzerRed Hat Enterprise Linux 5Virtualization GuideVirtualization Documentation
PrefaceThe Red Hat Enterprise Linux Virtualization Guide covers all aspects of using and managingvirtualization products included with Red Hat Enterpr
Press Forward to continue.10. Memo ry an d C PU allo cat ionThe Memory and CPU Allocation window displays. Choose appropriate values for thevirtual
Press Forward to continue.11. Verif y an d st art g u est in st allat io nVerify the configuration.Chapt er 8 . G uest operat ing syst em inst a
Press Finish to start the guest installation procedure.12. Inst allin g R ed H at En t erp rise Lin u xComplete the Red Hat Enterprise Linux 5 in
ImportantPresently, Red Hat Enterprise Linux hosts on the Itanium® architecture does not support fullyvirtualized Windows XP guests. Only Windows Ser
If you selected KVM or Xen earlier (step Step 1 ) you must use the hypervisor you selected.This example uses the KVM hypervisor.Windows can only be in
WarningFor ISO image files and guest storage images it is recommended to use the /var/lib/libvirt/images/ directory. Any other location will require a
Press Forward to continue.6. The Storage window displays. Choose a disk partition, LUN or create a file-based image forthe guest's storage.All i
Choose the appropriate size for the guest on your selected storage type and click theForward button.NoteIt is recommend that you use the default direc
Press Forward to continue.8. The Memory and CPU Allocation window displays. Choose appropriate values for thevirtualized CPUs and RAM allocation. The
9. Before the installation continues you will see the summary screen. Press Finish to proceedto the guest installation:Chapt er 8 . G uest operat i
The first example highlights a particular key to press. The second example highlights a keycombination: a set of three keys pressed simultaneously.If
10. You must make a hardware selection so open a console window quickly after the installationstarts. Click Finish then switch to the virt -man ag er
11. The installation continues with the standard Windows installation.Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu res107
12. Partition the hard drive when prompted.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e108
13. After the drive is formatted, Windows starts copying the files to the hard drive.Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu
14. The files are copied to the storage device, Windows now reboots.15. Restart your Windows guest:# virsh start WindowsGuestWhere WindowsGuest is t
17. If your installation seems to get stuck during the setup phase, restart the guest with virsh reboot WindowsGuestName. When you restart the virtua
18. After setup has finished you will see the Windows boot screen:19. Now you can continue with the standard setup of your Windows installation:Red
20. The setup process is complete.Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu res113
8.4. Inst alling Windows Server 2003 as a fully virt ualized guestThis chapter describes installing a fully virtualized Windows Server 2003 guest with
3. Complete the rest of the installation.Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu res115
2.2. Pull-quot e Convent ionsTerminal output and source code listings are set off visually from the surrounding text.Output sent to a terminal is set
4. Windows Server 2003 is now installed as a fully guest.8.5. Inst alling Windows Server 2008 as a fully virt ualized guestThis section covers instal
O p en virt - man ag erStart virt-manager. Launch the Virt u al Machin e Man ag er application from theAp p licat io n s menu and Syst em To o ls sub
Provide a name for your guest. Punctuation and whitespace characters are not permitted inversions before Red Hat Enterprise Linux 5.5. Red Hat Enterpr
Press Forward to continue.6. Select t h e in st allat io n met ho dFor all versions of Windows you must use local install media, either an ISO ima
Press Forward to continue.7. Locat e in st allat io n med iaSelect ISO image location or CD -ROM or DVD device. This example uses an ISO file image
Press Open to confirm your selection.c. The file is selected and ready to install.Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu re
Press Forward to continue.WarningFor ISO image files and guest storage images, the recommended directory to use is the/var/lib/libvirt/images/ directo
Press Forward to continue.9. Net wo rk set u pSelect either Virtual network or Shared physical device.The virtual network option uses Network Addres
Press Forward to continue.10. Memo ry an d C PU allo cat ionThe Memory and CPU Allocation window displays. Choose appropriate values for thevirtual
Press Forward to continue.11. Verif y an d st art g u est in st allat io nVerify the configuration.Chapt er 8 . G uest operat ing syst em inst a
WarningWarnings should not be ignored. Ignoring warnings will most likely cause data loss.3. We need your feedbackIf you find a typographical error in
Press Finish to start the guest installation procedure.12. Inst allin g Win d o wsRed Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e126
Complete the Windows Server 2008 installation sequence. The installation sequence is notcovered by this guide, see Microsoft's documentation for
Part III. ConfigurationConfiguring Virtualization in Red Hat Enterprise LinuxThese chapters cover configuration procedures for various advanced virtu
Chapter 9. Virtualized storage devicesThis chapter covers installing and configuring storage devices in virtual machines. The term blockdevices refers
# virsh dumpxml rhel5FV > rhel5FV.xmlThis saves the configuration settings as an XML file which can be edited to customize theoperations and device
a. Create a sparse file using the dd command. Sparse files are not recommended due todata integrity and performance issues. Sparse files are created
# fdisk /dev/sdbCommand (m for help):b. Press p for a primary partition.Command action e extended p primary partition (1-4)c. Choose an avai
System administrators use additional hard drives for to provide more storage space or to separatesystem data from user data. This procedure, Procedure
Systems which are not running multipath must use Single path configuration. Systems running multipath can use Multiple path configuration.Sin g le pat
/sbin/start_udevNetworked storage devices with configured rules now have persistent names on all hosts where thefiles were updated This means you can
Virtualization is a broad computing term for running software, usually operating systems,concurrently and isolated from other programs on one system.
Chapter 10. Network ConfigurationThis page provides an introduction to the common networking configurations used by libvirt basedapplications. This in
libvirt adds iptables rules which allow traffic to and from guests attached to the virbr0 devicein the INPUT, FORWARD, OUTPUT and POSTROUTING chains.
# chkconfig NetworkManager off# chkconfig network on# service NetworkManager stop# service network startNoteAs an alternative to turning off NetworkMa
NoteIP address configuration, be it dynamic or static, should be configured on the bridge itself (forexample, in the ifcfg-br0 file). Network access w
Chapter 11. Pre-Red Hat Enterprise Linux 5.4 Xen networkingThis chapter covers special topics for networking and network configuration with the Xen hy
Below is the commented out line and the new line, containing the network-xen-multi-bridge parameter to enable multiple network bridges:#network-script
ImportantThis section describes manually adding network bridges. This procedure is not required orrecommended for all versions of Red Hat Enterprise L
DEVICE=dummy0BOOTPROTO=noneONBOOT=yesUSERCTL=noIPV6INIT=noPEERDNS=yesTYPE=EthernetNETMASK=255.255.255.0IPADDR=10.1.1.1ARP=yes3. Bind xenbr0 to dummy0
echo "IP forwarding set to `cat /proc/sys/net/ipv4/ip_forward`" echo "done." ;;*)echo "Usage: $0 {start|restart|status}"
range=10.1.1.10,10.1.1.50,255.255.255.0,12hModify dhcp-option to override the default route supplied by dnsmasq, which assumes therouter is the same m
In essence, virtualization increases flexibility by decoupling an operating system and the servicesand applications supported by that system from a sp
Chapter 12. Xen Para-virtualized DriversPara-virtualized drivers provide increased performance for fully virtualized Red Hat Enterprise Linuxguests. U
drivers bring many of the performance advantages of para-virtualized guest operating systems tounmodified operating systems because only the para-virt
Red Hat Enterprise Linux 5 requires:kmod-xenpv.Red Hat Enterprise Linux 4 requires:kmod-xenpv,modules-init-tools (for versions prior to Red Hat Enterp
i686-PAE Supportedi686-SMP Supported (Intel) Supported i686-HUGEMEM Supported (Intel) Supported x86_64 Supported (AMD) Supported Supportedx86_64-SMP
For Red Hat Enterprise Linux 3 based guest operating systems you must use the processor specifickernel and para-virtualized driver RPMs as seen in the
NoteIf you are installing a new guest system, in order to gain maximal benefit from the para-virtualized block device drivers, you should create the g
<disk type='file' device='disk'> <driver name='file'/> <source file='/dev/hda6'/> <tar
4. Use the commands below load the para-virtualized driver modules. %kvariant is the kernelvariant the para-virtualized drivers have been build again
Modify each disk entry, as desired, to use the para-virtualized by changing the driverelements as shown below.<disk type='file' device=&a
# mknod /dev/xvdd b $major 32# mknod /dev/xvdd1 b $major 33Now you should verify the partitions which you have created are available.[root@rhel3]# cat
complementary workloads in your organization, you can dynamically allocate resources to theapplications which are currently experiencing the greatest
ImportantThe Itanium (ia64) binary RPM packages and builds are not presently available.12.3.3. Inst allat ion and Configurat ion of Para-virt ualiz ed
Add any additional disk partitions, volumes or LUNs to the guest so that they can beaccessed via the para-virtualized (xen-vbd) disk driver.For each a
In the above output, you can see the partitioned device “ xvdb” is available to the system.The procedure below adds the new device to the guest and m
NoteThese packages do not support booting from a para-virtualized disk. Booting the guestoperating system kernel still requires the use of the emulate
3 1 104391 hda1 3 2 10377990 hda2 202 0 64000 xvdb 202 1 32000 xvdb1 202 2 32000 xvdb2 253
8139cp8139tooe10002. Remove the old network scripts from the /etc/sysconfig/network-scripts directory.3. Reboot the guest. The default network inter
5. Select the 'Xen Virt ual Et hern et Card ( et h 0) ' entry and click 'Forward'.Configure the network settings as required.R
6. Complete the configuration by pressing the 'Apply' button.7. Press the 'Activate' button to apply the new settings and restar
8. You should now see the new network interface with an IP address assigned.ifconfig eth0eth0 Link encap:Ethernet HWaddr 00:16:3E:49:E4:E0
Add an additional entry to the “vif=” section of the configuration file similar to the one seen below.vif = [ "mac=00:16:3e:2e:c5:a9,bridge=xenb
Part I. Requirements and Limitations for Virtualization with RedHat Enterprise LinuxSystem requirements, support restrictions and limitationsThese ch
disk = [ "file:/var/lib/libvirt/images/rhel5_64_fv.dsk,hda,w", "tap:aio:/var/lib/libvirt/images/UserStorage1.dsk,xvda,w", &q
Chapter 13. KVM Para-virtualized DriversPara-virtualized drivers are available for virtualized Windows guests running on KVM hosts. Thesepara-virtuali
using a virtualized CD-ROM device of the driver installation disk .iso file, orusing a virtualized floppy device to install the drivers during boot ti
3. Select t h e d evice typ eThis opens a wizard for adding the new device. Select Storage from the dropdown menu.Chapt er 1 3. KVM Para- virt uali
Click the Forward button to proceed.4. Select t h e ISO fileChoose the File (disk image) option and set the file location of the para-virtualizeddr
6. Reb o o tReboot or start the guest to add the new device. Virtualized IDE devices require a restartbefore they can be recognized by guests.Once th
2. Select t h e correct in st allat io n f ilesThere are four files available on the disc. Select the drivers you require for your guest'sarc
Press Next to continue.b. Co n f irm t h e excep t io nWindows may prompt for a security exception.Press Yes if it is correct.c. Fin ishChapt er 1
Press Finish to complete the installation.4. In st all t h e n et wo rk d evice d rivera. St art t h e n et wo rk d evice driver in st allat io nDo
Press Next to continue.b. Perf o rman ce set tin gThis screen configures advanced TCP settings for the network driver. TCP timestampsand TCP window s
Chapter 1. System requirementsThis chapter lists system requirements for successfully running virtualization with Red Hat EnterpriseLinux.The requirem
Windows may prompt for a security exception.Press Yes if it is correct.d. Fin ishPress Finish to complete the installation.5. Reb o o tReboot the gu
Change the device configuration to use the para-virtualized drivers (Section 13.3, “ Using KVM para-virtualized drivers for existing devices” ) or ins
Install the drivers firstEnsure the drivers have been installed on the Windows guest before proceeding to install newdevices. If the drivers are unava
5. Press Finish to save the device.Chapt er 1 3. KVM Para- virt ualized Drivers179
6. Reboot the guest. The device may not be recognized until the Windows guest restarts.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e180
Chapter 14. Installing Red Hat Enterprise Linux 6 as a Xen gueston Red Hat Enterprise Linux 5This chapter describes the installation of Red Hat Enterp
NoteRed Hat Enterprise Linux can be installed without a graphical interface or manualinput. Use a Kickstart file to automate the installation process.
Fig u re 14 .1. T h e virt u al mach in e creat io n wiz ardClick Forward to continue.4. Name t he virt u al mach in eProvide a name for your virtua
Fig u re 14 .2. T h e virt u al mach in e creat io n wiz ardClick Forward to continue.5. Select t h e virt u aliz at io n met h o dSelect the appr
Fig u re 14 .3. T h e virt u al mach in e creat io n wiz ardClick Forward to continue.6. Select t h e in st allat io n met h o d and t yp eSelect
KVM requ iremen t sThe KVM hypervisor requires:an Intel processor with the Intel VT and the Intel 64 extensions, oran AMD processor with the AMD -V an
Fig u re 14 .4 . T h e virt ual mach in e creat io n wiz ardClick Forward to continue.7. Lo cat e in st allat io n med iaEnter the location of the
Fig u re 14 .5. T h e virt u al mach in e creat io n wiz ardClick Forward to continue.8. St o rag e set u pImportantXen file-based images should be
Fig u re 14 .6 . T h e virt ual mach in e creat io n wiz ardClick Forward to continue.NoteLive and offline migrations require guests to be installed
Fig u re 14 .7. T h e virt u al mach in e creat io n wiz ardClick Forward to continue.10. Memo ry an d CPU allo cat io nThe Memory and CPU Allocat
Fig u re 14 .8. T h e virt u al mach in e creat io n wiz ardClick Forward to continue.11. Verif y an d st art g u est in st allat io nVerify the
Fig u re 14 .9 . T h e virt ual mach in e creat io n wiz ardClick Finish to start the guest installation procedure.12. In st allin g Red Hat En t
Chapter 15. PCI passthroughThis chapter covers using PCI passthrough with Xen and KVM hypervisors.KVM and Xen hypervisors support attaching PCI device
En able AMD IO MMU ext en sio n sThe AMD IOMMU extensions are required for PCI passthrough with Red Hat Enterprise Linux. Theextensions must be enable
Each PCI device is identified by a string in the following format (where 8086 is a variable thatin this case represents Intel equipment, and **** is a
Run virsh edit (or virsh attach device) and add a device entry in the <devices> sectionto attach the PCI device to the guest. Only run this comm
Chapter 2. Xen restrictions and supportRed Hat Enterprise Linux 5 supports various combinations for hosts and guests. Processor andmemory limitations
Each PCI device is identified by a string in the following format (where 8086 is a variable thatin this case represents Intel equipment, and **** is a
5. Ad d t h e n ew d eviceSelect Ph ysical Ho st Device from the Hardware type list. The Ph ysical Ho st Devicerepresents PCI devices. Click Forwar
6. Select a PCI d eviceSelect an unused PCI device. Note that selecting PCI devices presently in use on the hostcauses errors. In this example a PCI
7. Co nf irm t h e n ew d eviceClick the Finish button to confirm the device setup and add the device to the guest.Chapt er 1 5. PCI passt hrough199
The setup is complete and the guest can now use the PCI device.15.3. PCI passt hrough wit h virt -inst allTo use PCI passthrough with the virt-install
NoteComparing lspci output to lspci -n (which turns off name resolution) output canassist in deriving which device has which device identifier code.2.
# virsh nodedev-reattach pci_8086_3a6c15.5. PCI passt hrough for para-virt ualized Xen guest s on Red HatEnt erprise LinuxPCI passthrough is used to a
WarningDue to interrupt tracking, repeatedly hotplugging or hotunplugging an assigned device morethan 512 times in a brief period of time can cause a
Chapter 16. SR-IOV16.1. Int roduct ionThe PCI-SIG (PCI Special Interest Group) developed the Single Root I/O Virtualization (SR-IOV)specification. The
This section covers attaching Virtual Function to a guest as an additional network device.SR-IOV requires Intel VT-d support.ImportantXen requires add
Chapter 3. KVM restrictions and supportThe KVM hypervisor requires a processor with the Intel-VT or AMD-V virtualization extensions.To verify the pres
# modprobe igb [<option>=<VAL1>,<VAL2>,]# lsmod |grep igbigb 87592 0dca 6708 1 igb4. Act ivat e Virt u al Fu n ct io n sT
The pci_8086_10c9 is one of the Physical Functions and pci_8086_10ca_0 is the firstcorresponding Virtual Function for that Physical Function. Use the
d. The default text editor will open the libvirt configuration file for the guest. Add the newdevice to the devices section of the XML configuration
Chapter 17. KVM guest timing managementVirtualization poses various challenges for guest time keeping. Guests which use the Time StampCounter (TSC) as
ImportantThese instructions are for AMD revision F cpus only.If the CPU lacks the constant_tsc bit, disable all power management features (BZ #513138)
WarningThe divider kernel parameter was previously recommended for Red Hat Enterprise Linux 4and 5 guests that did not have high responsiveness requir
NoteThe boot.ini file is no longer used in Windows Vista and newer. As shown in this procedure,Windows Vista, Windows Server 2008 and Windows 7 use th
Part IV. AdministrationAdministering virtualized systemsThese chapters contain information for administering host and guests using tools included in
Chapter 18. Server best practicesThe following tasks and tips can assist you with securing and ensuring reliability of your Red HatEnterprise Linux 5
Chapter 19. Security for virtualizationWhen deploying virtualization technologies on your corporate infrastructure, you must ensure thatthe host canno
Chapter 4. Hyper-V restrictions and supportCertification of guests running under the Microsoft Hyper-V server is conducted by Microsoft. Red HatEnterp
Pro ced u re 19 .1. Creat in g an d mou n t in g a lo g ical vo lu me o n a g u est wit h SELin u xen ab led1. Create a logical volume. This ex
The Boolean parameter xend_disable_t can set the xend to unconfined mode after restarting thedaemon. It is better to disable protection for a single d
Enabling IP forwarding (net.ipv4.ip_forward = 1) is required for virtual bridge devices.Note that installing libvirt enables this variable so it will
Chapter 20. Managing guests with xendThe xen d node control daemon performs certain system management functions that relate to virtualmachines. This
( xen d - relo cat io n - ad d ress) Determines the host addresses allowed formigration. The default value is the value of xend-address.( xen d - ad d
Chapter 21. Xen live migrationThe Xen hypervisor supports Virtualization Migration for para-virtualized guests and fully virtualizedguests. Migration
(xend-relocation-server yes)The default value, which disables migration, is no. Change the value of xend-relocation-server to yes to enable migration.
Below is an example of how to setup a simple environment for live migration. This configuration isusing NFS for the shared storage. NFS is suitable fo
[et-virt07 ~]# brctl showbridge name bridge id STP enabled interfacesxenbr1 8000.feffffffffff no pet
Verify the virtual machine is running:[et-virt07 ~]# virsh list Id Name State----------------------------------Domain-0
Chapter 5. Virtualization limitationsThis chapter covers additional limitations of the virtualization packages in Red Hat Enterprise Linux.5.1. Genera
Create the following script inside the virtual machine to log date and hostname during the migration.This script performs I/O tasks on the guest'
dhcp78-218.lab.boston.redhat.comFri Jan 12 02:26:51 EST 2007dhcp78-218.lab.boston.redhat.comFri Jan 12 06:54:57 EST 2007dhcp78-218.lab.boston.redhat.c
Fri Jan 12 06:57:53 EST 2007dhcp78-218.lab.boston.redhat.comFri Jan 12 06:57:56 EST 2007dhcp78-218.lab.boston.redhat.comFri Jan 12 06:58:00 EST 2007Fi
[et-virt08 ~]# time virsh migrate --live testvm1 et-virt07real 0m10.378suser 0m0.068ssys 0m0.052sAt this point you have successfully perform
Chapter 22. KVM live migrationThis chapter covers migrating guests running on a KVM hypervisor to another KVM host.Migration is the process of moving
iSCSINFSGFS2Two or more Red Hat Enterprise Linux systems of the same version with the same updates.Both system must have the appropriate ports open.Bo
3. Mo u n t th e sh ared st o rag e o n t h e d est in at io nOn the destination system, mount the /var/lib/libvirt/images directory:# mount sour
Execute the following command to live migrate the guest to the destination, test2.example.com. Append /system to the end of the destination URL to tel
The Virtual Machine Manager displays a list of connected hosts.2. Add a storage pool with the same NFS to the source and target hosts.On the Ed it m
3. Add a new storage pool. In the lower left corner of the window, click the + button. The Add aNew Storage Pool window appears.Enter the following d
Para-virtualized devices, which use the virtio drivers, are PCI devices. Presently, guestsare limited to a maximum of 32 PCI devices. Some PCI devices
Format: Select the storage type. This must be NFS or iSCSI for live migrations.Host Name: Enter the IP address or fully-qualified domain name of the s
7. Create a virtual machine with the new volume, then run the virtual machine.The Virtual Machine window appears.Chapt er 2 2 . KVM live migrat ion2
8. In the Virtual Machine Manager window, right-click on the virtual machine, select Mig rat e,then click the migration location.Red Hat En t erp ri
9. Click Yes to confirm migration.The Virtual Machine Manager displays the virtual machine in its new location.The VNC connection displays the remote
Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e24 0
Chapter 23. Remote management of guestsThis section explains how to remotely manage your guests using ssh or TLS and SSL.23.1. Remot e management wit
Generate a public key pair on the machine virt-manager is used. This example uses thedefault key location, in the ~/.ssh/ directory.$ ssh-keygen -t rs
the same technology used by web browsers for secure connections. The libvirt managementconnection opens a TCP port for incoming connections, which is
libvirt-vnc or clientkey.pem - The client private key.23.3. T ransport modesFor remote management, libvirt supports the following transport modes:T r
xen+ssh://ccurran@towada/Connect to a remote Xen hypervisor on the host named towada using TLS.xen://towada/Connect to a remote Xen hypervisor on host
NoteThere are two methods for working around the para-virtualized device limit: using phy devices(devices using the physical access mode) or using LVM
command ssh and ext The external command.For ext transport this isrequired. For ssh thedefault is ssh. ThePATH is searched forthe command.command=/opt
no_tty ssh If set to a non-zerovalue, this stops sshfrom asking for apassword if it cannotlog in to the remotemachine automatically(for using ssh-agen
Part V. Virtualization Storage TopicsIntroduction to storage administration for virtualizationThis part covers using shared, networked storage with v
Chapter 24. Using shared storage with virtual disk imagesThis chapter covers the use of shared and network storage devices for virtual disks.24.1. Usi
3. Exp o rt t h e iSCSI t arg et an d LUN sFor Red Hat Enterprise Linux 5, several tgtadm commands are required to create a targetand associate th
Removable media: No Readonly: No Backing store type: rdwr Backing store path: /var/lib/tgtd/kvmguest/shar
</source> <target> <path>/dev/disk/by-path</path> </target></pool>Save this XML code to a file na
04.rhel:rhel5:iscsi.kvmguest-lun-2</path> <format type='unknown'/> <permissions> <mode>0660</mode>
<address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='bl
Part VI. Virtualization Reference GuideVirtualization commands, system tools, applications andadditional systems referenceThese chapters provide deta
A limit of 254 para-virtualized block devices per host. The total number of block devices (using thetap:aio driver) attached to guests cannot exceed 2
Chapter 25. Virtualization toolsThe following is a list of tools for virtualization administration, debugging and networking tools thatare useful for
topology change timer 0.00 gc timer 0.02flagsvif13.0 (3)port id 8003 state
Chapter 26. Managing guests with virshvirsh is a command line interface tool for managing guests and the hypervisor.The virsh tool is built on the lib
vcpupinControls the virtual CPU affinity of a guest.domblkstatDisplays block device statistics for a runningguest.domifstatDisplays network interface
This file guest.xml can recreate the guest (see Editing a guest's configuration file. You can edit thisXML configuration file to configure additi
and network I/O does not occur while the guest is suspended. This operation is immediate and theguest can be restarted with the resume (Resuming a gue
This command does an immediate ungraceful shutdown and stops the specified guest. Using virsh destroy can corrupt guest file systems . Use the destroy
# virsh nodeinfoCPU model x86_64CPU (s) 8CPU frequency 2895 MhzCPU socket(s) 2
# virsh vcpuinfo {domain-id, domain-name or domain-uuid}An example of virsh vcpuinfo output:# virsh vcpuinfo r5b2-mySQL01VCPU: 0CPU:
Disp layin g g u est n et wo rk d evice in f o rmat io nUse virsh domifstat to display network interface statistics for a running guest.# virsh domi
Part II. InstallationVirtualization installation topicsThese chapters describe setting up the host and installing guests with Red Hat Enterprise Linu
<range start='192.168.100.128' end='192.168.100.254' /> </dhcp> </ip></network>Other virsh comma
Chapter 27. Managing guests with the Virtual Machine Manager(virt-manager)This section describes the Virtual Machine Manager (virt-manager) windows, d
27.2. T he Virt ual Machine Manager main windowThis main window displays all the running guests and resources used by guests. Select a guest bydouble
Fig u re 27.3. T h e Overview t ab27.4. Virt ual Machine graphical consoleThis window displays a virtual machine's graphical console. Para-virtua
Fig u re 27.4 . G rap h ical co n sole win d o wNoteVNC is considered insecure by many security experts, however, several changes have beenmade to ena
The virt-manager main window appears.Fig u re 27.5. St art in g virt-managerAlternatively, virt-manager can be started remotely using ssh as demonstr
Fig u re 27.6 . R est o rin g a virt u al mach in e2. The Restore Virtual Machine main window appears.3. Navigate to correct directory and select t
You can use the Virtual Machine Monitor to view activity data information for any virtual machines onyour system.To view a virtual system's detai
On the Virtual Machine window, click the Overview tab.The Overview tab summarizes CPU and memory usage for the guest you specified.Fig u re 27.10. D i
4. On the Hardware tab, click on Processor to view or change the current processorallocation.Fig u re 27.12. Pro cesso r allo cat io n p an el5. On
Chapter 6. Installing the virtualization packagesBefore you can use virtualization, the virtualization packages must be installed on Red HatEnterprise
Fig u re 27.14 . Disp layin g d isk co n f ig u rat io n7. On the Hardware tab, click on NIC to view or change the current network configuration.Fig
Fig u re 27.16 . Mo d if yin g g u est p ref eren cesThe Preferences window appears.2. From the Stats tab specify the time in seconds or stats poll
Fig u re 27.18. Viewin g g u est ID s2. The Virtual Machine Manager lists the Domain IDs for all domains on your system.Fig u re 27.19 . Disp layin
Fig u re 27.20. Select in g a virt u al mach in e' s st at u s2. The Virtual Machine Manager lists the status of all virtual machines on your s
Fig u re 27.22. Select in g t h e virt u al C PUs o p t io n2. The Virtual Machine Manager lists the Virtual CPUs for all virtual machines on your s
Fig u re 27.24 . Select in g CPU u sag e2. The Virtual Machine Manager lists the percentage of CPU in use for all virtual machines onyour system.Fig
Fig u re 27.26 . Select in g Memo ry Usag e2. The Virtual Machine Manager lists the percentage of memory in use (in megabytes) for allvirtual machin
Fig u re 27.28. Select in g a h o st ' s det ails2. This will open the Ho st Det ails menu. Click the Virtual Networks tab.Fig u re 27.29 . Vi
To create a virtual network on your system:1. Open the Host Details menu (see Section 27.14, “Managing a virtual network” ) and clickthe Add button.F
Fig u re 27.31. C reat in g a n ew virt ual net wo rk2. Enter an appropriate name for your virtual network and click Forward.Chapt er 2 7 . Man agi
Select the Virtualization package group and the Customize Now radio button.4. Select the Virtualization package group. The Virtualization package gro
Fig u re 27.32. N amin g yo u r virt u al n et wo rk3. Enter an IPv4 address space for your virtual network and click Forward.Red Hat En t erp rise
Fig u re 27.33. C h o o sin g an IPv4 add ress sp ace4. Define the DHCP range for your virtual network by specifying a Start and End range of IPad
Fig u re 27.34 . Select in g t h e DHCP ran g e5. Select how the virtual network should connect to the physical network.Red Hat En t erp rise Lin u
Fig u re 27.35. C o n n ect in g t o p h ysical n et workIf you select Forwarding to physical network, choose whether the Destinationshould be NAT t
Fig u re 27.36 . Read y to creat e n et wo rk7. The new virtual network is now available in the Virt u al Net wo rk tab of the Ho st Det ailsmenu.R
Fig u re 27.37. N ew virt u al n et wo rk is no w availab leChapt er 2 7 . Man aging guest s wit h t he Virt ual Machine Manager (virt - manager)291
Chapter 28. The xm command quick referenceThe xm command can manage the Xen hypervisor. Most operations can be performed with the libvirttools, virt -
Use the following xm commands to manage resources:xm mem-setuse the xm vcpu-list to list virtualized CPU affinities:$ xm vcpu-listName
Chapter 29. Configuring the Xen kernel boot parametersThe GNU Grand Unified Boot Loader (GRUB) is a program for booting various installed operatingsys
/* "acpi=ht": Limits ACPI from boot-time to enable HT. *//* "acpi=noirq": Disables ACPI interrupt routing.
Red Hat Enterprise Linux 5 Virtualization GuideVirtualization DocumentationSco tt RadvanRed Hat Engineering Content [email protected] mDayle P
Cu st o miz e t h e p ackag es ( if req u ired )Customize the Virtualization group if you require other virtualization packages.Press the Close butto
Chapter 30. Configuring ELILOELILO is the boot loader used on EFI-based systems, notably Itanium® . Similar to the GRUB, theboot loader on x86 and x86
To customize the hypervisor, insert parameters before the --. An example of the hypervisor memory(mem) parameter and the quiet parameter for the kerne
Additionally this example removes the kernel parameters "rhgb quiet" so that kernel and initscript output are generated on the console. Not
Chapter 31. libvirt configuration referenceThis chapter provides is a references for various parameters of libvirt XML configuration filesT ab le 31.1
Chapter 32. Xen configuration filesRed Hat Enterprise Linux uses libvirt configuration files for most tasks. Some users may need Xenconfiguration file
on_poweroff=destroy | restart | preserve |destroyBehavior when a domain exits with reason'poweroff'. - destroy: the domain is cleaned upas n
vfb=type={vnc,sdl}, vncunused=1, vncdisplay=N,vnclisten=ADDR, display=DISPLAY, xauthority=XAUTHORITY, vncpasswd=PASSWORD,keymap=KEYMAPMake the domain
extra=ARGSSet extra arguments to append to the kernelcommand line.ip=IPADDRSet the kernel IP interface address.gateway=IPADDRSet the kernel IP gateway
Parser f u n ct io n Valid arg u men t sset_boolAccepted values:yesynoyesset_floatAccepts a floating point number with Python'sfloat(). For exam
on_crash set_valueNoneblkif set_bool0netif set_bool0tpmif append_value0disk append_value[]pci append_value[]ioports append_value[]irq append_value[]us
NoteFully virtualized guests on the Itanium® architecture require the guest firmware imagepackage (xen-ia64-guest-firmware). Append the following pac
Part VII. Tips and TricksTips and Tricks to Enhance ProductivityThese chapters contain useful hints and tips to improve virtualization performance, s
Chapter 33. Tips and tricksThis chapter contain useful hints and tips to improve virtualization performance, scale and stability.33.1. Aut omat ically
# yum install kvm2. Verif y wh ich kern el is in u seThe kernel-xen package may be installed. Use the uname command to determine which kernelis ru
Reb o o t t o lo ad t h e n ew kern elReboot the system. The computer will restart with the default kernel. The KVM module shouldbe automatically l
kernel /xen.gz-2.6.18-159.el5 module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.1
Command format:# qemu-img convert [-c] [-e] [-f format] filename [-O output_format] output_filenameConvert the disk image filename to disk image outpu
Linux Compressed Loop image, useful only to reuse directly compressed CD -ROM imagespresent for example in the Knoppix CD -ROMs.33.4 . Overcommit t in
Overcommitting guests by swapping out temporarily unused guest memory can be very slow, due tothe IO latency introduced by disk seek times. However, R
terminal --timeout=10 serial consoletitle Red Hat Enterprise Linux Server (2.6.17-1.2519.4.21.el5xen) root (hd0,0) kernel /xen.gz-2.6.17-1.2519.4.21.e
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc pni monitor ds_cp
virt-managervirt-manager, also known as Virt u al Mach in e Man ag er, provides a graphical tool foradministering virtual machines. It uses libvirt li
WarningGuests must be offline before their files can be read. Editing or reading files of an active guestis not possible and may cause data loss or da
Many Linux guests use Logical Volume Management (LVM) volumes. Additional steps are required toread data on LVM volumes on virtual storage images.1.
By default, libvirt provisions guests using the hypervisor's default policy. For most hypervisors, thepolicy is to run guests on any available pr
</cells> </topology> <secmodel> <model>selinux</model> <doi>0</doi> </secmodel&g
</cpus> </cell> </cells></topology>2. Observe that the node 1, <cell id='1'>, has physical CPUs 4 to 7.
CPU: 1State: runningCPU Affinity: yyyyyyyyVCPU: 3CPU: 2State: runningCPU Affinity: yyyyyyyyThe v
mac = [ 0x00, 0x16, 0x3e, random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] return ':'.join(map(lambd
rate=10Mb/sLimit the outgoing network traffic from the guest to 10MB/s.rate=250KB/sLimit the outgoing network traffic from the guest to 250KB/s.rate=1
root (hd0, 0)kernel /xen.gz-2.6.17-1.2519.4.21.el5 com1=115200,8n1 module /vmlinuz-2.6.17-1.2519.4.21el5xen ro root=/dev/VolGroup00/LogVol00 mod
33.14 . Configuring LUN Persist enceThis section covers how to implement LUN persistence in guests and on the host machine with andwithout multipath.I
Select the Virtualization package group and the Customize Now radio button.4. Select the KVM package group. Deselect the Virtualization package group
}multipath { wwid 3600a0b80001327510000015427b625e alias oramp3}multipath { wwid 3600a0b800
echo "D-BUS per-session daemon address is: \ $DBUS_SESSION_BUS_ADDRESS"fiexec gnome-session33.18. Cloning guest configurat ion filesYou c
Now, adjust the system configuration settings on your guest:/etc/sysconfig/networkModify the HOSTNAME entry to the guest's new hostname./etc/sysc
Chapter 34. Creating custom libvirt scriptsThis section provides some information which may be useful to programmers and systemadministrators intendin
Part VIII. TroubleshootingIntroduction to Troubleshooting and Problem SolvingThe following chapters provide information to assist you in troubleshoot
Chapter 35. Troubleshooting XenThis chapter covers essential concepts to assist you in troubleshooting problems in Xen.Troubleshooting topics covered
These networking tools can assist with troubleshooting virtualization networking problems:ifconfigtcpdumpThe tcpdump command 'sniffs' networ
When deploying Red Hat Enterprise Linux 5 with Virtualization into your network infrastructure, thehost's Virtualization software uses many speci
The /etc/xen directory contains the configuration files that you use to manage systemresources. The xend daemon configuration file is /etc/xen/xend-co
module /vmlinuz-2.618-8.el5xen ro root=LABEL=/rhgb quiet console=xvc console=tty xencons=xvc module /initrd-2.6.18-8.el5xen.imgThe sync_console can
Customize the Virtualization group if you require other virtualization packages.Press the Close button then the Forward button to continue the install
Error: Error connecting to xend: Connection refused. Is xend running?Try to run xend start manually and receive more errors:Error: Could not obtain ha
title Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen) root (hd0, 8) kernel /boot/xen.gz-2.6.18-92.el5 com1=115200,8n1 module /boot/vmlinuz-2.6.
# Log all guest console output (cf xm console)XENCONSOLED_LOG_GUESTS=yesReboot the host to activate logging the guest serial console output.Logs from
The example below is a typical a para-virtualized guest configuration file:name = "rhel5vm01"memory = "2048"disk = ['tap:aio:
You can check the amount of memory in use by domain0 by using the xm list domain0command. If dom0 is not ballooned down, you can use the command virsh
# Do not remove the following line, or various programs# that require network functionality will fail.127.0.0.1 localhost.localdomain localhostlocalho
declared; see http://www.python.org/peps/pep-0263.html for detailsexecfile (defconfig, globs, locs,)Error: invalid syntax 9win2k3xen12, line1)Python g
Chapter 36. TroubleshootingThis chapter covers common problems and solutions with Red Hat Enterprise Linux virtualization.36.1. Ident ifying available
options loop max_loop=64This example uses 64 but you can specify another number to set the maximum loop value. You mayalso have to imp
“ default=X” (where X is a number starting at '0') to correspond to the entry with your kernel-xenline. The numbering starts at '0&apo
Ad d in g p ackag es t o yo u r list o f Red Hat acco u n t en t it lemen t sThis section describes how to enable entitlements in your Red Hat
# Do not remove the following line, or various programs# that require network functionality will fail.localhost.localdomain localhostThe correct entry
The virtualization extensions are sometimes disabled in BIOS, usually by laptop manufacturers. SeeSection 36.12, “ Enabling Intel VT and AMD-V virtual
A workaround is to switch to a different type of virtualized NIC. For example, Intel PRO/1000 (e1000)or virtio (the para-virtualized network driver).T
3. Create the new virtual machine:# virsh define /tmp/new-guest.xml# virsh start new-guestThe network performance should be better with the e1000 or
Chapter 37. Troubleshooting the Xen para-virtualized driversThis chapter deals with issues you may encounter with Xen hosts and fully virtualized Red
NoteThe logfile is overwritten every time you start virt - manag er. If you are troubleshooting aproblem with virt - man ag er make sure you save the
displayed. A shortened excerpt of the error can be seen below.# insmod xen-platform-pci.o Warning: kernel-module version mismatchxen-platform-pci.o wa
37.5. Verifying t he para-virt ualized drivers have successfully loadedOne of the first tasks you will want to do is to verify that the drivers have a
Additional resourcesTo learn more about virtualization and Red Hat Enterprise Linux, see the following resources.A.1. Online resourceshttp://www.cl.ca
create programs that interface with the libvirt virtualization management library./usr/share/doc/python-virtinst-<version-number> — Provides doc
Chapter 7. Guest installation overviewAfter you have installed the virtualization packages on the host system you can create guestoperating systems. Y
ColophonThis manual was written in the DocBook XML v4.3 format.This book is based on the work of Jan Mark Holzer, Chris Curran and Scott Radvan.Other
SpanishAngela GarciaGladys GuerreroRussianYuliya PoyarkovaColophon357
Pro ced u re 7.1. Creat in g a gu est wit h virt - man ag er1. O p en virt - man ag erStart virt-manager. Launch the Virt u al Machin e Man ag er
4. New g u est wiz ardThe Create a new virtual machine window provides a summary of the information youmust provide in order to create a virtual mac
Review the information for your installation and click the Forward button.5. Name t h e virt u al mach in eProvide a name for your guest. Punctuation
Legal NoticeCopyright © 2008–2014 Red Hat, Inc.This do cument is licensed by Red Hat under the Creative Commo ns Attributio n-ShareAlike 3.0Unported
Press Forward to continue.6. Ch o o se virt u aliz at io n met h o dThe Choosing a virtualization method window appears. Choose between Para-virtual
Choose the virtualization type and click the Forward button.7. Select t h e inst allat io n met h o dThe Installation Method window asks for the ty
guest. Setting up a PXE server is covered in the Red Hat Enterprise Linux DeploymentGuide. Using this method requires a guest with a routable IP addre
If Local install media was selected in the previous step this screen is calledInstall Media.Select the location of an ISO image or select a DVD or CD-
Click the Forward button to proceed.c. Net wo rk b o o t ( PXE)PXE installation does not have an additional step.9. St o rag e set u pThe Storage w
Choose the appropriate size for the guest on your selected storage type and click theForward button.NoteIt is recommend that you use the default direc
Press Forward to continue.11. Memo ry an d C PU allo cat io nThe Memory and CPU Allocation window displays. Choose appropriate values for thevirtual
Press Forward to continue.12. Verif y an d st art g u est in st allat io nThe Finish Virtual Machine Creation window presents a summary of allconf
A VNC window opens showing the start of the guest operating system installation process.This concludes the general process for creating guests with vi
TYPE=BridgeBOOTPROTO=dhcpONBOOT=yesWarningThe line, TYPE=Bridge, is case-sensitive. It must have uppercase 'B' andlower case 'ridge&apo
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# brctl showbridge name bridge id STP enabled interfacesinstallation 8000.001320f76e8e no eth1virbr0
PXE inst allat io n wit h virt - man ag erThe steps below are the steps that vary from the standard virt-manager installation procedures. Forthe sta
3. St art t h e in st allat io nThe installation is ready to start.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e4 8
A DHCP request is sent and if a valid PXE server is found the guest installation processes will start.Chapt er 7 . G uest inst allat ion overview4 9
Chapter 8. Guest operating system installation proceduresThis chapter covers how to install various guest operating systems in a virtualized environme
# virt-install -n rhel5PV -r 500 \-f /var/lib/libvirt/images/rhel5PV.dsk -s 3 --vnc -p \-l ftp://10.1.1.1/trees/RHEL5-B2-Server-i386/NoteRed Hat Enter
2. Select the keyboard layout and click OK.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e52
3. Assign the guest's network address. Choose to use DHCP (as shown below) or a static IPaddress:Chapt er 8 . G uest operat ing syst em inst a
4. If you select DHCP the installation process will now attempt to acquire an IP address:Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e54
5. If you chose a static IP address for your guest this prompt appears. Enter the details on theguest's networking configuration:a. Enter a val
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6. This is an example of a static IP address configuration:Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e56
7. The installation process now retrieves the files it needs from the server:Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu res57
Once the initial steps are complete the graphical installation process starts.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e58
If you are installing a Beta or early release distribution confirm that you want to install the operatingsystem. Click Install Anyway, and then click
Pro ced u re 8.2. T h e g rap h ical in st allat io n p ro cess1. Enter a valid registration code. If you have a valid Red Hat subscription key plea
NoteIf you skip the registration step, confirm your Red Hat account details after theinstallation with the rhn_register command. The rhn_register comm
Click Yes to continue.3. Review the storage configuration and partition layout. You can chose to select the advancedstorage configuration if you want
5. Configure networking and hostname settings. These settings are populated with the dataentered earlier in the installation process. Change these se
7. Enter the root password for the guest.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e64
Click Forward to continue.8. Select the software packages to install. Select the Customize Now button. You must installthe kernel-xen package in the
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Click Forward.9. Dependencies and space requirements are calculated.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e66
10. After the installation dependencies and space requirements have been verified click Forwardto start the actual installation.Chapt er 8 . G uest
11. All of the selected software packages are installed automatically.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e68
12. After the installation has finished reboot your guest:Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu res69
13. The guest will not reboot, instead it will shutdown..Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e70
14. Boot the guest. The guest's name was chosen when you used the virt-install inSection 8.1, “ Installing Red Hat Enterprise Linux 5 as a para-
Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e72
15. Booting the guest starts the First Boot configuration screen. This wizard prompts you for somebasic configuration choices for your guest.16. Rea
Click Forward on the license agreement windows.17. Configure the firewall.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e74
Click Forward to continue.a. If you disable the firewall you will be prompted to confirm your choice. Click Yes toconfirm and continue. It is not rec
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18. Configure SELinux. It is strongly recommended you run SELinux in enforcing mode. Youcan choose to either run SELinux in permissive mode or comple
Click Forward to continue.a. If you choose to disable SELinux this warning displays. Click Yes to disable SELinux.Chapt er 8 . G uest operat ing sy
19. Disable kdump. The use of kdump is unsupported on para-virtualized guests.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e78
Click Forward to continue.20. Confirm time and date are set correctly for your guest. If you install a para-virtualized guesttime and date should syn
Click Forward to continue.21. Set up software updates. If you have a Red Hat account or want to trial one use the screenbelow to register your newly
Click Forward to continue.a. Confirm your choices for RHN.Chapt er 8 . G uest operat ing syst em inst allat ion pro cedu res81
b. You may see an additional screen if you did not configure RHN access. If RHN accessis not enabled, you will not receive software updates.Red Hat
Click the Forward button.22. Create a non root user account. It is advised to create a non root user for normal usage andenhanced security. Enter the
Click the Forward button.23. If a sound device is detected and you require sound, calibrate it. Complete the process andclick Forward.Red Hat En t e
24. You can install additional packages from a CD or another repository using this screen. It isoften more efficient to not install any additional so
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25. The guest now configure any settings you changed and continues the boot process.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e86
26. The Red Hat Enterprise Linux 5 login screen displays. Log in using the username created inthe previous steps.Chapt er 8 . G uest operat ing sys
27. You have now successfully installed a para-virtualized Red Hat Enterprise Linux guest.Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e88
8.2. Inst alling Red Hat Ent erprise Linux as a fully virt ualized guestThis section covers installing a fully virtualized Red Hat Enterprise Linux 5
Connect to a hypervisor if you have not already done so. Open the File menu and select theAdd Connection... option. See Section 27.1, “ The Add Connec
Press Forward to continue.5. Ch o o se a virt u aliz at io n met ho dChoose the virtualization method for the guest. Note you can only select an in
Press Forward to continue.6. Select t h e in st allat io n met ho dRed Hat Enterprise Linux can be installed using one of the following methods:lo
Press Forward to continue.7. Locat e in st allat io n med iaSelect ISO image location or CD -ROM or DVD device. This example uses an ISO file image
Press Forward to continue.WarningFor ISO image files and guest storage images the recommended directory is /var/lib/libvirt/images/. Any other locatio
Press Forward to continue.NoteLive and offline migrations require guests to be installed on shared network storage.For information on setting up share
Commenti su questo manuale