P2V V2V and VM Cloning

Last Modified: 06/30/2014 at 13:31 | Release:

Introduction

The Avance high-availability virtualized environment enables you to easily export, import, restore, and migrate virtual machines (VMs), using the Avance Management Console or command-line interface.


Before using the Avance 2.0 software, we recommend becoming familiar with the terms listed in the glossary.


For best performance:

  • Make sure all hardware (client, server, Avance unit, and storage) is on a high-speed (1GbE or more), low-latency network.
  • Before backup/export, make sure the destination disk that will store exported files has free space equal to twice the disk space allocated to the VM. (After the operation completes, the VM needs only its allocated space.)

FROM NON-AVANCE SOURCE

Windows P2V or V2V

Migrating Windows Physical or Virtual Machines from a non-Avance source

Avance 2.0 can migrate Windows VMs from VmWare, Citrix, or Hyper-V into Avance: this is known as “Virtual-to-Virtual” or “V2V” migration.

Avance can also create a VM from a physical Windows system: this is known as “Physical-to-Virtual” or “P2V” machine migration.

Avance attempts to meet the resource specifications of the source VM, but may be limited by the configuration of the destination Avance unit. The migrated VM can also be re-provisioned later as needed.

Windows VM migration uses the tool XenConvert from Citrix.com.

Preparation

Install the 32 or 64 bit version XenConvert 2.1 on the source machine.

Download the Xenconvert client

XenConvert 2.1 32 bit version
XenConvert 2.1 64 bit version

Exporting a multi-volume machine –virtual or physical – requires two steps: convert the boot volume to OVF and VHD format, and separately convert subsequent volumes to VHD format.

Convert the Boot Volume

  1. Start XenConvert on the source machine.
  2. Validate that From: This machine is selected.
  3. Select To: Open Virtualization Format (OVF) Package. Click Next.
  4. Select only the boot volume. Do not select any other volumes, and do not otherwise change this screen.
  5. Click Next.
  6. Enter a path in the Please choose a folder to store the Open Virtualization (OVF) package textbox. Use a new, empty folder.
  7. Make sure the following XenConvert options are disabled. These are not supported, and can prevent a successful import:
    • Include a EULA in the OVF package
    • Create Open Virtual Appliance (OVA)
    • Compress Open Virtual Appliance (OVA)
    • Encrypt
    • Sign with Certificate
  8. Click Next.
  9. Edit the properties if desired to change the name of the OVF file. Click Next.
  10. Click Convert.

Convert Additional Volumes

  1. Restart XenConvert on the source machine.
  2. Validate that From: This machine is selected.
  3. Select To: XenServer Virtual Hard Disk (VHD). Click Next.
  4. Select one volume. Do not select multiple volumes and do not otherwise change this screen.
  5. In the Enter a folder to store the VHD package textbox, enter the path to a new, empty folder.

    XenConvert does not give the option of specifying VHD file names so each VHD must initially be stored in a different folder to avoid over writing of the previous files.


  6. Click Convert. This creates a VHD and PVP file.
  7. Rename the new VHD to give it a new, unique name and move it to the folder with the boot volume OVF and VHD. The PVP file is not used.
  8. Repeat for each additional volume.

Import the Volumes


To import, the selected OVF file (boot volume) and all associated VHD files (additional volumes) must be in the same directory, and no other VHD files can be in that directory.

Windows will only recognize three drives until PV drivers are installed in the VM. See the Avance Management Console online help on the Virtual Machines page for details on installing PV drivers.


  1. Connect the client PC to the Avance unit containing the exported OVF and VHD files.
  2. In the Avance Management Console, click Import/Restore VM.
  3. Select Import a VM.
  4. Follow the onscreen instructions in the Import/Restore VM Wizard. Be sure to make any needed changes to the VM’s configuration.
  5. P2V only:Disable any services that interact directly with hardware. These services are not warranted in a virtualized environment. Examples include:
    • Dell OpenManage (OMSA)
    • HP Insight Manager
    • Diskeeper
  6. V2V only:Disable the following services:
    • VmWare tools
    • HyperV tools

Linux P2V or V2V

Migrating Linux Physical or Virtual Machines from a non-Avance source.

Avance 2.0 can migrate Linux VMs from VmWare or Hyper-V into Avance: this is known as “Virtual-to-Virtual” or “V2V” migration.

