Installing a paravirtualized guest using PXE and Kickstart on Oracle VM 2.2
The past few days i started working on Oracle VM 2.2.1.
The task i tried to accomplish was to install Oracle Enterprise Linux in a para-virtualized guest via PXE and Kickstart. Sounds not too complicated, does it? If you are familiar with VMWARE and know how easy it is to accomplish this task be advised: With Oracle VM it is complicated.
First of all: Oracle VM para-virtualized guests are not able to boot from ISO files (fully virtualized ones are). So for booting you need a boot image containing the kernel which is accessible either via NFS or HTTP:
Task #1: Configure a NFS Server
(Note: A HTTP Server will also do the trick; in my environment configuring a NFS server was faster)
- Copy the first CD or the whole DVD to a directory (or mount the ISO image); e.g. /export/oel
- Export this directory via NFS by putting the following lines in /etx/exports/export/oel *(ro)
- Start the NFS server:/etc/init.d/nfs start
You should now be able to mount the NFS directory on the OVM physical hosts.
Task #2: Create a Kickstart-File
This task is usually done by the Systems Administrators. The Kickstart file itself can be placed either locally, on an NFS share or via on a HTTP server. In this example the kickstart file is downloaded from a HTTP server.
Task #3: Install the guest
The following assumptions apply here:
- Hostname: GUEST
- Disk File Location: /var/ovs/mount/D5Elongid/running_pool/GUEST/system.img
(Note: “D5Elongid” is just a placeholder for the full path pointing to the storage)
- Size of the disk file: 90 GB
Use the following command line to install the guest:
virt-install -n GUEST -r 4096 --vcpus=1 \ -f /var/ovs/mount/D5Elongid/running_pool/GUEST/system.img \ -s 90 -l nfs:servername.domain:/export/oel \ -x "ks=http://192.168.1.1:80/ks.cfg" -p
The following table explains the switches used:
|-n GUEST||Name of the to-be-created guest, here: 'GUEST'|
|-r 4096||Memory in MB; here: 4096 MB|
|--vcpus=1||Number of virtual CPUs assigned to the guest; here: 1|
|-f /var/ovs/mount/D5Elongid/running_pool/GUEST/system.img||Full path to the (created) virtual disk|
|-s 90||Size of the virtual disk in GB; here: 90 GB|
|-l nfs:servername.domain:/export/oel||Path (NFS/HTTP) containing the boot files; here: NFS Server named "servername.domain", NFS Directory: '/export/oel'|
|-x "ks=http://192.168.1.1:80/ks.cfg"||Location of Kickstart file|
|-p||Create a para-virtualized host|
Task #4: Import the guest into OVM Manager
- Locate the XEN config file in /etc/xen and move it to the guests directory (in this example: /var/ovs/mount/D5Elongid/running_pool/GUEST) AND rename it to ‘vm.cfg’
- In OVM Manager navigate to: RESOURCES –> VIRTUAL MACHINE IMAGES
- Click Import
- Choose ‘Select from Server Pool’ and fill out the following form
- After youre done the machine will be registered
- Click approve to finally add the machine
My current conclusion at the moment: Oracle VM 2.2.1 compared to e.g. VMWARE is in terms of usability worse. Simple tasks can be easily achieved GUI-wise; more complex tasks (e.g. booting via PXE or supplying boot-arguments) can only be done at command level.
In addition to that the documentation is complete crap. Basic information on setting everything up and creating virtual machines in the GUI are documented. Detailed information on how to do the more complexer tasks are not.