Installing Redhat Enterprise Server 5 in VMWare with PVSCSI (paravirtual SCSI)

It is quite straightforward to install Redhat Enterprise Server 5 in a VMWare virtual machine using the paravirtual SCSI controller (in ESX 4).

My tip:

  • Install with emulated hardware first
  • Install vmware tools
  • Modify the initial ramdisk (initrd)
  • Shutdown your virtual redhat system
  • Change controller type to PVSCSI
  • reboot

So let's begin.

Create a new VM, choose "Custom":

redhat0.png

(Picture quality is not original as all screenshots were scaled down to fit into the content window).

Chose a name for your virtual machine: (I chose Seattle because I liked the city with its cool tower):

redhat1.png

Next it wants a datastore to store virtual machine data. Choose whatever you think is appropriate in your installation:

redhat2.png


As we're using ESX we can choose Virtual Machine Version 7. Choose the old format only if you have to exchange virtual machine data with ESX 3!

redhat3.png

Next select "Linux" and "Red Hat Enterprise Server 5 (64bit)" (I assume we're installing the 64bit version):

redhat4.png

The next screen asks you how many virtual CPUs you want for your virtual machine. As Redhat 5 always installs an SMP kernel you may leave this to "1" - you can change that at any time afterwards.

redhat5.png

Choose RAM size. It says 384 MB are recommended but using one Tomcat server this will already swap. Take 512 MB as minimum.

redhat6.png

On the next screen you have to choose network features. Please use emulated cards during installation - you may change that later. E1000  (Intel EE 1000) is well supported by Redhat:

redhat7.png

Now select a "real" emulated SCSI controller. For fastest installation choose "LSI Logic SAS":

redhat8.png

Choose disk size: My standard VM disk size is 15 GB (data is always on a separate volume):

redhat9.png

Be sure to select "SCSI (0:0)" as Virtual Device Node!

redhata.png

Next the vSphere Console shows you a summary of the settings you made:

redhatb.png

After the virtual machine has been created, right-click on your new machine (here "Seattle") and select "Open Console":

redhatc.png

Press on the green "play" button. The machine begins to start. As it can't find any boot volume it tries to use PXE. Click on the button to the right (a CD icon with a wrench). Select "CD/DVD Drive 1" and then "Connect to ISO image on a datastore...". If your Redhat 5 CD image is not on a datastore then you're free to chose "Connect to ISO image on local disk...". I'm having all supported ISO installation images on a datastore:

redhatd.png

As I chose the datastore, a requester opened to choose the right ISO image:

redhate.png

After "OK" you have to press the RETURN key twice while the mouse cursor is inside the black console screen. It will boot from the ISO image then:

redhatf.png

Type "linux text" at the boot prompt and continue to install a normal Redhat 5 Server. The Installation procedure will not be different than using a real PC.

Attention: At this screen, deselect "Virtualization" (Redhat does not detect that it is running on a vmware virtual machine, don't install unneeded software):

redhatG_1.png

After installation we have to install the VMWare tools. Select "VM" -> "Guest" -> "Install/Upgrade VMware tools":

redhatG_2.png

Login as root and type:

[root@dhcp1 ~]# mkdir /cdrom
[root@dhcp1 ~]# mount -t iso9660 /dev/hdc /cdrom
mount: block device /dev/hdc is write-protected, mounting read-only
[root@dhcp1 ~]# cd /cdrom
[root@dhcp1 cdrom]# ls -al


Should give something similar to that:


total 173501
dr-xr-xr-x  2 root root     2048 May  1 03:20 .
drwxr-xr-x 26 root root     4096 Sep 24 18:49 ..
-r--r--r--  1 root root     1709 May  1 03:17 manifest.txt
-r--r--r--  1 root root 89139204 May  1 03:19 VMwareTools-4.0.0-164009.i386.rpm
-r--r--r--  1 root root 88512941 May  1 03:14 VMwareTools-4.0.0-164009.tar.gz


Install the RPM file:

[root@dhcp1 cdrom]# rpm -i VMwareTools-4.0.0-164009.i386.rpm

The installation of VMware Tools 4.0.0 for Linux completed successfully.
You can decide to remove this software from your system at any time by
invoking the following command: "rpm -e VMwareTools".

Before running VMware Tools for the first time, you need to
configure it for your running kernel by invoking the
following command: "/usr/bin/vmware-config-tools.pl".

Enjoy,

    --the VMware team


Start the configuration:

[root@dhcp1 cdrom]# /usr/bin/vmware-config-tools.pl
Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                          [  OK  ]
   Unmounting HGFS shares:                                 [  OK  ]
   Guest filesystem driver:                                [  OK  ]
The bld-2.6.18-8.el5-x86_64smp-RHEL5 - vmmemctl module loads perfectly into the
running kernel.

The bld-2.6.18-8.el5-x86_64smp-RHEL5 - vmhgfs module loads perfectly into the
running kernel.

The bld-2.6.18-8.el5-x86_64smp-RHEL5 - vmxnet module loads perfectly into the
running kernel.


etc...

At the end a message should appear:

The configuration of VMware Tools 4.0.0 build-164009 for Linux for this running
kernel completed successfully.



Now things are getting a little bit trickier - but only a little bit. I hope you're familiar with vi.

Do the following:

[root@dhcp1 cdrom]# vi /etc/modprobe.conf

The contents of this file are normally something like that:

alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptsas
alias eth0 e1000
alias scsi_hostadapter2 ata_piix
# Added by VMware Tools
install pciehp /sbin/modprobe -q --ignore-install acpiphp; /bin/true
install pcnet32 /sbin/modprobe -q --ignore-install vmxnet;/sbin/modprobe -q --ignore-install pcnet32 $CMDLINE_OPTS;/bin/true
alias char-major-14 sb
options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330


Just add the following:

# Load PVSCSI (Paravirtual SCSI VMWare)
alias scsi_hostadapter3 pvscsi



So - in my case (freshly installed Redhat 5 Enterprise Server) the result is:

alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptsas
alias eth0 e1000
alias scsi_hostadapter2 ata_piix
# Added by VMware Tools
install pciehp /sbin/modprobe -q --ignore-install acpiphp; /bin/true
install pcnet32 /sbin/modprobe -q --ignore-install vmxnet;/sbin/modprobe -q --ignore-install pcnet32 $CMDLINE_OPTS;/bin/true
alias char-major-14 sb
options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330
# Load PVSCSI (Paravirtual SCSI VMWare)
alias scsi_hostadapter3 pvscsi



Now it is important to know your actual running kernel version.
Type:

[root@dhcp1 cdrom]# uname -a

The result is something like this:

Linux dhcp1 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

The actual version is bold and underline in my example! If you know your version, just do this:

[root@dhcp1 cdrom]# cp /boot/initrd-2.6.18-164.el5.img /boot/initrd-2.6.18-164.el5.img.bak

You see the kernel version appearing?

Now enter this command:

[root@dhcp1 cdrom]# mkinitrd -v -f /boot/initrd-2.6.18-164.el5.img 2.6.18-164.el5

The bold underlined part again has to be the same as with your kernel version (uname -a above).

It will print many lines but be sure that this line is included:

Looking for deps of module pvscsi: scsi_mod


And yes, you're on track if this line appears!

Shutdown your virtual machine:


[root@dhcp1 cdrom]# halt

In the vSphere client, choose "Edit Settings" by right-clicking on your virtual machine, then click on "SCSI controller 0". Click on "Change Type...":

redhatG_3.png

Choose "VMware paravirtual":

redhatG_4.png

Type OK and save the setting.

Reboot your virtual machine (the green "play" button im your console) and it should perfectly. If it does NOT boot, then the "pvscsi"-Line did not appear at the mkinitrd command above!


Important: Doing updates

BEFORE DOING AN UPDATE WHICH ALTERS THE KERNEL VERSION (KERNEL UPDATE), APPLY THE UPDATE, SHUTDOWN, CHANGE THE SCSI TYPE IN VSPHERE CONSOLE TO "LSI LOGIC SAS", BOOT AND REINSTALL VMWARE TOOLS AS DESCRIBED ABOVE! MAKE A NEW INITRD AS DESCRIBED ABOVE! SHUTDOWN! CHANGE THE CONTROLLER TYPE TO PARAVIRTUAL AGAIN AND REBOOT.

In case your new kernel is not directly supported by VMWare tools  you have to install kernel source and compiler:

This is not terrible, it's supported by VMware and no reason to get sleepless nights.

Just do the following:

Login as root.

Execute the following commands (only once - for each subsequent update these source components are also upgraded so no need to reinstall them!):

[root@dhcp1 ~]# yum install kernel-devel
[root@dhcp1 ~]# yum install kernel-headers
[root@dhcp1 ~]# yum install gcc

(accept dependencies)
[root@dhcp1 ~]# yum install ncurses-devel

And you're ready! Invoking

[root@dhcp1 ~]# /usr/bin/vmware-config-tools.pl

Will automatically recompile kernel modules for your kernel!

The next steps are as in the initial setup descibed above!

Good luck and feel free to leave your comments here!



0 TrackBacks

Listed below are links to blogs that reference this entry: Installing Redhat Enterprise Server 5 in VMWare with PVSCSI (paravirtual SCSI).

TrackBack URL for this entry: http://southbrain.com/mt/mt-tb.cgi/109

1 Comments

I found that re-running vmware-config-tools.pl (for instance, after a kernel upgrade, to get the pvscsi and vmxnet3 drivers) will overwrite the modprobe.conf file, removing the line that was added -- regardless of whether the line came before or after the items added by VMware Tools. You need to add the line into /etc/modprobe.conf.BeforeVMwareToolsInstall if you want to prevent this from happening.

December 2015

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

About

This blog is owned by:

Pascal Gienger
J├Ągerstrasse 77
8406 Winterthur
Switzerland


Google+: Profile
YouTube Channel: pascalgienger