Avance can also create a VM from a physical Linux system: this is known as “Physical-to-Virtual” or “P2V” machine migration.

Avance attempts to meet the resource specifications of the source VM, but may be limited by the configuration of the destination Avance unit. The migrated VM can also be re-provisioned later as needed.

Linux VM migration uses the open-source tool G4L.

Setup


The boot volume must exist on the first physical disk.


  1. Make sure the system includes an FTP server with three times the disk space allocated to the Linux VM. (Three backup images are created.)
  2. Install these applications on the source machine:
    • Ncftp
    • Dialog
    • Lzop
  3. Download g4l from http://g4l.sourceforge.net. Click Tar/GZ in the Links box. The file name is similar to g4l-v0.30.devel.tar.gz.
  4. Download the G4L scripts to a G4L subdirectory in the root directory of the computer.
  5. Expand (untar) the file by typing the following command:
    tar –zxvf g4l-v0.30.devel.tar.gz
  6. Proceed to Overview: Migrate the Machine Image below.

Overview: Migrate the Machine Image

Perform these steps as described in the following pages to migrate a physical or virtual machine to a Linux virtual machine on an Avance unit.

  1. Back up the Storage Stack from the source machine to an FTP server.
  2. On an Avance system, use the G4L CD to Create a G4L Staging Virtual Machine.
  3. Restore the Storage Stack to the G4L Virtual Machine from the backup on the FTP.
  4. Modify the Storage Stack on the G4L Virtual Machine to add drivers.
  5. Back up the Storage Stack from the staging machine to the FTP.
  6. On the Avance unit, create a Linux virtual machine with the same specifications as the source machine: number of CPUs, number and size of disks, number of network adapters, and memory.
  7. Restore the Storage Stack to the Linux Virtual Machine from the backup on the FTP server.

This figure illustrates this process.

Back up the Storage Stack

  1. Start G4L by typing the following:
    cd root/g4l/bootcd/rootfs/
            ./g4l
  2. Select Yes and press Enter.
  3. Select RAW Mode and press Enter.
  4. Select Network use and press Enter.

  5. Configure the IP address of the FTP server, the userid and password, and the filename (items D, E, and F, below).
  6. Specify a path for Path to Image directory (item P). This directory is for writing and reading backup files. If the directory does not exist, create or request a directory on the FTP server with the appropriate permissions.
  7. Select Backup and press Enter.
  8. Select the backup drive from the s, hd, and c0d0X disks. Do not select the dm-0, sdaX, hdaX, or dm-X disk.
  9. Check the displayed information. If correct, press Enter.

    The status is displayed while G4L backs up the drive.
  10. Perform steps 7 through 9 for each additional disk. Give each disk a unique file name.
  11. If backing up the storage stack for the first time:continue with Create a G4L Staging Virtual Machine in the next section.If backing up the storage stack for the second time: create a Linux virtual machine on the Avance unit and Restore the Storage Stack to the Linux Virtual Machine from the FTP server.

Create a G4L Staging Virtual Machine

On the staging machine, copy the storage stack to a G4L virtual machine, and make required changes for deploying a Linux virtual machine on an Avance unit. Make sure the configuration of the G4L virtual machine matches that of the source system: number and size of disks, number of network adapters, and memory configuration.

  1. Create a G4L virtual CD on the Avance unit.
    1. Download the G4L ISO file from http://g4l.sourceforge.net. Under Links, select Tar/GZ (images).
    2. Create a virtual CD of the G4L installation CD on the Avance unit as described in the Console online help.
  2. Create a virtual machine on the Avance unit as described in the Console online help.
    1. Enter a name for the VM, and allocate a single CPU and at least as much memory as the source virtual machine.
    2. Under Select a virtual CD or repository as the installation source for your VM, select the G4L virtual CD created in step 1.
    3. Provision the VM with at least the same number and size of disks and network devices as the source virtual machine used.
    4. Continue the VM Creation Wizard. Make sure the VM and physical system properties match.
  3. Continue with Restore the Storage Stack to the G4L Virtual Machine below.

Restore the Storage Stack to the G4L Virtual Machine


A maximum of three drives can be restored using this process.


