Pages

Monday, December 13, 2010

Changing a virtual machine’s boot hard disk to a different SCSI controller

As some of you may remember, I ran into an issue a while ago when I was deploying VMware View 4.5 for customer demos. The problem I had was that the View Transfer Server required a virtual machine that had a LSI Logic Parallel SCSI adapter but the default for deploying virtual machines in vSphere was always LSI SAS (http://terenceluk.blogspot.com/2010/10/gotcha-vmware-view-transfer-servers.html). As I was in a rush to get the environment up, I simply went ahead and deployed a new virtual machine with the correct SCSI adapter but added an item on my “to-do” list to try changing the adapter in the future. I finally got some time over the weekend to test this out and after doing a bit of searching on the internet, it looks like VMware actually has a public KB for this here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002149. What I’ve noticed was that the KB omits a few steps that you should take so I thought I’d write a post about this with screenshots.


Problem


You need to change the SCSI controller for your virtual machine’s boot drive but when you try doing so, you get a blue screen during bootup:


image


image


image


This probably isn’t a surprise to the seasoned Windows administrators out there as we all know what happens if we take a full system backup and restore it to a server with different hardware.


Solution


As I noted earlier, VMware actually has a public KB that lists the steps for how you can change this. However, it doesn’t mention about BIOS changes that you may need to do in case your virtual machine doesn’t boot so here are the complete steps you’ll need to take:


Shutdown the virtual machine and open up the settings with the Edit Settings option for the virtual machine:


image


Click on the Add button and proceed with adding a new hard drive:


image


image


image


The following step is important because in order for a new SCSI controller to be created, you’ll need to select a Virtual Device Node with a number that you currently don’t have a hard disk attached to. If you only have 1 hard disk for your virtual machine, it will almost always be sitting on SCSI (0:0) but make sure you check. For this example, I used SCSI (1:0):


image


Complete the wizard with the new hard disk and new SCSI controller:


image


Notice that the new SCSI controller defaulted to the same type as the one you already had so change that to the type that you want. In this example, I changed it to LSI Logic Parallel:


image


image


image


Once you’ve completed the configuration, you may notice that your virtual machine no longer boots into the operating system:


image


The reason for this is because when you add a new hard disk with a new SCSI controller whether it’s the same type as the first SCSI controller you had or not, the boot order will most likely change. To fix this, simply reset the virtual machine and go into the BIOS via F2:


image


Navigate to the Boot section in the BIOS, expand the Hard Drive list and you’ll now see the boot order of devices:

image

You will now immediately notice that the boot order has Bootable Add-in Cards and the new hard drive on SCSI (1:0) on the top (priority is top to bottom) which would explain why you’re not able to boot into the OS anymore. All you need to do now is to use the + and - buttons to change the priority of the devices you can boot from:


image


Once you’ve changed the boot order, save the changes and reboot:

image

With the devices in the proper boot order, you’ll be able to get back into the OS now:


image


Log into the OS to verify that it actually see’s the new drive in the Disk Management display:


image


image


Shutdown the VM:


image


With the drives automatically installed when you booted up Windows, you can now proceed with changing the SCSI controller type of your boot drive:


image
image


image


Once you’ve completed the change, you’ll notice that you may run into the issue earlier where your BIOS has the ordering of the boot device wrong so refer to the steps earlier in this post to fix the priority:


image


image


Once you’ve fixed the boot order, you will now be able to boot into the operating system:


image


Not that you had to wait till you’ve successfully booted into the OS before you remove the old drive but I went ahead to do it after:


image


image


image


… and we’re done! Sure beats reinstalling the operating system.

11 comments:

sillybird76 said...

perfect solution, thanks!

Chris said...

Thanks you Saved me so much time!!!!

Anonymous said...

You, sir, are a Rock Star!

Anonymous said...

Thank you brother ! You saved the day.

Anonymous said...

Thanks for the post. Very appreciated :)

Lou V. said...

This works perfectly in ESXi 5 - great, great post!

A sanity saver indeed!

Marc C. said...

Awesome. You saved me a full windows re-install for my View transfer server. thank you very much!

.AT brain said...

Works fine, but to do faster, just run: sysprep !
Go to: C:/Windows/System32/sysprep/
and run the "sysprep" app.
Select: Out-of-Box-Experience and "Generalize". Choose "Shutdown and start the app.
Now after VM is down, you can change the controller and power on. Follow the menu and your OS will start...

greetings from .AT .

Anonymous said...

Hello from Boston - this was a huge help. Thank you very much! :)

Shailesh Mehta said...

Good solution for the boot disk failure issue. Most of the times it may be hard disk issue or sometimes even loose connection can cause boot disk failure problem. Keep writing more on other topics also.

Paul Xu said...

Thanks for the perfect solution. For me it has a bit different setup: I am using linux, and have multiple scsi controllers. All controllers are already PVSCSI except scsi0 and they worked well. However, when I changed scsi0 to PVSCSI, it no longer boots and can't find boot disk. BIOS boot order was the issue. Moved the scsi0:0 to first in boot order and solved the problem!