Q. How can I perform a physical to virtual (P2V) migration with System Center Virtual Machine Manager (SCVMM) 2008?
November 19, 2008
The answer to this question is also available as a video.
A. SCVMM 2008 makes it pretty easy to migrate a physical server to a virtual machine (VM). As long as the source computer is running a supported OS, the SCVMM 2008 P2V wizard does all the work for you. Follow these steps:
1. Launch the Virtual Machine Manager administrative console.
2. From the Virtual Machine Manager main actions menu, select Convert physical server, as the following screen shows:
3. Enter the name or IP address of the machine you’re converting, along with administrative credentials for the source machine, as the following screen shows. The source machine doesn’t have to be in a trusted domain with the target virtual server.
4. Enter a name for the new VM and, optionally, the user to be the VM’s owner and a description for the VM.
5. You’re prompted to scan the source computer, so click Scan System. Once the scan is done, information about the source computer is displayed, as shown in the following screen, and you can click Next to continue the migration. When you perform the scan, the Virtual Machine Manager P2V Agent is installed on the source computer and runs as a service. This service facilitates gathering information and capturing disk content.
6. Choose which volumes to migrate. The wizard displays a list of volumes on the source computer. You must migrate the system and boot volumes (usually C:), and you can choose to migrate other disks. You can select the size of the Virtual Hard Disk (VHD) to create, whether the VHD will be dynamic or fixed size, and the channel to which the disk will connect. The following screen shows these settings.
7. Configure the number of processor cores and amount of memory for the VM, as the next screen shows. By default, the configuration will match that of the source computer, but you can add or remove processor cores and memory.
8. Choose the host for the VM. The wizard displays a list of possible hosts, each with a star rating. In my example, shown in the next screen, only savdalvs02 has any stars. This rating is because savdalvs02 is the only potential host that has enough memory that isn’t allocated to other VMs and has a connection to the network to which the source machine connects. Machines that don't meet the criteria have an explanation as to why. The transfer type on this screen may say SAN, but the disks’ data is sent over the network unless SAN to SAN can actually be used. The transfer type here seems to be wrong in most cases.
9. Enter the path where the new VM and its VHD files will be stored on the virtualization server and click Next.
10. For each NIC on the physical server you’re converting, select the network you want to map to the virtual NIC. If possible, the wizard will select mappings automatically based on network IDs, as the next screen shows.
11. Select additional properties, such as when to start the VM and if you want a delay in starting the VM.
12. A list of any problems with the conversion is displayed. Hopefully, this will say No issues detected, so you can click Next.
13. A summary of the conversion process is displayed, shown in the following screen, along with an option to view a Windows PowerShell script that could perform the migration outside of the wizard. This screen has the option to start the VM after deploying it on the host, but you probably don't want to start it until you’ve powered down the physical source system. Click Create to start the P2V conversion.
14. Once the conversion is finished, you’ll have a new VM with the same content as the original physical server. You can now power off the physical machine and start the new VM. If you want to perform some tests, you can modify the network of the new VM so it’s on a private network with no connectivity to the outside world, preventing its IP from clashing with the physical server that’s still running.
Below is an example of the PowerShell script generated by the P2V conversion wizard.
# ------------------------------------------------------------------------------
# Convert Physical Server (P2V) Wizard Script
# ------------------------------------------------------------------------------
# Script generated on Friday, November 07, 2008 8:10:11 PM by Virtual Machine Manager
#
# For additional help on cmdlet usage, type get-help
# ------------------------------------------------------------------------------
$Credential = get-credential
New-MachineConfig -VMMServer savdalvm01 -SourceComputerName "192.168.1.67" -Credential $Credential
$VMHost = Get-VMHost -VMMServer savdalvm01 | where {$_.Name -eq "savdalvs02.savilltech.net"}
$VirtualNetwork = Get-VirtualNetwork -VMMServer savdalvm01 | where {$_.ID -eq "f6be0ec0-d8eb-4f06-a804-4b0f2ac2071c"}
$MachineConfig = Get-MachineConfig -VMMServer savdalvm01 | where {$_.Name -eq "192.168.1.67"}
New-P2V -VMMServer savdalvm01 -VMHost $VMHost -RunAsynchronously -JobGroup 66050eed-003a-4728-8436-655a1dde6018 -SourceNetworkConnectionID "00:13:D4:7E:D4:11" -PhysicalAddress "00:13:D4:7E:D4:11" -PhysicalAddressType Static -VirtualNetwork $VirtualNetwork -NetworkLocation "savilltech.net" -MachineConfig $MachineConfig
$VMHost = Get-VMHost -VMMServer savdalvm01 | where {$_.Name -eq "savdalvs02.savilltech.net"}
$MachineConfig = Get-MachineConfig -VMMServer savdalvm01 | where {$_.Name -eq "192.168.1.67"}
New-P2V -VMMServer savdalvm01 -VMHost $VMHost -RunAsynchronously -JobGroup 66050eed-003a-4728-8436-655a1dde6018 -VolumeDeviceID "C" -Dynamic -IDE -Bus 0 -LUN 0 -MachineConfig $MachineConfig
$Credential = get-credential
$VMHost = Get-VMHost -VMMServer savdalvm01 | where {$_.Name -eq "savdalvs02.savilltech.net"}
$MachineConfig = Get-MachineConfig -VMMServer savdalvm01 | where {$_.Name -eq "192.168.1.67"}
New-P2V -Credential $Credential -VMMServer savdalvm01 -VMHost $VMHost -Path "d:virtuals" -Owner "SAVILLTECHjohn" -RunAsynchronously -JobGroup 66050eed-003a-4728-8436-655a1dde6018 -Trigger -Name "testp2v" -MachineConfig $MachineConfig -CPUCount 1 -MemoryMB 512 -RunAsSystem -StartAction NeverAutoTurnOnVM -StopAction SaveVM
About the Author
You May Also Like