Centos 5 and Hyper V

A 5 star hangout for overworked and underpaid system admins.
Post Reply
nitrous_nit
Posts: 2
Joined: 2018/08/14 16:54:06

Centos 5 and Hyper V

Post by nitrous_nit » 2018/08/14 17:10:11

We are running a virtualised (Vmware) Centos 5, and now would like to failover to Azure.
Seeing that Azure using Hyper V, MS support were really helpful to try to get the VM working in their labs, as a best effort.
Source VM is fine, its only the target VM that fails over to Azure, we get kernel panic messages:

Waiting for driver initialization.
IBM TrackPoint firmware: 0x01, buttons: 0/0
input: TPPS/2 IBM TrackPoint as /class/input/input1
Scanning and configuring dmraid supported devices
Scanning logical volumes
Reading all physical volumes. This may take a while...
No volume groups found
Activating logical volumes
Volume group "VolGroup00" not found
Trying to resume from /dev/VolGroup00/LogVol01
Unable to access resume device (/dev/VolGroup00/LogVol01)
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

These are steps they did to get it to the login screen in their labs, but when we do the same, we get the above message:

Configured the console, so I could see events while the server it’s booting up:

a. Add the following entries at the end of the kernel line in /etc/grub.conf (/boot/grub/menu.lst)
# vi /etc/grub.conf
title CentOS (2.6.18-348.3.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-348.3.1.el5 ro root=/dev/VolGroup00/LogVol00 console=ttyS0 earlyprintk=ttyS0 rootdelay=300 numa=off
initrd /initrd-2.6.18-348.3.1.el5.img

Our file looks like this:
----------------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/xvda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-348.3.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-348.3.1.el5 ro root=/dev/VolGroup00/LogVol00 console=ttyS0 earlyprintk=ttyS0 rootdelay=300 numa=off hda=noprobe hdb=noprobe - no idea where this came from
initrd /initrd-2.6.18-348.3.1.el5.img

----------------------------------------------------------

2. Installed the LIS (Linux Integration Services) drivers (version 4.2) for Hyper-V and Azure since those are required to boot up the VM in Azure.
a. LIS drivers can be downloaded from the following link: https://www.microsoft.com/en-us/downloa ... x?id=55106
i. Further details on supportability for CentOS: https://docs.microsoft.com/en-us/window ... -v#BKMK_5x
b. Below the instructions from the documentation to install it:
i. Connect to the target virtual machine and verify that the running kernel is the latest installed kernel.
ii. Transfer the lis-rpms-4.2.5-3.tar.gz file to the target virtual machine.
iii. Extract the archived directory of files # tar -xvzf lis-rpms-4.2.5-3.tar.gz
iv. Change to the LISISO directory # cd LISISO
v. Execute the installation script (there will not be any user prompts) as root or with sudo:
# ./install.sh
vi. Restart the virtual machine.
# reboot

3. I found a known bug with Hyper-V and RHEL 5.x/CentOs 5.x: https://access.redhat.com/solutions/298243, “After updating to RHEL5.9 kernel in Hyper-V guests, the new kernel is not able to find the filesystem and is issuing "VolGroup00 not found" and "Unable to access resume device(/dev/VolGroup00/LogVol01)" messages while booting.” Which is the same issue you were having. Below the recommended fix:

a. Add following at the end of the file /etc/modprobe.conf
# vi /etc/modprobe.conf
alias eth0 hv_netvsc
alias scsi_hostadapter hv_storvsc

Our file looks like:
----------------------------------------------------------
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix

alias net-pf-10 off
alias ipv6 off
alias eth0 e1000
alias eth0 hv_netvsc
alias scsi_hostadapter hv_storvsc

----------------------------------------------------------

b. Re-create the initrd image
# cp -p /boot/initrd-2.6.18-348.3.1.el5.img /boot/initrd-2.6.18-348.3.1.el5.img.bkp
# mkinitrd /boot/initrd-2.6.18-348.3.1.el5.img 2.6.18-348.3.1.el5 --preload hv_storvsc --preload hv_vmbus --preload hv_utils -f
4. Once the LIS drivers are installed, modprobe.conf gets Hyper-V modules and initrd it’s regenerated in the source machine, you should be able to start up the virtual machine in azure.

MS keeps on saying that we should focus on step 3, as it is a bug, and we have tried that same step a few times, to no avail.

I am also new to Linux.

what did we miss?

Thanks

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 5 and Hyper V

Post by TrevorH » 2018/08/14 17:15:32

No-one at all, anywhere, should be running CentOS 5. At all.

It's been out of support for about 18 months now and there are already several high severity security bugs that are not fixed in CentOS 5 and nor will they ever be. Do not use it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

nitrous_nit
Posts: 2
Joined: 2018/08/14 16:54:06

Re: Centos 5 and Hyper V

Post by nitrous_nit » 2018/08/14 18:07:54

TrevorH wrote:
2018/08/14 17:15:32
No-one at all, anywhere, should be running CentOS 5. At all.

It's been out of support for about 18 months now and there are already several high severity security bugs that are not fixed in CentOS 5 and nor will they ever be. Do not use it.
I get that, but thats the business decision, not mine unfortunately and they dont want to update it all, given its one of their main money making machines and too scared to upgrade.

User avatar
InitOrNot
Posts: 122
Joined: 2015/06/10 18:26:51

Re: Centos 5 and Hyper V

Post by InitOrNot » 2018/12/24 14:28:38

nitrous_nit wrote:
2018/08/14 17:10:11
These are steps they did to get it to the login screen in their labs, but when we do the same, we get the above message
I have trouble understanding your message. Are you saying Microsoft Support successfully migrated your CentOS 5 VM to Azure, but you cannot replicate such a successful migration to Hyper-V?

Because if MS Support got to the login screen, then I infer the migration job they did was successful. Therefore, if their migration job was successful, and you want to migrate to Azure, why does it matter that you cannot replicate on Hyper-V the successful migration job they did with your VM?

Post Reply