Slumdog Virtualization: How to Start Building Virtual Infrastructure Without a Bean
April 2009, Author : Lee Wynne.
Introduction
It has been a while since I have posted anything, been busy as hell trying to finish a French renovation project. This recession is proving to be a right pain in the rear isn't it? Budgets being slashed left right and center, projects on hold whilst the uncertainty continues, what a nightmare... So what can you do with no budget? Answer? Virtualize without spending a penny, and here is how to get started.
I suggest that you test the following process on a development machine before you do it for real. This is meant as a guide only and I accept no responsibility if it anything goes wrong.
First of All : Citrix XenServer or VMware ESX?
How much has this question been asked recently? Maybe it has been over analysed, driven by marketing promotions which I guess is to be accepted within such an open market. I personally feel that the simple approach is to go back to basics and do what you have always done when deciding which technology suites the client best, which is to build a prototype which meets the client requirements (through good qualification) and then compare them. I mean how would you know how each solution would really perform without testing individual performance of the VM's in question?
So why am I choosing VMware ESXi for this article? Well simple really... number one reason is that I have lack of knowledge of Citrix XenServer, not because I do not like the product, I just haven't had the opportunities to design and implement like I have with ESX. So I am leaving this open, if you can do everything that I am about to describe below with XenServer then add some comments and lets discuss as I would love to learn more. I guess another reason is hardware support, ESX will install on 32bit hardware (which is ideal for this article) XenServer will not which sort of blows the whole 'Slumdog' concept out of the water.
Also, please correct me if I am wrong here but if I start to build clusters of Citrix XenServers today and configure them for high availability then what are the chances of adding to that cluster in a years time when the CPU architecture has changed? I am talking about 'paravirtualisation' here versus 'full virtualisation'. When I need to start growing my XenServer infrastructure with new hardware do I need to keep purchasing server clusters based on the same spec hardware again or not? If so that wouldn't be cost effective or good capacity management would it? With ESX I at least have a chance of adding to a cluster of ESX servers a year down the line without bringing a second cluster of servers online to support HA (I know I will get a warning when vmotioning servers but 99.9% of the time it works..). Again I am not an expert of XenServer so please discuss below if I am way of the mark here.
Slumdog Virtualization:
Step 1 : Pick an existing server, one that you know is under utilised but fairly well spec'd.
We are looking for a server here with 6GB of RAM +, with good internal storage facilities (but with lots of unusedGB's), more than one NIC hopefully at 1GB, like a HP DL380 or something, it doesnt matter if it is 32bit. Ideally this server should be under utilised by 70 - 80% throughout the year.
What we are trying to achieve here is virualization of the current host OS, we then dump that on a file server and then turn this machine into an ESXi server, once that is complete we then migrate the original virtualized OS back onto the server but as a hosted virtual machine. This approach will give you capacity to virtualize and migrated more of your 'low hanging fruit' over to your new ESXi server and then maybe turn residual hardware into ESXi servers until you have maybe 4 x ESXi servers or more which may give you capacity for much more virtual machines, maybe 20 -25 or even more depending how 'slumdog' your hardware is.
Obviously you will want to make sure your candidate server is on the VMware ESXi hardware compatibility list : http://www.vmware.com/resources/compatibility/search.php?action=base&deviceCategory=server
Step 2: Download your server virtualisation toolkit
We are going to need to following software from VMware's website
- VMware ESXi : https://www.vmware.com/tryvmware/?p=esxi
- VMware Converter Enterprise Evaluation (we need to cold clone boot disk in ISO format) : http://www.vmware.com/downloads/download.do?downloadGroup=CONVERTER3
- VMware Converter StandAlone (free version) same link as above
- Some form of imaging software, if you don't have any they consider using ghost.exe with the BartPE boot CD : http://www.nu2.nu/pebuilder/
You will need to register to download the above software, you will receive a free license for ESXi which we will use later.
Step 3 : Arrange downtime for the candidate server from Step 1.
Depending on the size of this disks, you are going to convert this machine to be a virtualised format and then import it into ESXi so better go with 6 hours downtime, just to be safe
Step 4 : Get your VMware media ready.
- Burn the ESXi Install disk to ISO format
- Extract the 'COLDCLONE.iso' file from the VMware Converter Enterprise software and burn it to disk.
Step 5 : Set up a network share
We are going to dump the converted virtual machine onto a network share and re-import it into ESXi from there. Ideally we are also going to take a raw ghost image of the server incase it all goes pear shaped and you need to restore it.
- Create an NTFS share on a candidate Windows file server
- Ensure you have enough capacity on the network share to host the converted virtual machine
- Setup some NTFS permissions to ensure it is secure.
Step 6 : Take an full network backup of the physical machine
Using your existing network backup software (such as backupexec) take a full network backup of the candidate physical machine and verify it. (again a get out of jail free card)
Step 7 : Take a full Ghost image of the physical machine using Bart PE or any other preferred disk level backup software
If things do go pear shaped and you want to restore the server back to its original state then this is the quickest and cheapest option, if you do not have any tools to do this then consider using the BART PE Boot Disk :
Step 8: Convert the candidate physical machine to a virtual machine
Here we go, remember what we are actually doing here, we want to convert the existing OS to a virtual format and store it on an NTFS network share. Then we are going to install ESXi on this server and re-import the original OS as a virtual machine with scaled down resource allocations. This will then open up the server to host more virtual machine candidates that you may have on your existing network.
- Shutdown the candidate physical machine and insert the COLDBOOT.ISO CD disk (extracted from the VMware Converter software)
- Ensure that the machine is set to boot from the CDrom drive
- Boot up the candidate machine and the converter will install the WinPE based drivers in preparation for mounting the local disk and network
- Accept the License Agreement
- Choose Yes to update the network parameters, ensure that you can obtain an IP address or specifiy and IP address to get the converter on the network
- On the Network Drives tab, map a drive to the Network Share you set up previously, enter the credentials and once the drive is mapped, hit OK.
- The VM converter screen will now be displayed, hit the 'convert machine' button and the the conversion wizard will start
- Hit Next and for the source choose next and the local disks are displayed ready for virtualization
- Choose to reduce the disk sizes as you do not want to use up all the disk space on the ESXi server), hit next
- For destination hit Next and choose 'Other Virtual Machine'
- In the Name Section give it the exact host name it had previously with no spaces or caps
- In the Location section select browse and select the network drive that you connected to in step 6.
- In the Type of Virtual Machine to Create section select Workstation 6.x, VMware Fusion 1.x, Player 2.x, ACE 2.x. This will ensure that we can dump it onto a network share and convert it back to ESX format later.
- In the Disk Allocation option choose Allocate all disk space now for better performance and hit next
- In the Networks section select all default and hit next as these will change when we convert back to ESX
- For the Customization section do not select any options and hit
You will now receive a summary of the conversion, hit Finish and away it goes. Conversion may take a while depending on network speed and disk size of the target operating system.
Step 9 : Install ESXi on the physical machine
OK, once the conversion process has successfully completed, now it is time to wipe the physical machine and install ESXi on it.
- Insert the VMware ESXi CD and boot the machine up
- Follow this nice handy guide for installing ESXi here : http://www.petri.co.il/how-do-you-install-vmware-esx-server-3i-esxi.htm
- Once you have installed ESXi successfully, on your laptop or desktop machine, open a browser and type in the URL of the ESXI server eg: https://<IPADDRESS>
- Choose to download and install the Virtual Infrastructure Client
- Once it has installed launch it and login with root user ID and password
- Select the ESXi server and on the right, choose the 'configuration' tab
- Select the Licensed Features option and enter the license number that you would have received when registering for ESXi
- Select the Time Configuration option and enter the name of a local NTP server for sync and then start the NTP service
- Select DNS and routing and ensure all the attributes are correct
- ESXi will not register itself automatically in DNS, you will have to create an host record manually.
Step 10 : Port your original physical server (now a virtual ,machine) over to the ESXi server
OK at this stage I am going to assume that you have a spare XP desktop machine on your network, or laptop to install the free VMware converter. Follow this simple article on how to install the free VMware converter
http://www.petri.co.il/virtual_convert_physical_machines_to_virtual_machines_with_vmware_converter.htm
Now that you have installed the VMware convertor software you will need to move the virtual machine (currently on your network share) over to your new ESXi server.
- Launch the VM converter software
- Hit the Convert Machine button
- Hit next at the Wizard screen and then for the source browse to the network share were your recently converted virtual machine is (from step 9) it will be located in a subfolder.
- Browse to the <vmname>.vmx file and select Next
- Choose to convert all disks and retain size (you should have reduced the size already during the initial conversion process)
- For the Destination select next and then choose VMware Infrastructure Virtual Machine
- At the Destination Logon Screen type in the IP address of your new ESXi server and the root username and password and hit Next
- For the VM Name option, enter the hostname of the virtual machine with no spaces or caps and hit Next
- At the Host option, Select your ESXi server and hit Next
- At the Datastore location select the default VMFS partition and hit Next
- At the Network selection ensure that NIC 1 is connected to VM Network and that 'connect on power on' is unchecked
- At the Customization option, select the Install VMWare Tools option and hit Next
- You will now be displayed with the ready to complete screen, ensure that the tick box for power on this machine is de-selected and hit next
At this stage the virtual machine format will be converted to ESX and the virtual machine will be copied over to the ESX servers datastore.
Step 11 : Make the required virtual Machine post conversion changes
Once the machine has been migrated over, launch the Virtual Infrastructure Client and select the Virtual Machine, right client and open up the virtual machine settings:
1. Change the memory allocation to something more realistic
2. Drop the CPU down to 1 vCPU (if applicable)
3. Remove any unwanted hardware such as serial or parallel ports
4. Ensure any nics are net to disconnect (and ensure that there is only one)
Boot Up the virtual machine and then complete the following steps
- Log on locally and install VM tools and reboot.
- Open up device manager, select 'Computer' and then right click 'ACPI Multi Processor PC' choose 'update driver' select 'no' to windows update, choose 'install from a specific location', select 'dont search, i will select the driver to install, select the ACPI Uniprocessor option, once complete reboot the server.
- Log on locally and create the following batch file, save it and then launch it (this will give you a better view of legacy hardware still resident):
=========================
@echo off
cls
set devmgr_show_nonpresent_devices=1
start devmgmt.msc
===========================
4. Browse device manager removing any old and unwanted hardware (including old nics and disk drives etc).
5. Open up add remove programs and de-install anything to do with the local hardware such as management agents and device drivers and VNC software
6. Open network connections and re-assign all the IP parameters, reboot the server.
Step 12 : Verifiy the server is operational
Ensure that the VM is connected to the default VM network switch at power on and that is can communicate with other devices on the network.
Step 13 : Post ESXi changes
You will want to make sure that if for some reason your ESX server is shutdown or rebooted your Virtual Machine will start up automatically.
- On your laptop or desktop machine, open a browser and type in the URL of the ESXI server https://<IPADDRESS>
- Choose to download and install the Virtual Infrastructure Client
- Once it has installed launch it and login with root user ID and password
- Select the ESXi server and on the right, choose the 'configuration' tab
- Now on the left select 'virtual machine startup/shutdown' and then choose properties located at the top right
- Under system settings, select the checkbox 'allow virtual machines to start and stop automatically with the system'
- In the start up order, move your virtual machine up to the 'automatic startup' section and click OK
That's it, the end. I hope that you found this article useful. In Part 2, we will discuss how to take an automated disk level backup of each virtual machine for rapid disaster recovery with the same Slumdog theme (ie No Budget).
Lee Wynne
Senior Citrix and VMware Engineer.
VMware VCP, Citrix CCA, Microsoft MCSE
Hire me here : http://www.applicationdelivery.co.uk or http://www.linkedin.com/in/leewynne
Article Tags