How to convert a non-SMP RedHat VM into a SMP RedHat VM

Today I got an interesting request, a user needed to change his 64 bit non-SMP VM image (running RedHat 4.0) to a SMP machine, problem is, I don’t really want to have to go through reconfiguring the kernel and rebuilding it, so here’s the easy way to do it (it’s pretty simple):

  1. Power the image down
  2. Right-click and edit the settings for the VM image (if you don’t know how to do this, this article is beyond your scope)
  3. Change the CPU settings from 1 to >1 (2 or 4 or 8 or whatever you want to use) (see picture)
    changecpu
  4. Power the VM image back on
  5. Put the RedHat CD #2 in your desktop CD drive (or using the ISO), connect the disc to the VM image (see picture, note that I selected the wrong ISO, should be disc #2)
    mountisoselectiso
  6. On the vmware image, mount the cd with: mount /media/cdrom
  7. Enter the directory: cd /media/cdrom/RedHat/RPMS
  8. In my case, I’m using a 64-bit kernel, so I would use the 64-bit SMP kernel:
    [root@lava2057 RPMS]# rpm -Uvh kernel-smp-2.6.9-42.EL.x86_64.rpm
  9. Unmount the CD, dettach the CD/ISO
  10. Run up2date to make sure the new kernel you installed is up to date (chances are that it isn’t, since RedHat has pushed out a new kernel since putting out the CDs)
  11. Edit the /boot/grub/grub.conf file, mine looks something like this before changes:
    default=2
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Red Hat Enterprise Linux ES (2.6.9-67.0.1.ELsmp)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-67.0.1.ELsmp ro root=LABEL=/ rhgb quiet
    initrd /initrd-2.6.9-67.0.1.ELsmp.img
    title Red Hat Enterprise Linux ES (2.6.9-42.ELsmp)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/ rhgb quiet
    initrd /initrd-2.6.9-42.ELsmp.img
    title Red Hat Enterprise Linux ES (2.6.9-67.0.1.EL)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-67.0.1.EL ro root=LABEL=/ rhgb quiet
    initrd /initrd-2.6.9-67.0.1.EL.img
    title Red Hat Enterprise Linux ES (2.6.9-42.EL)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-42.EL ro root=LABEL=/ rhgb quiet
    initrd /initrd-2.6.9-42.EL.img
  12. I have 4 kernels installed, the initial install 64-bit (non-SMP), the 64-bit SMP I just installed and the most recently updated versions of each of these, as you can see, the line “default=2” is still pointing to our non-SMP image. We need to use the 2.6.9-67.0.1.ELsmp kernel, so I’m going to change it to “default=0
  13. Reboot the machine
  14. After it’s rebooted, log in and check ‘uname -a‘, mine shows:
    Linux lava2057.lss.emc.com 2.6.9-67.0.1.ELsmp #1 SMP Fri Nov 30 11:57:43 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

Simple eh? I know it’s not related to security, but I figured it’d be helpful to someone out there. :)

About these ads

6 Comments

Filed under kernel, redhat, smp, sysadmin, vm, vmware

6 Responses to How to convert a non-SMP RedHat VM into a SMP RedHat VM

  1. Good man, was sure I should be able to accomplish this in about 30 seconds, but from a quick look elsewhere it was looking like a big job… worked like a charm.

  2. chandara007

    i want file convert SMP for samsung

  3. Lantard

    This is a great write-up, thanks! I ran into the same situation and found this article on Google. The only other thing I noticed in my environment is that after you boot to the new kernel it is necessary to run reconfigure vmware tools if you are running them in order to get the memory driver working again.

    Thanks again!

  4. Henry Ushijima

    Thanks… This tip saved me an install for a short time that I will need smp. Now I can swap back and forth between single or dual proc for certain functions.

  5. Pingback: Unix etc.

  6. cedric

    This topic solved the problem I had on my red hat VM :
    dmesg | grep Proc
    Processor #0 6:12 APIC version 17
    Processor #1 6:12 APIC version 17
    WARNING: NR_CPUS limit of 1 reached. Processor ignored

    I was limited to only one processor with a non SMP kernel but with a SMP kernel, the server can use the 4 CPU. I was surprised to see that the server could use 8Go of RAM even if it is a 32 bits with the SMP kernel. It was limited to 3Go with the non SMP kernel.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s