Thursday, 28 April 2011

Migrating a Win SBS 2003 server into VMware

Last weekend I had the joy of migrating our main domain controller (Windows Server 2003) from its own physical server to a virtual server running on VMWare (ESXi 4.1U1).  Overall it went very smoothly with just a few issues.  It was a long process though.  I started it Saturday mid afternoon, came in Sunday morning to find it had got confused as time on ESXi host was wrong (Windows needs activation NOW, no network, installation ID not displayed and MS tech support don't work on Sundays).  Fixed the time on host and restarted it.  Came in Monday (bank holiday luckily) and finished the install without further issues.  These are the steps I took:
  1. Firstly uninstall everything you don't need any more, delete all temporary files, empty the recycle bin and move any file shares off the machine for now (Transfer rates for the convertor were about 5MB/s on decent hardware with a gigabit switch - far faster to move files out, then convert, then move files back in)
  2. Defrag the hdd (generally a good idea and should make things faster)
  3. Turn the machine off and boot from a VMware Convertor CD
  4. At this point I blocked all emails at our firewall so that if I was not happy at any point I would not have any emails delivered to the wrong machine.
  5. Leave whatever networks it detects alone - far better to clean up unneeded interfaces after teh clone than to delete one that was actually in use
  6. For best speed do not change the size of partitions
  7. Unselect any recovery/maintenance partitions - they will be irrelevant ont eh virtual hardware anyway
  8. Tick install VMWare tools - its needed for lots of virtual hardware drivers so you want to install it early
  9. Run the convert
  10. Go home for the night (Seriously, my convert took about 17 hours)
  11. Before turning the machine back on check the hardware settings
  12. Change the SCSI card type from Bus Logic to LSI Logic - significantly faster
  13. Create a Snapshot
  14. Turn on the virtual machine, log in as the domain administrator user not just a member of the domain administrators group*, let it find drivers for everything it detects on boot, let it install VMWare tools and then when you are happy its finished reboot
  15. Repeat point 12 if required
  16. Open a command prompt window and enter these two lines:
  17. set DEVMGR_SHOW_NONPRESENT_DEVICES=1 devmgmt.msc
  18. In the device manager select "Show hidden devices" then go through and delete all the greyed out devices (yes all of them, there might be a LOT - it took me about 20 minutes).  They will not be used again but if you leave them there they will still load the drivers on boot and might have unintended consequences 
  19. Note that if you use static IP addresses then the missing network adaptor will still have it assigned - you need to remove the device (as described inpoint 16) before you will be able to assign the IP address to a VMware virtual network adaptor and get the network working.
  20. Reboot and check you are happy with all the file shares, test incomming and outgoing emails (after re-enabling emails through the firewall if you disabled it) etc
  21. Activate windows
Congratulations, you now have your server running in VMWare.  Hopefully none of your users will notice anything different (or will notice an improvement - but they never seem to mention that). 

    * Some things have gone wrong unless logged in as user "administrator" for example activation does not generate its identifier so it is not possible to activate.  Your experiences might differ but my gut feeling is that for fundamental setup the actual administrator has fewer problems than a member of the domain admins group.  For normal maintenance, windows updates, software install I just use my main account.

    Wednesday, 27 April 2011

    So long TiddlyWiki

    I was using the excellent TiddlyWiki for this blog. I have actually stared to get my own site appearing in my searches quite a bit recently. Due to the way TiddlyWiki works (just a single HTML file with DIV's to show/hide posts) the search engines see it has specific key words but when you follow the link you get the intro page. I'm going to migrate all my old posts over to Blogger (manually - yay!) over the next few days.... Update 28th April: Finished!  45 posts moved over, several ignored or merged as they were not valuble enough to save.  I corrected a few typo's during the transfer however I left the content as it was written. 

    I'll keep using TiddlyWiki as a personal notebook for various projects, it is an excellent tool.  Unfortunately it does not quite cut it as a blog (but that was never its intention anyway).  Onwards and upwards - it will be interesting to see how many hits this site actually gets, something I could not track when using TiddlyWiki.  My main reason to write this blog is to keep a note of things I learn for myself, and explaining them helps me understand them better.  If anyone finds these random notes useful then its an added bonus.  If this site becomes popular I reserve the right to change my morals and plaster it with adverts...   :)

    Monday, 18 April 2011

    VMware Tools install on Redhat / CentOS 5.5

    From ESXi 4.1 onwards VMWare is no longer providing an "install vmare tools" option that includes rpm installers for RedHat or dirivatives. The alternative they are pushing people towards is using the package management system built into the Linux distribution. This has several advantages (eg updates might actually get applied outside of server upgrades) but also involves jumping through a few more hoops to get it going and means you manually need to change the package source if upgradeing the ESXi host.

    These are the steps I took to get this working.