P2V V2V and VM Cloning
Last Modified: 06/30/2014 at 13:31 | Release:Table of Contents
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
- Start XenConvert on the source machine.
- Validate that From: This machine is selected.
- Select To: Open Virtualization Format (OVF) Package. Click Next.
- Select only the boot volume. Do not select any other volumes, and do not otherwise change this screen.
- Click Next.
- Enter a path in the Please choose a folder to store the Open Virtualization (OVF) package textbox. Use a new, empty folder.
- 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
- Click Next.
- Edit the properties if desired to change the name of the OVF file. Click Next.
- Click Convert.
Convert Additional Volumes
- Restart XenConvert on the source machine.
- Validate that From: This machine is selected.
- Select To: XenServer Virtual Hard Disk (VHD). Click Next.
- Select one volume. Do not select multiple volumes and do not otherwise change this screen.
- 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.
- Click Convert. This creates a VHD and PVP file.
- 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.
- 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.
- Connect the client PC to the Avance unit containing the exported OVF and VHD files.
- In the Avance Management Console, click Import/Restore VM.
- Select Import a VM.
- Follow the onscreen instructions in the Import/Restore VM Wizard. Be sure to make any needed changes to the VM’s configuration.
- 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
- 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.
- Make sure the system includes an FTP server with three times the disk space allocated to the Linux VM. (Three backup images are created.)
- Install these applications on the source machine:
- Ncftp
- Dialog
- Lzop
- 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.
- Download the G4L scripts to a G4L subdirectory in the root directory of the computer.
- Expand (untar) the file by typing the following command:
tar –zxvf g4l-v0.30.devel.tar.gz
- 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.
- Back up the Storage Stack from the source machine to an FTP server.
- On an Avance system, use the G4L CD to Create a G4L Staging Virtual Machine.
- Restore the Storage Stack to the G4L Virtual Machine from the backup on the FTP.
- Modify the Storage Stack on the G4L Virtual Machine to add drivers.
- Back up the Storage Stack from the staging machine to the FTP.
- 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.
- 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
- Start G4L by typing the following:
cd root/g4l/bootcd/rootfs/ ./g4l
- Select Yes and press Enter.
- Select RAW Mode and press Enter.
- Select Network use and press Enter.
- Configure the IP address of the FTP server, the userid and password, and the filename (items D, E, and F, below).
- 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.
- Select Backup and press Enter.
- Select the backup drive from the s, hd, and c0d0X disks. Do not select the dm-0, sdaX, hdaX, or dm-X disk.
- Check the displayed information. If correct, press Enter.
The status is displayed while G4L backs up the drive. - Perform steps 7 through 9 for each additional disk. Give each disk a unique file name.
- 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.
- Create a G4L virtual CD on the Avance unit.
- Download the G4L ISO file from http://g4l.sourceforge.net. Under Links, select Tar/GZ (images).
- Create a virtual CD of the G4L installation CD on the Avance unit as described in the Console online help.
- Create a virtual machine on the Avance unit as described in the Console online help.
- Enter a name for the VM, and allocate a single CPU and at least as much memory as the source virtual machine.
- Under Select a virtual CD or repository as the installation source for your VM, select the G4L virtual CD created in step 1.
- Provision the VM with at least the same number and size of disks and network devices as the source virtual machine used.
- Continue the VM Creation Wizard. Make sure the VM and physical system properties match.
- 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.
- Use the Avance Management Console to shut down the VM as described in the Console online help.
- Select the VM and click Boot from CD.
- In the Boot from a CD dialog box, select the G4L VCD. Click Boot.
- Press Enter till the console prompt opens. Type .\g4l.
- Select RAW Mode and press Enter.
- Select Network use and press Enter.
- Configure the IP address of the FTP server, the userid and password, and the filename.
- Select the backup file created previously, and click OK.
- Select the destination drive.
- Verify the displayed information, then press Enter.
- Repeat steps 8, 9, and 10 for each additional drive to restore.
- After restoring all the drives, reboot the virtual machine: select X: Reboot in the G4L window, and press Enter.
- Continue with Modify the Storage Stack on the G4L Virtual Machine below.
Modify the Storage Stack on the G4L Virtual Machine
- P2V only:Disable any services that interact directly with hardware, such as:
- Dell OpenManage (OMSA)
- HP Insight Manager
- V2V only:Disable the following services:
- VmWare tools
- Hyper-V tools
- 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.
- Change the host name by editing the /etc/sysconfig/network file and changing HOSTNAME line to the desired name.
- 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.
- 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
- Regenerate the initrd image:
- Change to the boot directory (cd /boot).
- 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).
- 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
- 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
- In the /boot/grub/grub.conf file:
- Back up the Storage Stack to the FTP server (page 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.
- Restore the Storage Stack to the Linux Virtual Machine to the FTP server.
Restore the Storage Stack to the Linux Virtual Machine
- In the Avance Management Console, shut down the VM as described in the Console online help.
- Select the VM and click Boot from CD.
- In the Boot from a CD dialog box, select the G4L VCD. Click Boot.
- Press Enter until the console prompt appears. Type .\g4l.
- Select RAW Mode and press Enter.
- Select Network use and press Enter.
- Configure the IP address of the FTP server, the userid and password, and the filename (items D, E, and F).
- Select the backup file created in the first step, and click OK.
- Select the destination drive, verify the information displayed, and press Enter.
- Repeat steps 8, 9, and 10 for each additional drive to restore.
- 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:
- In the Avance Management Console, select Virtual Machines.
- Select the VM.
- Shut down the VM (if running).
- Click Export/Snapshot.
- 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:
- Connect the client PC to the Avance unit.
- In the Avance Management Console, go to the Virtual Machines page.
- Click Import/Restore VMs.
- Select the VM image to restore.
- Follow the onscreen instructions in the Import/Restore dialog.
- The image then streams to the PC.
- The image then streams to the Avance unit.
- 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.
- Windows only:
- Make sure all volumes are labelled accurately as outlined in Appendix A: Windows Drive .
- Execute the sysprep command.
- Shut down the VM.
- Export the VM as described in “Error! Reference source not found.” on page Error! Bookmark not defined..
- Connect the Avance unit to a client PC having access to the storage containing the exported OVA.
- In the Avance Management Console, click Import/Restore VM.
- Select Import a VM.
- 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.
- Linux only:Verify the VM hostname and MAC address:
- Edit the /etc/sysconfig/network file and change the HOSTNAME line to the desired name.
- Change the network settings in the /etc/sysconfig/network-scripts/
ifcfg-ethX file:- Comment out or remove the HWADDR line.
- 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
- 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.