How to run RHEL5/Centos5 in Google Cloud
Build kernel module
Get the backported kernel code to a RHEL5/Centos5 system. [code language="bash"] git clone https://github.com/GoogleCloudPlatform/compute-centos5-drivers.git [/code] Get the src package for the kernel version (this might need .redhat.com access) The following are other locations: https://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/ https://vault.centos.org/5.5/centosplus/x86_64/RPMS/ Install the package. [code language="bash"] rpm -ivh kernel-2.6.18-194.el5.src.rpm [/code] Build the kernel source code. [code language="bash"] cd /usr/src/redhat/SPECS rpmbuild -bp --target=x86_64 kernel.spec cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64 make oldconfig make prepare make scripts make modules [/code] Build the virtio_scsi module. [code language="bash"] make M=/root/compute-centos5-drivers-master/third_party/virtio_scsi [/code]Install module in the source system
The easiest way to install the module is to upload the module to Google Cloud Storage and use it to build initrd in the source system. Then the source system could be synced to Google Cloud. Create a new bucket and upload the module: [code language="bash"] # gsutil cp 2.6.18-194.el5-virtio_scsi.ko gs://rhel5test/ [/code] In the source system, download and copy the module to the relevant kernel module path: [code language="bash"] wget https://storage.googleapis.com/rhel5test/`uname -r`-virtio_scsi.ko cp `uname -r`-virtio_scsi.ko /lib/modules/`uname -r`/extra/virtio_scsi.ko [/code] Run depmod to generate modules.dep and map files: [code language="bash"] depmod -a [/code] Create initrd file using the virtio modules: [code language="bash"] mkinitrd -f --with=virtio_pci --with=virtio_scsi --preload virtio --preload scsi_mod /boot/initrd-gcp-$(uname -r).img $(uname -r) [/code] Update grub.conf with new initrd. For example, [code language="bash"] title GCP Red Hat Enterprise Linux Server (2.6.18-194.el5) root (hd0,0) kernel /vmlinuz-2.6.18-194.el5 ro root=UUID=eff36034-b712-468f-8e6e-0816973a866d rhgb edd=off quiet console=ttyS0 initrd /initrd-gcp-2.6.18-194.el5.img [/code] Update the default parameter to boot from the new kernel: [code language="bash"] default=1 [/code] Once the initrd is built and the grub configuration is made, the system can be synced to Google Cloud. Both RHEL5 and Centos5 have reached End of Life. It is strongly suggested to move them to later operating system releases. The above workaround is a good method to migrate the systems to the cloud until the application is refactored to run in later operating system releases.On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Creating a custom Oracle EBS preinstall RPM for RHEL7
Creating a custom Oracle EBS preinstall RPM for RHEL7
Feb 12, 2019 12:00:00 AM
1
min read
How to get cloud analytics costs under control

How to get cloud analytics costs under control
Nov 7, 2018 12:00:00 AM
5
min read
OS Migration on Cloud

OS Migration on Cloud
Jan 12, 2022 12:00:00 AM
4
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.