2020年6月6日 星期六

Redhat 3 轉虛擬機

Reference:
Solved: Linux Red Hat P2V problem. Cannot boot after conversion. Solution below in attachment
轉載(Centos Linux Rescue 修復方式)
Virtual machine does not boot after being converted from a physical Red Hat machine (1002402)

原作者的圖文操作步驟

Linux Red Hat 3 Physical To Virtual Conversion – Vmware

1. On the machine you will be performing the conversion open VMware vCenter Converter Standalone Client.
After several attempts with various versions, my preference for P2Ving old Linux servers is 4.0.1


2. Specify the source machine to be virtualized. Add the IP and account credentials ensuring you select Linux.

3. Add the IP address, username and password of the ESX host your physical server will be virtualized to.

4. Choose the name and the Datastore as required.


5. Here you can modify disk settings, quantity of CPU’s, network cards, advanced options and most importantly, the VMware Helper Settings.
After playing around with the disk settings, I saved over 80GB by reducing the size of the disks to a more reasonable level. Also don’t worry about the conversion time. It’ll be much quicker than shown here.

6. Add a helper on the same vlan as the VM will reside. I don’t use auto as I can’t get it to work.

7. Time to read through the summary of your settings for the conversion then select ‘Finish’.

8. The job then moves into the ‘Running’ state


9. Open the vSphere Client, navigate to the vDatacenter the ESX host you selected reside in and open the ‘Console’ of the VM. You can see the creation process up to a certain point. Important if it is going to fail to know where about in the process.
10. Once it has completed the P2V process, open the ‘Edit Settings’ choice.

Go to ‘Boot Options’ and choose to enter the ‘BIOS Settings’ on start up. You may choose to disable networking (under the Hardware tab) temporarily. Advisable if this VM is to be the physical server’s replacement with same IP even though in ‘Linux Rescue’ it asks if you want to enable networking I don’t want any conflicts with the physical production server that is still running.

11. Power on the VM

12. The VM will boot into Bios. Change the boot settings from below to have ‘CD-Rom Drive’ above ‘Hard Drive’
This will allow you to boot to the OS ISO to start the ‘Linux Rescue’ process.

13. Choose the ‘Exit’ tab and ‘Exit Saving Settings’

14. Choose the CD\DVD Drive option and connect to the location of your Linux OS ISO\Disk. I prefer to make an ISO of the physical disk and add it to a Datastore.


15. Highlight the OS and click ‘OK’

16. Once at the initial screen type ‘linux rescue’ and press enter.

17. As stated earlier, I choose ‘No network connection’. I don’t want a conflict with the running physical server. It is not needed to get the server working as a VM.

18. Choose ‘Continue’

19. Once it is finished you will see the below message, just select ‘OK’.

20. You can now mount the image with the following command. "chroot /mnt/sysimage"

21. Run ‘kudzu’ to scan for hardware changes and remove old hardware.



You will want to ‘remove configuration’ for all the old physical devices.

22. Now you will have obtained access to the command line.
Time to check the name and version of your Linux OS.
View the contents of /lib/modules as below then run the following command to rebuild the ramdisk installer:
Mkinitrd –v –f initrdxxxx.img xxxx
i.e. I used the following: mkinitrd –v –f initrd2.4.9-e.34smp.img 2.4.9-e.34smp



23. Once complete you will need to view/edit your grub.conf.
I made a copy of the original and left it in the /boot/grub folder prior to modifying it.

24. On the four servers I have successfully converted the same occurred on all of them.
All the entries in the grub.conf were (hd0,2) whereas they needed to be changed to (hd0,1) which I did in VI.


25. Save the modified file and shutdown the VM.
Disconnect the Linux ISO from the VM and restart the VM.
If you have been successful, you’ll see the following screen. I booted 3rd one down successfully.

26. After the server goes through its initialisation phase you will be taken to the normal command prompt.

27. Login as per normal. You may need to make some changes to the system or have a DBA/Apps guy ensure any of their installed components are working correctly. Apart from that, you’re done! Congratulations 

沒有留言:

張貼留言