In a series of blog posts, I'm going to be covering some of the basics that people just happen to overlook. Let's forget about cloud and look back to the real reason why we started virtualizing in the first place, the virtual machine. The virtual machine is key component to cloud, but having machines that are lean and clean allow greater density and better performance.
We all began a journey with Physical to Virtual (P2V) migrations. Converging infrastructure to run multiple virtual machines on top of beefy physical hardware. Along with this comes what I call The P2V Dilemma.
A physical server needs drivers to talk to it's hardware. A virtualized server, in essence, does the same thing. VMware presents new hardware to allow the virtual machine to talk to it's hypervisor. Think of the driver issue in a P2V migration like removing a video card and installing a new one. The drivers and hidden hardware are still there just in case you feel like popping the video card back in. A P2V will still have all of the old hardware in the virtual machine. Don't forget about services that physical servers used, namely HP server management services.
Why?
- Boot time. During the boot time, services are started, drivers are initiated and loaded. By removing unneeded services and old hardware we can increase boot time and overall performance.
- Network conflicts. 9 times out of 10, a P2V will need the same IP address. The physical machine had a NIC that got assigned an IP address and it's locked to that physical NIC. Once virtualized and a new virtual NIC is given to the VM, but assigning the same IP address will result with a confusing pop-up box. Removing the old NICs will clear that message.
- NIC naming. When a new NIC is presented to Windows, it's given a name such as "Local Area Connection X" where X is a number. Removing old NICs gives you the ability to rename the single NIC to "Local Area Connection". Not a big deal, but making everything clean.
How to clean most of this up is using Eric Seibert's documented method:
1. Open a Windows command prompt and type the following:
set devmgr_show_nonpresent_devices=1
This sets an environment variable that tells the device manager to show all non-present devices.
2. At the same command prompt, type
devmgmt.msc
…which launches the device manager application. Do not try and launch it through the graphical user interface (GUI) instead as the environment variable set in step one only applies to commands run inside the command prompt.
3. Once the device manager window opens, select View from the top menu, and then Show Hidden Devices.
4. If you expand the device categories you will see both present and non-present devices. The non-present devices are shown by the grayed-out icons next to the device names. You can remove them by right-clicking on them and selecting Uninstall. Unfortunately you have to do this one by one as you can not select multiple devices. Click OK at the warning message that appears. If you accidentally delete a device that is present, don’t panic — once you reboot, Windows will automatically install the device driver for it again.
There is a much easier way and that's done with a script. The original script can be found at Mike Laverick's site (RTFM.co.uk) but I have packaged it into my VM Advanced ISO.
HP servers are the worst when it comes to hardware management agents, services, and software. Before going through the process of removing applications in the Add/Remove software panel or disabling services, check out HP Proliant Support Pack Cleaner. Running this simple .exe will remove ALOT of HP specific junk. Once done, do a reboot, and then begin to see if there is anything left behind. I really love that this tool because it gets rid of services that could be running in the background. This tool is packaged into my VM Advanced ISO as well, but it's an older version. I'll get that fixed soon.
One last tool I would like to mention also came from Mike Laverick's site (RTFM.co.uk) is the resolution re-sizer. Having a consistent resolution between all of your VMs is nice to have. Run the script in the VM Advanced ISO on each VM (or better yet, use VMware Guest Console to deploy the script in seconds) and you will have a standard resolution across the board.
Some other great links I ran across
VMWare – Converter Best Practices (p2v)
New Submission: P2V Scripts - Post-Configuration Scripts
VMware vConverter - P2V for Windows Servers
Do you have any other P2V migration tips or tools? Comment below.