A step by step guide for p2v’ing servers, specifically HP Proliant DL/ML’s with SCVMMR2, where as mentioned in a previous post there can be issues during conversion. I’m pretty sure it can be applied to any server brand, but it’s mainly HP hardware that I deal with day to day. The document is based on our environment also hence references to ridiculously tiny c: partitions used on initial 2008 installs and conservative vm sizing references.
Although not the most ideal long-term solution, p2v’ing a physical server can often be a sensible way to free up hardware, consolidate services and squeeze a little more life out of an aging installation.
Microsoft’s SCVMM R2 offers a robust p2v tool that fits most needs, however, like any p2v tools, used carelessly it can generate useless vm’s, damage other network services and even cause conflicts with its original physical host when that’s reused.
This document is intended to approach the P2V process from two perspectives; both processes are pretty much identical bar the last few steps.
- P2v a production box in order that it continues to perform its original service with its original identity
- P2v a production box in order to have a clone of a production machine on which patching, changes, upgrades etc. can be performed without impacting the production environment.
This guide is based on p2v’ing a file server, not an application server, there are additional considerations for these, particularly those that write to databases or provide messaging/real-time services.
(some) Virtualisation best practices:
Not all services are suitable for virtualization, but if hosts and services are chosen carefully and maintained thoroughly there is no reason a virtual machine can’t perform as well as its equivalent physical machine.
- Clustered VM hosts cannot start without a DC – bear this in mind if you are considering virtualizing DC’s.
- It is not usually a good idea to p2v a DC or a database server without significant planning and testing.
- Ensure host layouts are planned so that potentially contentious machines are not sharing spindle sets or LUN’s unless they are designed appropriately.
- Be conservative when initially allocating resources, they can always be added later if performance is inadequate.
- Always plan for a way back with p2v, don’t reuse the physical box immediately, unplug it for a few business days first and make sure you have backups from before the start of the procedure.
P2v’ing a Production box for continued use:
Firstly check the environment is ready to host the existing production box, that the host has sufficient processing capacity, memory and access to disk space in light of the other VM’s its hosting.
Secondly ensure that unwanted data is removed and that the box to be converted is healthy and patched. If you are remotely p2v’ing the machine ensure you have ilo access both to the donor physical machine and the VM host and that ILO is tested. MAKE A NOTE OF PHYSICAL MACHINES IP SETTINGS as they will be lost given physical nic will be removed and replaced by a new piece of (virtual) hardware.
Once the above is complete:
1. Load SCVMM R2 and select “convert a physical server”, in the resulting dialogue select the machine you want to convert and enter suitable administrative credentials.
2. Next, define the name of the converted machine (same as original) and add a description.
3. Once this is complete, SCVMM will scan the machine to be converted and generate a summary of it’s storage, OS and network adaptors. Click Next.
4. Now the SCVMM agent is installed It will assess the size of the data on the disks to be converted and give you the option to define the size of the VHD’s to host the data and whether or not they should be dynamically expanding. This is a good time to increase the size of the C: drive if it’s one of the early 2008 servers with a 30gb partition (see screenshot). For development or very low utilisation servers, dynamically expanding VHD’s are a good bet, for production it’s better to assign all space at the start. Just ensure you know the sum of all possible data that could fill a drive. I also prefer to select shut down physical machine when conversion is complete from the conversion options given we have ilo access if ther e is a need to switch it back on again.
5. Next step is to choose the amount of memory and number of processor cores you are assigning to your virtual machine, again it depends on required performance, but for non-database servers I’d keep things modest – a single processor and 2-4gb RAM.
6. SCVMM R2 will now attempt to recommend a hyper-v host server for your converted machine and flag any warnings. Choose the most appropriate host and click next.
7. Now pick the volume on the host where the VM should be placed, if you click browse an unusually helpful dialog box appears outlining free space on each drive, ensure the path driveletter:\VirtualMachines is used for storage and add the path to the default paths for that host if offered.
8. When p2v’ing it is better to start the machine with the nic’s disconnected from the lan, after conversion the converted machine has the same mac as the existing which can cause ARP conflicts and other problems, there are also a number of steps that need to be completed before the VM starts smoothly and can replace the existing physical machine and then be connected to the LAN.
9. At this stage it is recommended that when defining actions for the physical host starting and stopping you select automatically start as disabled and that the machine is shut down when the physical host starts.
10. Last step is that a quick issues check is completed; there should be no issues, if there are resolve them before continuing. Then click next.
11. A summary page is now presented with the option to review the PowerShell script used to start the job and the option to automatically start the machine after converting, usually this isn’t necessary.
12. Click “create” to start the task and a summary window is presented as below, you can monitor progress of the process here, particularly important is the completion of the transfer of the actual disk image and the point at which most HP Proliant conversions fail (around 58%).
13. Once the disk transfer is completed, SCVMM will attempt to make the machine virtualizable and install vm components. If P2v’ing a proliant, I have found this will usually fail and eventually the machine will lock due to HP software conflicts/locks. Log onto the physical host machine and open the hyper-v manager to check: be sure to switch off existing physical machine before continuing as SCVMM will not power it off independently if the conversion process does not finish – which in this case, it hasn’t.
14. Once the conversion appears to have failed (it will stick on making OS virtualizable) power the VM off from the hyper-v console on the host and go into settings to change the NIC MAC from static to dynamic or your new vm will have the same mac as the existing (reusable….) physical server, do not connect the nic at this time.
15. Now boot the converted machine from the hyper-v console on the host and hit f8 to boot it in safe mode.
16. Once server comes up, log on as local admin (.\administrator) the mouse will not work as the integration services install failed and it’s in safe mode. When it does start it’ll install the vm integration drivers, eventually mouse will start working and the box will want to restart, do not restart now, go into service manager and disable ALL HP services and restart the machine.
17. Once complete the services viewer should display all HP services as disabled.
18. Restart the server, log on as .\administrator, it should come up fine. Once logged in go to programs and features and carefully remove all HP software from top to bottom.
19. Following this you should have a nice short list of installed apps.
20. Now go to the NIC IP settings, they’ll be reset to dynamic as hardware is different. Set them back to appropriate static settings for server in question.
21. Given an existing physical nic had the same settings you’ll be asked to confirm you want this to happen, obviously answer yes then shut the machine down.
22. Go into the settings for the VM you’ve converted and change the nic settings from disconnected to appropriate LAN connection. Then start the machine.
23. Now test everything works as expected, check event logs, backups, printing, access replication, whatever’s appropriate.
P2v’ing a Production box for use as a clone:
Firstly check the environment is ready to host the clone, that the host has sufficient processing capacity, memory and access to disk space in light of the other VM’s its hosting.
Secondly ensure that unwanted data is removed and that the box to be converted is healthy. MAKE A NOTE OF PHYSICAL MACHINES IP SETTINGS as they will be lost given physical nic will be removed and replaced by a new piece of (virtual) hardware.
Once the above is complete follow the instructions for p2v’ing a box for continued use up to the end of step 21 (do not connect box to production network).
1. At this point it’s important to anonymise the machine and remove it from the network, SO, it’s here that we run sysprep on the machine in question.
2. Go to Windows\System32\sysprep and run sysprep.exe
3. You will be presented with a dialogue box, select oobe and generalize, then shut down
4. Before booting the machine, connect the nic to the network, then proceed with basic setup, renaming and adding to the domain. By doing this you prevent both Mac conflicts and SID conflicts.