Make sure the destination VM has enough disk space allocated and available to complete the process.

  1. Use the Avance Management Console to shut down the VM as described in the Console online help.
  2. Select the VM and click Boot from CD.
  3. In the Boot from a CD dialog box, select the G4L VCD. Click Boot.
  4. Press Enter till the console prompt opens. Type .\g4l.
  5. Select RAW Mode and press Enter.
  6. Select Network use and press Enter.
  7. Configure the IP address of the FTP server, the userid and password, and the filename.
  8. Select the backup file created previously, and click OK.
  9. Select the destination drive.
  10. Verify the displayed information, then press Enter.
  11. Repeat steps 8, 9, and 10 for each additional drive to restore.
  12. After restoring all the drives, reboot the virtual machine: select X: Reboot in the G4L window, and press Enter.
  13. Continue with Modify the Storage Stack on the G4L Virtual Machine below.

Modify the Storage Stack on the G4L Virtual Machine

  1. P2V only:Disable any services that interact directly with hardware, such as:
    • Dell OpenManage (OMSA)
    • HP Insight Manager
  2. V2V only:Disable the following services:
    • VmWare tools
    • Hyper-V tools
  3. Download and install the appropriate kernel patches to the G4L virtual machine (staging machine): see “Installing or upgrading kernel patches” in the Console online help.
  4. Change the host name by editing the /etc/sysconfig/network file and changing HOSTNAME line to the desired name.
  5. Change the network settings in the /etc/sysconfig/network-scripts/
    ifcfg‑ethX file:

    • Make sure the HWADDR line is commented out or removed.
    • If using a static IP address, make sure the IP address assigned to the guest is unique.
  6. Modify the /etc/modprobe.conf file to include only the following lines:
    • alias ethX xennet
    • An alias line for every network interface the virtual machine supports. For example, if the machine had three network interfaces, the modprobe.conf file would contain the following:
              alias eth0 xennet
      
              alias eth1 xennet
      
              alias eth2 xennet
      
              alias scsi_hostadapter xenblk
  7. Regenerate the initrd image:
    1. Change to the boot directory (cd /boot).
    2. Find the initrd image name that contains the name of the Avance unit. For example:initrd-2.6.9-55.0.2.EL.xs4.0.1.495xenU.img).
    3. Back up the initrd image using the mv command. For example:mv initrd-2.6.18-92.1.10.el5. avance1xen.img initrd-2.6.18-92.1.10.el5. avance1xen.img.old
    4. Remake the initrd with the xennet and xenblk drivers. For example:/sbin/mkinitrd /boot/ initrd-2.6.18-92.1.10.el5. avance1xen.img 2.6.18-92.1.10.el5. avance1xen –with=xennet –with=xenblk
  8. In the /boot/grub/grub.conf file:
    1. Remove the xen.gz line in the 2.6.*-xen kernel section and change the default to 0.
    2. Change the new kernel entry to kernel instead of module.
    3. Change the new initrd entry to saw initrd instead of moduleFor example:
      Unmodified grub menuModified grub menu
  9. Back up the Storage Stack to the FTP server (page 10.
  10. On the Avance unit, create a Linux virtual machine with one CPU and with the same specifications as the source machine: number and size of disks, number of network adapters, and memory.
  11. Restore the Storage Stack to the Linux Virtual Machine to the FTP server.

Restore the Storage Stack to the Linux Virtual Machine

  1. In the Avance Management Console, shut down the VM as described in the Console online help.
  2. Select the VM and click Boot from CD.
  3. In the Boot from a CD dialog box, select the G4L VCD. Click Boot.
  4. Press Enter until the console prompt appears. Type .\g4l.
  5. Select RAW Mode and press Enter.
  6. Select Network use and press Enter.
  7. Configure the IP address of the FTP server, the userid and password, and the filename (items D, E, and F).
  8. Select the backup file created in the first step, and click OK.
  9. Select the destination drive, verify the information displayed, and press Enter.
  10. Repeat steps 8, 9, and 10 for each additional drive to restore.
  11. After restoring all the drives, reboot the virtual machine: select X: Reboot in the G4L window, and press Enter:

FROM AN AVANCE SOURCE

Exporting a Virtual Machine

The Export process exports a copy of all the chosen volumes along with the VM’s configuration (stored as a OVF file). The OVF file can then be used to Import/Restore the VM image.

The overall export process is as follows:

  1. In the Avance Management Console, select Virtual Machines.
  2. Select the VM.
  3. Shut down the VM (if running).
  4. Click Export/Snapshot.
  5. Follow the onscreen instructions in the Export/Snapshot dialog.

The Throttling Level menu limits the performance impact of the export process on running VMs. See the Console online help for details.


Restoring a Virtual Machine

This is a process where a previously exported VM is restored to its native unit.

Note: You cannot restore to a different unit, the OVF file should have been exported from the same unit. Also, at the time of restoring, you cannot change any of the VM’s resources.


Restoring will completely replaces the contents of the VM.
Fast network connections are strongly recommended.


The overall restore process is as follows:

  1. Connect the client PC to the Avance unit.
  2. In the Avance Management Console, go to the Virtual Machines page.
  3. Click Import/Restore VMs.
  4. Select the VM image to restore.
  5. Follow the onscreen instructions in the Import/Restore dialog.
  6. The image then streams to the PC.
  7. The image then streams to the Avance unit.
  8. The Avance unit then restores the VM.

Cloning

Migrating or Cloning Physical or Virtual Machines from Avance to Avance
Cloning an Avance Windows or Linux VM consists of exporting a “baseline” VM to an image file, then importing that file onto one or more Avance systems to create duplicates of the original VM. This process also allows you to change the VM’s system resources, such as number of processors and memory used.

  1. Windows only:
    1. Make sure all volumes are labelled accurately as outlined in Appendix A: Windows Drive .
    2. Execute the sysprep command.
    3. Shut down the VM.
  2. Export the VM as described in “Error! Reference source not found.” on page Error! Bookmark not defined..
  3. Connect the Avance unit to a client PC having access to the storage containing the exported OVA.
  4. In the Avance Management Console, click Import/Restore VM.
  5. Select Import a VM.
  6. Follow the onscreen instructions in the Import/Restore VM Wizard. Be sure to make any needed changes to the VM’s configuration.The VM auto-starts when the import finishes.
  7. Linux only:Verify the VM hostname and MAC address:
    1. Edit the /etc/sysconfig/network file and change the HOSTNAME line to the desired name.
    2. Change the network settings in the /etc/sysconfig/network-scripts/
      ifcfg-ethX file:

      1. Comment out or remove the HWADDR line.
      2. If using a static IP address, make sure the guest’s IP address is unique.

      See the Red Hat deployment guide for details:

      http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/pdf/Deployment_Guide.pdf

  8. Repeat steps 3–7 for each additional Avance unit.

Appendix A: Windows Drive Labelling

Accurate labelling of Windows drives helps ensure that the drives will be accurately mapped by import or restore. Before using sysprep (for preparing a clone) or XenConvert, make sure each window volume has a unique identifiable label. Note: this process will require administrator privileges. To set a label from the command prompt, type:

CMD>label C:c-drive

You can use the diskpart utility to verify all volume labels:

DISKPART> list volume

After importing, use Disk Manager to reassign the drive letters. The labels assigned before using XenConvert or Sysprep will help identify the drives. For instructions, see the following:

http://windows.microsoft.com/en-us/windows-vista/Change-add-or-remove-a-drive-letter

Glossary

  • AVCLI: Avance command-line interface.
  • Meta-data: Information describing VM characteristics such as number of network adapters, number of disks, memory, and the VM name.
  • OVF: Open Virtual Machine Format. An open standard for packaging and distributing physical or virtual machine data, and containing meta-data for the VM.
  • OVA: Open Virtual Appliance/Application, a compressed format of the OVF.
  • P2V: Physical-to-Virtual. A process that creates VM copy of a physical machine.
  • V2V: Virtual-to-Virtual. A process that converts a virtual machine from one location or type to another.
  • VHD: Virtual Hard Disk format.

Troubleshooting

If an import, export, backup, or restore is interrupted by an event that changes the primary node, the process may need to be restarted. For an import or restore, you may also need to first delete the VM. See the Console online help.

  • Avance release 2.1.2 or later: If a firewall is used between the Avance Unit and the client (where the Avance-portal is accessed), the firewall must open Port 80 / http and Port 443 / https.
  • Avance release 2.1.1 or earlier: If a firewall is used between the Avance Unit and the client (where the Avance-portal is accessed), the firewall must open Port 9080.