Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 10. Virtualization
In order to manage and provision your client systems, you must first synchronize content from RHN's central servers to your Satellite.
RHN recommends that you sync at least the following channels:
For Red Hat Enterprise Linux 5:
- Red Hat Enterprise Linux Server (v. 5 for 32-bit x86) — rhel-i386-server-5 (and all child channels)
- Red Hat Network Tools for RHEL Server (v. 5 for 32-bit x86) — rhn-tools-rhel-i386-server-5
- Red Hat Enterprise Linux Server Virtualization (v. 5 for 32-bit x86) — rhel-i386-server-vt-5 (and all child channels)
For Red Hat Enterprise Linux 6:
- Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) — rhel-x86_64-server-6 (and all child channels)
- Red Hat Network Tools for RHEL Server (v. 6 for 64-bit x86_64) — rhn-tools-rhel-x86_64-server-6
10.1. Setting Up the Host System for Your Virtual Systems Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Before creating guest systems, you must first prepare your host system. To do this, create a Red Hat Enterprise Linux 5 Server kickstart profile, then use that kickstart profile to install the operating system on your host. Once these steps are complete, you can proceed to provision virtual guests.
10.1.1. Create a Kickstart Profile for the Guest Systems Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
- Login to the Satellite's web interface. Navigate to the Kickstart Overview screen by clicking the Manage Kickstarts link in the Tasks widget in Your RHN, or by clicking on the Systems tab, followed by the Kickstart subtab in the left navigation bar.
- On the Kickstart Overview page, click the Create a New Kickstart Profile link in the Kickstart Actions widget in the upper right corner.
- Enter a label for your profile that will enable you to distinguish it from your other profiles. For the remaining instructions, we'll assume the label is host-system-for-virtual-guests.
- For the Base Channel field, select Red Hat Enterprise Linux (v.5 for $ARCH) (where $ARCH is the architecture of your host system).
Note
You may install 32-bit Red Hat Enterprise Linux 5 on a 64-bit host system. If you choose to do this, however, please be aware that your guest systems must also run the 32-bit version of Red Hat Enterprise Linux. - In the Kickstartable Tree field, select
ks-rhel-$ARCH-server-5
where $ARCH is the architecture of your host system. - Please select Para-Virtualized Host for the Virtualization Type field.
Note
If you are changing the Virtualization Type of an existing kickstart profile, it may also modify the bootloader and partition options, potentially overwriting any user customizations. Be sure to review the Partitioning tab to verify these settings when changing the Virtualization Type. - Click thebutton in the lower right of the screen to continue on to the next step.
Note
If any of the fields are missing the options indicated above, you may not have successfully synced software channel content to your Satellite from Red Hat's servers.
- Select the location of the distribution files for the installation of your host system. There should already be a Default Download Location filled out and selected for you on this screen. Click the button on this screen to continue to Step 3.
Note
If the default download location is missing, you may not have successfully synced software channel content to your Satellite from Red Hat's server. - Choose a root password to set on the host system you will be provisioning, and clickto finish creation of the profile.
- You will be shown the newly-created kickstart profile. You may browse through the various tabs of the profile and modify the settings as you see fit, but this is not necessary as the default settings should work well for the majority of cases.In order to be able to remotely start and stop the guest using the Satellite web interface, you will need to include the package
acpid
.
10.1.2. Kickstart Your Host System Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Next, kickstart your host system using your newly-created kickstart profile. There are three different scenarios for kickstarting your host system. Please read through these three scenarios below, and follow the instructions for the scenario that applies best to you:
10.1.2.1. Your Host System Does Not have Red Hat Enterprise Linux Installed Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Create a boot CD to initiate the kickstart on your host system. You will be able to use the kickstart profile we created in earlier steps to provision the host. Note you must have physical access to the machine you intend to use in order to follow these steps:
- You will find an ISO to create a boot CD for you host by using
ssh
to log into your Satellite. It is at the following location on your satellite:/var/satellite/rhn/kickstart/ks-rhel-i386-server-5/images/boot.iso
/var/satellite/rhn/kickstart/ks-rhel-i386-server-5/images/boot.iso
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
It is possible to use a flash-memory USB key to boot your system in order to kickstart it. Refer to the Red Hat Enterprise Linux System Administration Guide (available at http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/index.html) for tips on how to do this. Note that your host system's hardware must support boot via these devices. - Insert the boot CD in the drive and reboot the system, making sure the CD-ROM drive is set as the primary boot device in the system's BIOS.
- After reboot, you should find yourself at a boot prompt. Type the following command at this prompt to start your kickstart:
linux \ ks=http://your-satellite.example.com/ks/label/the profile label you created earlier
linux \ ks=http://your-satellite.example.com/ks/label/the profile label you created earlier
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
For some systems you may either need to addksdevice=eth0
to the command above or disable one of two or more NICs in the system's BIOS to avoid confusion during the kickstart process. - The kickstart for your host system should begin. It should take around fifteen minutes to complete. Upon successful completion of this kickstart, you will have provisioned a host system for your virtual guest and registered it to your Satellite.
10.1.2.2. Your Host System Has Red Hat Enterprise Linux 6 Installed Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
You should register your host system to your Satellite and check to see if the required
kvm
packages are installed on the system. If they are not, install them using the Satellite.
Note
On Red Hat Enterprise Linux 6, virtualization is only supported on 64-bit Intel and AMD machines.
Note
The
xen
virtualization host is not currently supported on Red Hat Enterprise Linux 6.
- Register your host system to your Satellite. Use
ssh
to connect to your host system. Register your host system to your satellite issuing the following command as root:rhnreg_ks --serverUrl=http://your-satellite.example.com/XMLRPC \ --username=username --password=password
rhnreg_ks --serverUrl=http://your-satellite.example.com/XMLRPC \ --username=username --password=password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
If your host system is already registered to a different Red Hat Network server, add the--force
to the command above. - Next, open up the host system's profile in the Satellite web interface. Log into the web interface of your Satellite at https://your-satellite.example.com/. Click on the Systems tab in the top navigational bar. You should see the host system you just registered - click on its profile name to access its system profile page.
- Make sure your system has access to the software channels it needs to access the software required for hosting virtual guests. From your host system's profile page, click on the Alter Channel Subscriptions link on the profile page under the Subscribed Channels header. Check the RHEL Virtualization and Red Hat Network Tools for RHEL Server checkboxes and click the button underneath the list of channels.
- Next, check to see if you have the necessary software installed for hosting virtual guest on the system. On the host system, issue the following command as root:
rpm -q qemu-kvm rhn-virtualization-host python-virtinst
rpm -q qemu-kvm rhn-virtualization-host python-virtinst
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ifrpm
indicates these packages are not installed, you must install them by running the following command as root on the system:yum install qemu-kvm rhn-virtualization-host python-virtinst
yum install qemu-kvm rhn-virtualization-host python-virtinst
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the machine to pick up the changes, or use the appropriate
modprobe
command for your processor:modprobe kvm_intel
modprobe kvm_intel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow or:modprobe kvm_amd
modprobe kvm_amd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You will also need to install and run the
osad
package in order for your host system to be responsive to commands sent from the Satellite, such as start, pause, resume, and shutdown. To install:yum install -y osad
yum install -y osad
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After installation, you should then start theosad
process:/sbin/service osad restart
/sbin/service osad restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Your host system should now be ready for RHN virtual guest provisioning.
10.1.3. Your Host System Has Red Hat Enterprise Linux 5 Installed Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
You should register your host system to your Satellite and check to see if the required
xen
or kvm
packages are installed on the system. If they are not, install them using the Satellite.
- Register your host system to your Satellite. Use
ssh
to connect to your host system. Register your host system to your satellite issuing the following command as root:rhnreg_ks --serverUrl=http://your-satellite.example.com/XMLRPC \ --username=username --password=password
rhnreg_ks --serverUrl=http://your-satellite.example.com/XMLRPC \ --username=username --password=password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
If your host system is already registered to a different Red Hat Network server, add the--force
to the command above. - Next, open up the host system's profile in the Satellite web interface. Log into the web interface of your Satellite at https://your-satellite.example.com/. Click on the Systems tab in the top navigational bar. You should see the host system you just registered - click on its profile name to access its system profile page.
- Make sure your system has access to the software channels it needs to access the software required for hosting virtual guests. From your host system's profile page, click on the Alter Channel Subscriptions link on the profile page under the Subscribed Channels header. Check the RHEL Virtualization and Red Hat Network Tools for RHEL Server checkboxes and click the button underneath the list of channels.
- Next, check to see if you have the necessary software installed for hosting virtual guest on the system. On the host system, issue the following command as root:
rpm -q xen kernel-xen rhn-virtualization-host
rpm -q xen kernel-xen rhn-virtualization-host
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Forkvm
, issue the following command as root:rpm -q kvm kmod-kvm rhn-virtualization-host python-virtinst
rpm -q kvm kmod-kvm rhn-virtualization-host python-virtinst
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ifrpm
indicates these packages are not installed, you must install them by running the following command as root on the system:yum install xen kernel-xen rhn-virtualization-host
yum install xen kernel-xen rhn-virtualization-host
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Forkvm
users, install by running the following command as root:yum install kvm kmod-kvm rhn-virtualization-host python-virtinst
yum install kvm kmod-kvm rhn-virtualization-host python-virtinst
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For Xen, you will then need to edit the/etc/grub.conf
configuration file to boot the new xen kernel by default. To do this, select the lines ingrub.conf
that pertain to the xen kernel from the beginning of thetitle
line to the end of theinitrd
line, copy the lines, delete them, and paste them so they are the first kernel entry ingrub.conf
. Also ensure that the value of the default variable at the top ofgrub.conf
is set to a value of '0'.Note
If you ever update the kernel on the host system, the standard kernel is the default choice upon reboot. To ensure that the Xen kernel is chosen by default, change the following value in the/etc/sysconfig/kernel
file:DEFAULTKERNEL=kernel
DEFAULTKERNEL=kernel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change the value tokernel-xen
:DEFAULTKERNEL=kernel-xen
DEFAULTKERNEL=kernel-xen
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the machine to pick up the changes, or use the appropriate
modprobe
command for your processor:modprobe kvm_intel
modprobe kvm_intel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow or:modprobe kvm_amd
modprobe kvm_amd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Reboot the system, boot it into the xen kernel. The system should not automatically boot into the xen kernel on reboot but if you would like to make sure it has for troubleshooting purposes, use the command
uname -r
to see if the running kernel is a xen kernel. If you do not see thexen
string in the name of the kernel, you have not booted into the correct kernel.Note
If the system already hasxen
andkernel-xen
installed you do not need to reboot after installingrhn-virtualization-host
. - You will also need to install and run the
osad
package in order for your host system to be responsive to commands sent from the Satellite, such as start, pause, resume, and shutdown. To install:yum install -y osad
yum install -y osad
Copy to Clipboard Copied! Toggle word wrap Toggle overflow after installation, you should then start theosad
process:/sbin/service osad restart
/sbin/service osad restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Your host system should now be ready for RHN virtual guest provisioning.