Caution: Articles written for technical not grammatical accuracy, If poor grammar offends you proceed with caution ;-)
That big ole title pretty much says it all. In this article I’m going to walk through how to deploy RHEL (Centos) Linux onto a Physical HP Server over the iLo interface using Kickstart. When provisioning to Physical servers such as an HP Proliant DL360 there are two methods built into vCAC. One is the use of PXE boot, and the other is via the iLo interface.
There are pro and cons to both PXE and remote mounting an ISO over the iLo interface. PXE has the obvious cons of the network requirements, having a PXE server available and if you want true flexibility you will need to do a little custom work. ISO mount over iLo tend to be a bit slower due to the over head of remote mounting a ISO and the speed of the iLo interface. In this article I will be covering remote mounting an ISO over iLo, but I will be covering PXE is a later article.
What do we need
To start we need the Physical HP server to be racked and cabled up. It’s iLo interface should be configured and licensed, the network interfaces should be cabled in and the switches should be configured for the appropriate Vlans etc. The drives in the server should also be initialized. vCAC will not create any raid groups etc for you, you must do this manually. My examples also requires a web server that can be utilized to store the needed files on the network.
Preparing the Linux Boot ISO
If you are not familiar with Linux and kickstart this will be the tricky part, but don’t sweet it I’m going to walk you through step-by-step.
This example is based on performing a kickstart installation of CentOS 6.5. The exact ISO I used was CentOS-6.5-x86_64-bin-DVD1.iso, but the same applies for other versions and distributions that support kickstart.
To begin you will need to pull the isolinux folder off off the DVD. I find it easiest to perform the following steps on a Linux machine, but you can do it on whatever OS you like.
- First I mounted the CentOS-6.5-x86_64-bin-DVD1.iso.
mount -o loop CentOS-6.5-x86_64-bin-DVD1.iso /mnt
- Create a folder to use as a workspace
mkdir /working
- Change directory to the working directory
cd /working
- Copy the isolinux folder for the mounted DVD to the working folder
cp -r /mnt/isolinux
- First thing we need to do is create a credential in vCAC that has access to the Hp servers iLO interface. You can find instructions on creating credentials in the article vCloud Automation Center – vCAC 6.0 – Creating Credentials.
- Next we need to create an endpoint for our HP server that we want to provision on to. You can find instructions on creating a Physical HP iLO enpoint in the article vCloud Automation Center – vCAC 6.0 – Adding Physical HP Endpoints.
- Next we need to create a Physical reservation in vCAC and assign it the Physical HP server as a resoruce. You can find instructions on creating a Physical reservation in the article vCloud Automation Center – vCAC 6.0 Creating a Physical HP Reservation.
- We now need to create a Physical HP iLo blueprint. Please follow the instructions in the article vCloud Automation Center – vCAC 6.0 Creating a Physical HP Blueprint to create a basic physical blueprint that we will build on below.
- Now we need to create a “Build Profile” that contains the custom properties needed for linux kickstart. Go to Infrastructure -> Blueprints -> Build Profiles, and create a new Build Profile.
- Give the Build Profile a name and then we need to add a few custom properties to the profile.
Property Name: Image.ISO.Location Property Value: The complete path to the web server location of ISO.
Property Name: Image.ISO.Name Property Value: The name of the ISO image.
Property Name: VMware.VirtualCenter.OperatingSystem Property Value: The vCenter OS identifier.
*The VMware.VirtualCenter.OperatingSystem property and value can be loaded from the property list. - Click ok to save the Build Profile.
- Go back and edit the Physical Blueprint that was created in step 4, go to the properties tab and select the build profile that was just created and click ok to save the blueprint.
- Next we need to entitle the blueprint as a catalog item. Please refer to the following posts to create a catalog entitlement.
- Once you have entitled your blueprint to the catalog you can go to the catalog and request the item to be provisioned.
- For this simple example there shouldn’t be a whole lot to do on the request page other than to click submit.
- Once you submit your request go to Infrastructure -> Machines -> Managed Machines and you should see your newly requested machine listed there with a status of “InitialPowerOn”.
- Shortly after the machine hits the “InitialPowerOn” status you can login to the iLo interface and under virtual media you should se the Virtual CD/DVD-ROM status as Connected,web server source.
- The machine will then move into the “InstallingOS” status.
- Once the machine is in the InstallingOS status you can open the HP iLO remote console and you should see linux being installed.
- Once it’s complete your machine will be put in the “On” status and provisioning is complete.
Now that we have the isolinux folder we need to make some changes to it.
We need to replace the isolinux.cfg that is in the isolinux folder with one that looks like the following:
####################### Begin isolinux.cfg #######################
default vesamenu.c32
timeout 1
display boot.msg
menu background splash.jpg
menu title Welcome to CentOS 6.5!
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img network --device=eth0 —bootproto=dhcp ks=http://yourwebserver/ks.cfg
####################### End isolinux.cfg ##########################
***Y Make sure you specify the network device that should be used using the –device= tag as I have it above. If there are more than one network device it will stop the boot to prompt you for which network interface to use. Also be sure to change the yourwebserver to the hostname and path for your webserver.
Making the bootable ISO
Once you have the isolinux.cfg modifications complete you will then need to create the bootable ISO that will be utilized to boot the image. I use a Linux machine to perform this task. Below is the command for creating the bootable ISO image. Run this command from inside the working directory which contains the isolinux folder.
genisoimage -r -T -J -V "RHEL6AMD64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /working/RHEL6X64.iso /working/
Kickstart Config
You should change the ks= to point to the location of your ks.cfg file. I’m utilizing a web erver to host mine, however you can also use nfs or include the ks.cfg on the iso itself.
Your ks.cfg file should look something like the following:
####################### Begin ks.cfg ##############################
auth --useshadow --enablemd5
bootloader --append="rhgb quiet" --location=mbr --driveorder=sda
zerombr
clearpart --all --initlabel
text
firewall --disabled
keyboard us
lang en_US
logging --level=info
network --bootproto=dhcp --device=eth0 --onboot=on
reboot
rootpw Password1
selinux --enforcing
timezone --isUtc America/New_York
install
url --url http://web_server/Install_Files/
part / --asprimary --fstype="ext3" --size=4096
part swap --asprimary --fstype="swap" --size=512
%packages
vim-enhanced
%post
cd /tmp/
wget http://web_server/install_gugent.sh
chmod +x install_gugent.sh
./install_gugent.sh
#################### End ks.cfg ##############################
*** Be sure to update the ‘Web Server” with the location and path for your web server.
There are bunch of things you can and probably should modify based on your needs in the ks.cfg, however I’m not going to go into all the nitty details of the ks.cfg file. If you need a good reference for the available options visit https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-options.html.
For the purposes of this article there are two components of the ks.cfg file that are important.
url —url http://your_web_server/Install FIles/
This tell the installer where to find the installation packages. If you leave this out completely it will look to the cdrom for the installation packages. It is possible to modify the isolinux.cfg of the installation iso and keep the installation packages on the iso for the install. This however is not very efficient. I prefer to utilize http because of the speed, simplicity and flexibility. To utilize an http installation location just input the web server and path that you have copied the installation packages to.
%post section
Everything located below the %post section happens after the initial installation. In the above ks.cfg I’m downloading and executing a script that installs the vCAC linux guest agent. The information that is contained in the script could be included in the %post section of the ks.cfg, but I prefer to maintain a separate script and call that from the ks.cfg.
##################### install_gugent.sh #######################
cd /tmp/
wget http://webserver/rhel6-amd64/gugent-6.0.0-2026.x86_64.rpm
rpm -i /tmp/gugent-6.0.0-2026.x86_64.rpm
export AXIS2C_HOME=axis2
export PYTHONPATH=/usr/share/gugent/site/dops
pushd /usr/share/gugent
cd /etc/sysconfig
mv selinux selinux.old
wget http://webserver/selinux
cd /usr/share/gugent
echo | openssl s_client -connect vcac-iaas-server:443 2>&1 | sed -ne "/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p" > cert.pem
/usr/share/gugent/installgugent.sh vcac-iaas-server:443 ssl
/usr/share/gugent/rungugent.sh
process # SetupOS
process # CustomizeOS
popd
##################### End install_gugent.sh ####################
In this file there are a few things that are happening. To start I’m using wget to download the vcac guest agent from the web server that I have located it on. Then it installs the agent. I have also put a selinux file on my web server to replace the default selinux config after installation. I suppose I could have used sed to do a search and replace, but this is simple enough. The selinux file is the same as the stock selinux file with the following change:
SELINUX=disabled
Next we need to trust the ssl certificate form the vcac iaas server. You need to replace vcac-iaas-server with the fqdn of your vcac iaas server.
echo | openssl s_client -connect vcac-iaas-server:443 2>&1 | sed -ne "/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p" > cert.pem
/usr/share/gugent/installgugent.sh vcac-iaas-server:443 ssl
Now that we have our iso file, our kickstart file, and our script to install the vcac linux guest agent we can get started configuring vcac for physical provisioning. These items are also the same items we would need to perform a kickstart installation to a VM as well. The only differences really are the blueprints we would create within vCAC. I do all my testing of the above components to an VM before I test on physical to save time.
vCAC Configuration
This section assumes you have vCAC installed and have the minimum configuration of fabric groups, business groups, and other general items configured. If you do not have these items configured please see the vCAC6 section of the blog for instructions on each of these topics.
Thanks, very informative, you explained in detail. I just wanted to know. Can you add PXE method as well.
Yes you can.
Thanks… Sid Question: Instead of generating iso image can i edit existing isolinux.cfg file from the ISO image??
Hi,You mentioned” I will be covering PXE is a later article.’i dont see it anywhere how can i provision PXE via VRA workflows to talk to HP ILO
Jit,
You cannot. Physical provisioning is not longer a feature in vRA.
-Sid