PavelGeorgiev
12-01-2011, 07:11 PM
These are the steps to create a managed Oracle Linux R5 U6 64-bit appliance using iso2class/hvm2pv. This process is meant to be run on a AppLogic 3.0/3.1 grid, if you want to execute it on an older version, you may have to manually install APK instead of using hvm2pv.
1) run iso2class in a grid shell:
util iso2class app_name=pg-oracle52 install_size=2G console_type=graphic os=linux-64 iso_volume1=Enterprise-R5-U6-Server-x86_64-dvd.iso virt_mode=xen_hvm,vmware
2) Open the graphical console for the application that you specified on iso2class and complete the installation. Few important things:
- (not required, but may affect other steps in this how-to) when setting up partitions, select a single partition, mounted on '/', fs ext3. This is not required for the installation to complete, AppLogic will run on the default partition setup (separate boot partition, lvm, swap), but using a single partition is the best usage of available disk space and eliminates lvm overhead.
- (optional) when selecting software to be installed, make sure 'text based internet' and 'base' are selected and 'xen' is *not* selected. This is the default. All other package groups can be removed (it would make for a smaller/faster image). If you decide to have a minimal install you can also remove 'text based internet' and 'base', as long as you have the following packages: wget, dhclient, iproute.
3) Once the installation is complete, go back to the iso2class console and proceed with the install. When prompted, say you want to run hvm2pv now.
4) While hvm2pv is running, it will prompt you with the following question:
Do you want to set up a new root password for text console login?
Say 'y', login to the appliance that hvm2pv is running (hvm2pv will give you the name of the appliance, it should be something like hvm2pv_pg-oracle52_5133:main.LINUX64) and execute the following:
4.1)
sed 's#/dev/hda1#LABEL=/#' -i /mnt/vol/hdc1/boot/grub/menu.lst
Note: This will only work if you used a single partition during the installation. Otherwise, you may need to change the device name from /dev/hda1 to your root device in the grub config. If your root device is on a lvm volume, you can skip this step, your grub configuration does need updating. Your grub config file should not list the root device by its name (like hda, sda or xvda), it should list either a LABEL, UUID or an lvm volume (i.e. /dev/mapper/LV1). If you followed the recommended package selection and partitioning schema during the install, your grub config file should look like that after this step:
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Oracle Linux Server (2.6.32-100.26.2.el5uek)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-100.26.2.el5 ro root=LABEL=/
initrd /boot/initrd-2.6.32-100.26.2.el5.img
title Oracle Linux Server-base (2.6.18-238.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-238.el5 ro root=LABEL=/
initrd /boot/initrd-2.6.18-238.el5.img
4.2)
Generate a new initrd image. Note: if you did not use a single partition setup during the installation, your chroot path may be different (look at the hvm2pv output from the step, it should tell you the correct path where you should chroot).
chroot /mnt/vol/hdc1 mkinitrd -f --with=xen-blkfront /boot/initrd-2.6.32-100.26.2.el5.img 2.6.32-100.26.2.el5
5) Proceed with the hvm2pv install. After it is done you should have a managed HVM appliance
6) If you want to run the appliance in xen_pv mode (which you probably do if you are running on a xen grid), modify the boundary of the new class, to include 'Xen Paravirtualization' in its Virtualization modes. No additional changes are needed to the appliance, it can use the stock Oracle kernel to boot in PV mode.
1) run iso2class in a grid shell:
util iso2class app_name=pg-oracle52 install_size=2G console_type=graphic os=linux-64 iso_volume1=Enterprise-R5-U6-Server-x86_64-dvd.iso virt_mode=xen_hvm,vmware
2) Open the graphical console for the application that you specified on iso2class and complete the installation. Few important things:
- (not required, but may affect other steps in this how-to) when setting up partitions, select a single partition, mounted on '/', fs ext3. This is not required for the installation to complete, AppLogic will run on the default partition setup (separate boot partition, lvm, swap), but using a single partition is the best usage of available disk space and eliminates lvm overhead.
- (optional) when selecting software to be installed, make sure 'text based internet' and 'base' are selected and 'xen' is *not* selected. This is the default. All other package groups can be removed (it would make for a smaller/faster image). If you decide to have a minimal install you can also remove 'text based internet' and 'base', as long as you have the following packages: wget, dhclient, iproute.
3) Once the installation is complete, go back to the iso2class console and proceed with the install. When prompted, say you want to run hvm2pv now.
4) While hvm2pv is running, it will prompt you with the following question:
Do you want to set up a new root password for text console login?
Say 'y', login to the appliance that hvm2pv is running (hvm2pv will give you the name of the appliance, it should be something like hvm2pv_pg-oracle52_5133:main.LINUX64) and execute the following:
4.1)
sed 's#/dev/hda1#LABEL=/#' -i /mnt/vol/hdc1/boot/grub/menu.lst
Note: This will only work if you used a single partition during the installation. Otherwise, you may need to change the device name from /dev/hda1 to your root device in the grub config. If your root device is on a lvm volume, you can skip this step, your grub configuration does need updating. Your grub config file should not list the root device by its name (like hda, sda or xvda), it should list either a LABEL, UUID or an lvm volume (i.e. /dev/mapper/LV1). If you followed the recommended package selection and partitioning schema during the install, your grub config file should look like that after this step:
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Oracle Linux Server (2.6.32-100.26.2.el5uek)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-100.26.2.el5 ro root=LABEL=/
initrd /boot/initrd-2.6.32-100.26.2.el5.img
title Oracle Linux Server-base (2.6.18-238.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-238.el5 ro root=LABEL=/
initrd /boot/initrd-2.6.18-238.el5.img
4.2)
Generate a new initrd image. Note: if you did not use a single partition setup during the installation, your chroot path may be different (look at the hvm2pv output from the step, it should tell you the correct path where you should chroot).
chroot /mnt/vol/hdc1 mkinitrd -f --with=xen-blkfront /boot/initrd-2.6.32-100.26.2.el5.img 2.6.32-100.26.2.el5
5) Proceed with the hvm2pv install. After it is done you should have a managed HVM appliance
6) If you want to run the appliance in xen_pv mode (which you probably do if you are running on a xen grid), modify the boundary of the new class, to include 'Xen Paravirtualization' in its Virtualization modes. No additional changes are needed to the appliance, it can use the stock Oracle kernel to boot in PV mode.