Moving Physical Linux Server into Virtual Image

These are various reason why I decided to move the physical server into Virtualization. Below are some of the reasons :

  1. Simplify system backup & restore. We do not need to reinstall everything because we could backup all system in an image. The restore process should be as simple as copying the image into new server
  2. Reduces power & electricity consumes. Virtualization need a few physical server as host to run some virtual machine. Less physical server means a lower power and electricity needed
  3. Minimal impact while trying to upgrade to better hardware. Moving virtual server into better server will need a few changes than moving physical into physical server.
  4. Standard Driver & Management. Virtualization do not need different driver for different model. The driver would same as others because Virtualization will emulate the host driver.
  5. Reduce hardware & peripheral cost. We do not need a new server to host different service

Moving physical into virtual better known as  P2V means Physical To Virtual. The popular application to do this are VMWare Converter, that free of charge for open source edition. Anyway, I don’t have the VMWare server (VMWare ESXor VMWare server) to act as destination place for converted image, so I take another way by using CloneZilla Linux with  VMWare Workstation as described below :
Transferring  Physical Disc into Virtual Image

  1. Prepare the second physical disk as the destination disk where the converted image will be saved. You may also use network share folder as the destination but in this tutorial I’ll be using physical disk. Please be aware that you must have a bigger disk than the converted disk or you may seen an insufficient disk space error message.
  2. Download CloneZilla LiveCD and burn it with your CD burner.
  3. Start your server with CloneZilla LiveCD as top priority boots
    `
    clonezilla-start-up-menu
  4. Choose  Device-Image Work with disk or Partitions using Images as selected menu after CloneZilla completely started
  5. Choose the secondary disk as target to saved the converted image
  6. Follow the wizard. CloneZilla will take a moment and ask you some question and confirmation. I need about 30 minutes to convert 250 GB of disk with about 80 GB used space.

Converting Image into Virtual Disk

  1. Create a virtual machine with 2 virtual disk. The first virtual disk has 250 GB of size and made as dynamic disk (so the real space would not full 250 GB but depends on how much space would prepare to saved the content of virtual disk). The second virtual disk are a mounted physical disk where the converted image resides. I used VMWare Workstation over VirtualBox because AFAIK (CMIIW) VMWare Workstation has a feature to mount the physical disk or partition as virtual disk. I could not find how to mount the physical disk or partition as virtual disk with VirtualBox
  2. Start your virtual machine with CloneZilla LiveCD as top priority boot up
  3. Choose Restore image from CloneZilla menu and mount the secondary disk (the mounted physical disk where converted image resides). Choose the mount disk as image source.
  4. Restore the image and follows the CloneZilla wizard until finish. The process itself would similar as converting physical disk into converted image.
  5. Shut down the virtual machine
  6. Remove the CloneZilla LiveCD
  7. Remove the physical disk (the mounted physical disk where converted image resides)
  8. Start your virtual machine

Note :

  1. The above tutorial use physical server with openSUSE 11.1 64 bit contains Samba PDC + OpenLDAP services. I’m converting the system into virtual image and run the virtual machine with openSUSE 11.2 64 bit as host machine
  2. I’m currently using VMWare Workstation 6.5.3 64 bit. The vmdk converted image would be run with VirtualBox without problem
  3. I haven’t try it with 32 bit processor but I think the process would be similar

Leave a Reply

Your email address will not be published. Required fields are marked *