How can I get my server ready for the transformation from a physical server to a virtual server?
Many people don’t know how to prepare for a P2V – or even that you have to get the source server ready for a P2V. I have seen so many people running a converted server in a virtualised world, without doing anything to get it ready for becoming a virtual machine.
Is there a difference between a virtual machine and a physical machine? The main difference between a virtual machine and a physical machine (as far as Windows knows) is down to the hardware – the virtual hardware.
When you perform a P2V (that is, physical to virtual conversion) with a tool such as VMware Converter, there are additional steps that you need to do before and after the conversion to ensure that your new virtual machine is running well. The task to convert an operating system instance (in this example, Windows) will copy all the data to a new virtual machine – including installed hardware drivers and tools. This little guide will tell you what needs to be done to prepare the source machine for conversion to a VM.
I’ve broken it down into two main sections – preparation to ensure that the source is clean and less data needs to be transferred, and post-transfer tasks that will further remove items that are not required when the server is virtual, such as hardware tools, devices and drivers.
First, you might want to read some background on the basics of virtualisation to understand why you need to do this.
- Ensure that a full backup has been completed of the source physical server
- Log in to the source server through remote desktop to cache your current password
- Ensure that the local administrator password is known or reset on the source server
- Clean up local disks on the source server
That fourth step can be broken down into with further steps;
Cleaning up the source
You don’t want to have a new virtual server that is full of rubbish you don’t need, do you? Reducing the amount of data on the source server will also reduce the time it takes to convert, and lower the risk of transfer failures.
- Delete any files that are not necessary – old versions of files, copies of installation CDs, memory dumps, user profiles, Windows Update uninstall files
- Uninstall any applications or tools that are not needed, particularly if the server has evolved and there is software installed that is no longer necessary for the new virtual server
- Download and run SDelete from Microsoft to zero-out spaces on the disk where data has been deleted, but blocks are still in use.
Using the SDelete utility from Microsoft
Microsoft bought a company called SysInternals, and one of the many tools that they created was SDelete. This is a little command line tool that will securely delete files so that there is nothing left. Normally, when Windows deletes a file, it does not actually purge all the data from the disk, instead it just marks the block(s) where the data originally resided as being free, so that future disk writes can use the space. When you use a tool such as VMware converter, it will perform a block transfer that will include the blocks that have been deleted but not purged. This can take some time to send data that has been deleted!
To use the tool, download it from Microsoft, then I like to copy it to a location on the source computer that is in the path (like c:\windows\system32) and then run the following command
sdelete /c /z c:
This will ‘clear’ free space from C: and ‘zap’ empty blocks. Warning: this consumes a lot of disk I/O (because it is accessing every block on the disk) and can interfere with normal operations of a production server; I recommend performing this out of hours, and after a backup.
Do this on all your data disks too, and it will clean up all the data blocks that you deleted files from. I also like to do a defrag after sdelete and then repeat sdelete again – but that’s just the way I am!
defrag /c /h /u /x /l /k
Starting the P2v conversion
When you use VMware Converter, you might want to ensure that data is not changing, and that users are not connected to the system. You can do this by any of the below methods;
- Scheduling the conversion for out of hours
- Stopping services in the source machine manually
- Using VMware Converter to stop services for you
- Versions 5 and above of VMware Converter will synchronise any data that has changed during the time it took to convert the machine.
Choices during the setup of conversion
During the P2V process with VMware Converter, you can make changes to the sizing of the destination VM. This is the perfect opportunity to reduce the size of the new VM – it’s much easier to do it now, than it would be to power down the new VM and reduce it’s size later. I recommend that you consider the following;
- Reduce the number of CPUs and/or CPU cores. Make it 2 and then increase it later with CPU Hot Plug
- Reduce the RAM to 2GB. Then increase it later with Memory Hot Plug
- Reduce the C drive so that it is the consumed space + 10%. You may want to factor Pagefile space that is no longer on the C drive.
- You can choose to stop services, mark services as disabled (for next boot), and ignore disks to convert.