top
logo


Migrating Virtual Machines from ESXi 5 to ProxMox 2.1 PDF Печать E-mail
Автор: adm   
29.12.12 20:54

Introduction

In this article, we’ll copy 2 virtual machines from a working ESXi 5.0 environment to a new ProxMox 2.1 environment.  One VM is running CentOS 5.5 64-bit on a 20GB .vmdk (virtual disk).  The other is a Windows 2008 Server VM with a 24 GB .vmdk.  DNS is configured, and these are the hosts:

cyclops.noltechinc.com – ESXi server
nightcrawler.noltechinc.com – ProxMox server
colossus.noltechinc.com – CentOS 5.5 VM
rogue.noltechinc.com – Windows 2008 VM

Prerequisites / Assumptions

  • These steps may work with other versions of ProxMox and ESX/i, but they have been verified to work for the specified versions.
  • The example uses SCP to transfer the .vmdk files, so SSH must be enabled on either the ESXi or ProxMox server (here, it is the ESXi machine).  Other transfer methods also work, but they aren’t covered
  • ProxMox installed and functioning
  • The VMs in this example were migrated from VMWare Server using this method.  As such, their virtual hard disks are thick provisioned (i.e. the size of their .vmdk files is the same as the size specified in VSphere).  This method might work with thin-provisioned disks, but it hasn’t been tested.

Procedure

  1. In VSphere, remove/consolidate snapshots from the virtual machine.

    This should modify the .vmdk file(s) for the VM.  If SSH is enabled on the ESXi server, that can be verified by navigating to the VM’s location and typing “ls -lt *.vmdk”
  2. On the ProxMox server, create a VM.  The important part of this process is the specification of the virtual disk.  For Windows hosts, the bus type must be IDE.  Linux hosts can use any of the settings, but we use VirtIO.  Specify .vmdk for the format.
  3. Copy the .vmdk file from the ESXi host to the new VM’s location on the ProxMox server.  For rogue.noltechinc.com, that is /var/lib/vz/VM/images/4202, so we execute:
    scp  cyclops.noltechinc.com:/vmfs/volumes/datastore1/Rogue/Rogue-flat.vmdk /var/lib/vz/VM/images/4202
  4. When that completes, move the copied .vmdk to whatever the name is of the created VM disk.  Here, it is vm-4202-disk-1.vmdk.
    mv Rogue-flat.vmdk vm-4202-disk-1.vmdk
    ProxMox doesn’t have an easy way to use existing disks through the GUI, so using mv is easier.
  5. Now is a good time to check the MAC address of the virtual NIC.  Our environment uses static DHCP, based on the NIC, so it’s important to spoof the same MAC that ESXi was using.  If you bring up a NIC with the same MAC, you will need to stop the VM in ESXi first.  Then, specify the MAC in the ProxMox VM.  Bear in mind that for a NIC to be changed, whether the MAC address or any VLAN tagging, the VM must be cold-booted.
  6. Start the ProxMox VM.  It should come up with no problem.  Again, if this is a Windows VM, the virtual disk must be using IDE.

Variations and Troubleshooting

Some virtual machines have multiple hard disks.  In ESXi, they will be called something like colossus-flat.vmdk and colossus-flat-1.vmdk.  In these cases, additional drives will need to be specified in ProxMox, and the copied .vmdk files will need to be renamed accordingly.  e.g. Rogue-flat-1.vmdk will become vm-4202-disk-2.vmdk.

It can’t be mentioned enough that Windows needs to use the IDE bus.  If using Windows 2000-2003, mergeide.reg should be applied before the migration.  Additionally, it is probably worth installing the VirtIO drivers, but this also depends on the installation.

If migrating a Linux host, it might be necessary to try different bus types.  If you see init panics, this is probably the culprit.  Most likely, the OS is seeing the virtual hard disk as something like /dev/vda instead of /dev/sda, so it is possible to correct this problem by editing grub, but it’s easier to use a different bus type.  Since ProxMox 2.1 doesn’t have a way to edit an existing drive’s bus type through the web interface, follow these instructions:

  1. Stop the VM
  2. Move the virtual drive’s file to a safe place, because the next step will otherwise delete it (e.g. cd /var/lib/vz/VM/images/4202 && mv vm-4202-disk-1.vmdk ..)
  3. Remove the drive through the web interface
  4. Add a new drive to the VM, specifying a different bus type (IDE is probably a good bet)
  5. Overwrite the newly created file with the file that you saved in step 2 (e.g. cd /var/lib/vz/VM/images && mv vm-4202-disk-1.vmdk 4202/)
  6. Start the VM and verify functionality

 

источник: http://noltechinc.com/miscellany/migrating-virtual-machines-from-esxi-5-to-proxmox-2-1

ссылка на материал: http://thin.kiev.ua/linux/39-linux/717-migrating-virtual-machines-from-esxi-5-to-proxmox-21.html

{jcomments on}

Последнее обновление 29.12.12 21:04
 
Интересная статья? Поделись ей с другими:

bottom

 

Unreal Commander PfSense по русски Яндекс.Метрика