Home > VMware, Windows XP > vSphere convert VM IDE disk to SCSI disk

vSphere convert VM IDE disk to SCSI disk

I recently read a post by Duncan Epping over at Yellow Bricks where he tried to resize the VMDK of a Windows XP VM running on ESX\vSphere. When he used the VI Client to try and resize the VMDK he was actually unable to because it was ghosted out. By coincidence I had experienced the same problem a week before Duncan after building 5 Windows XP VMs for stress testing of a new SharePoint website. As Duncan mentioned, the only other time I had seen this happen was when a snapshot existed for the disk that needed to be resized. Quickly checking the VM's settings I noticed that by default, when you create a Virtual Machine using the 'Microsoft Windows XP Professional..." Guest Operating System container it actually attaches an IDE disk rather than a SCSI disk (Server 2003 and 2008 Guest Operating System containers use a SCSI disk by default.)

Here are the default devices for the Windows XP Professional VM:

idetoscsi1.png

Since I had built the 5 Windows XP VMs from a template I had created, I decided to find a way to convert the IDE disk to a SCSI disk and update the template incase I needed to resize the OS disk in the future. The easiest way I found to do this was as follows:-

Firstly I made the following assumptions:

  • I would need to add a SCSI Controller to the VM and install the drivers before booting from the VMDK (I have seen cases before where moving a HD to new hardware caused a BSOD)
  • If possible I would need to change the default Controller used for new VMDKs from IDE to SCSI
  • I wanted to use the LSI Logic SCSI Controller
  • I wanted to make the VMDK the first SCSI device (0:0) attached to the Controller

So, with the VM powered OFF I edited the settings for it through the VI Client and added a new SCSI Device (by default it doesn't seem possible to simply add a SCSI Controller to a VM without also attaching a SCSI Device to it):

idetoscsi2.png

I left the SCSI Device as being a CDROM and (optionally) changed the Virtual Device Node to SCSI (0:1) so that when I converted the existing disk and added it to the SCSI Controller it would be device SCSI (0:0). I clicked Next and Finish but I didn't click OK to commit the changes:

idetoscsi3.png

Before clicking OK, I selected the SCSI Controller and changed it's type as appropriate. Then I clicked OK to commit the changes to the VM:

idetoscsi4.png

I powered on the VM and noticed that the Windows Found New Hardware Wizard prompted me to install the driver for the SCSI controller. I knew that the controller used is a LSI20320-R so I downloaded it from here:

LSI20320-R - Driver Download (Click the Support and Downloads tab)

I downloaded the appropriate driver and extracted it (for Windows XP 32bit I used LSI20320-R_xp_50700_01034132IT_1201800_1005239.zip and within that symmpi_wXP_1201800.zip.) Then I used the Found New Hardware Wizard to browse for and install the driver. Once the hardware installation completed I shut down the VM. The VM now had the SCSI controller installed and I was confident I would be able to boot from it.

I then located the datastore where the VM resides. For example:

/vmfs/volumes/<datastore>/<vm>/

You can use the Service Console or an SSH\SCP application to open the <vm>.vmdk (not the <vm>-flat.vmdk). I edited the following line:

ddb.adapterType = "ide"

For the LSI SCSI Controller I changed it to:

ddb.adapterType = "lsilogic"

After saving the file I used the VI Client to edit the VM settings. I selected the IDE disk and removed it. I then clicked OK to commit the changes.

NOTE: Remember to only 'Remove from virtual machine' and NOT 'Remove from virtual machine and delete files from disk':

idetoscsi5.png

Then I used the VI Client to edit the VM settings again and add the disk back. This time, because I had edited the .vmdk file to specify that the disk uses the LSI Logic Controller, it attaches the disk to this instead of the IDE Controller used previously:

idetoscsi6.png

idetoscsi7.png

The disk is added as device SCSI (0:0):

idetoscsi8.png

I clicked Next and Finish to complete adding the disk. I then selected the CDROM (SCSI device 1) and removed it:

idetoscsi9.png

I clicked OK to commit the changes to the VM. I now had a VM using the LSI Logic SCSI Controller with the System OS disk connected to the Controller as device SCSI (0:0).

Since the VM had already booted with the LSI Logic Controller installed, when I powered on the VM Windows booted normally and was immediately accessible. Subsequently, any new virtual disks created for the VM are automatically created as SCSI disks and attached using the next available Virtual Device Node.

Categories: VMware, Windows XP Tags: , , ,
  1. nico
    June 17th, 2010 at 13:20 | #1

    Thanks,

    Very usefull post!

  2. Oded
    June 18th, 2010 at 00:16 | #2

    Thank you so much, had the same exact issue

  3. July 29th, 2010 at 08:26 | #3

    Hmm,

    I have a similiar issue (vi client edit disk size greyed out); but the controller is already a scsi. I can resize other machines no problem - and they're all configured the same.

  4. James Clements
    July 29th, 2010 at 11:10 | #4

    Hi Craig,

    You cannot resize a disk if it has snapshots. These must be deleted (committed) before you can adjust the size of a vmdk.

  5. July 29th, 2010 at 11:23 | #5

    @James Clements
    Hi,

    Should have mentioned, there are no snapshots on this server.

  6. James Clements
    July 29th, 2010 at 16:51 | #6

    Hi Craig,

    The only other time I have seen the issue you are having is when a snapshot does still exist but cannot be seen in the VI client. It could be worth checking your datastore for the existence of a snapshot for the VM. I saw this a few times in ESX 3.5 but havent seen it in vSphere yet.

  7. eric
    September 8th, 2010 at 21:18 | #7

    thanks ! great work on this. helped me out a lot !

  8. Jirah
    January 13th, 2011 at 17:19 | #8

    James, thanks for this great write up. I needed to reference it today. It's weird that ESX defaults to IDE on XP VMs.

    Thanks!

  9. Clint Priest
    February 19th, 2011 at 00:05 | #9

    You can also issue a vmkfstools -X from the vSphere Management Assistant without going through all of those steps.

  10. Rob Dennis
    May 1st, 2011 at 04:06 | #10

    I followed all these instructions but I wasn't able to boot to the SCSI drive. As a test, I replaced the vmdk with one that was from a working machine and it booted. Does anyone have any idea what could be difference between two vmdk files that would allow one to boot and the other not to. The one the didn't boot was converted from an IDE vmdk and the second one was built as an SCSI vmdk, but other than that they were identical.

  11. rich
    July 7th, 2011 at 10:59 | #11

    thanks ! just the info I was after. Well explained - ka pai.

  12. brian
    July 19th, 2011 at 04:11 | #12

    Hi,
    nice work. on vmware server 2.02, I couldnt edit the .vmdk file, when I reattached it complained about geometry and disk being an IDE disk, but an encouraging slap to the head and she booted up just fine. The
    vmware server also I had to add the line to .vmx "scsi0.virtualDev = "lsilogic" " cause it wasnt an option to do it via gui.

    i have a win7 32bit client fwiw.

  13. Bernie
    December 6th, 2011 at 22:03 | #13

    Im new to vmware and have been tasked with doing exactly this so if someone could walk me through what all this means:

    *You can use the "Service Console or an SSH\SCP...." what is this?

  14. Chris
    April 30th, 2012 at 11:52 | #14

    SSH\SSC - check out WinSCP application (google it) - simply put a secure method for transferring file by tunneling through SSH.

    BTW - this approach to updating the SCSI drive is excellent. Well written, simple to understand, and (for me at least) has worked as expected. Many thanks JJ

  15. Anders
    May 30th, 2012 at 08:52 | #15

    Hi,

    This was a great idea, however I wasn't successfully able to boot the Win 2008 Server (not R2) OS using this method, running the host on ESXi 5.0

    But I used the same idea of changing the disk type from IDE to SCSI. Then I was allowed to increase the size of the disk from 20 GB to 40 GB. As mentioned the OS wouldn't boot then, but I just did the same steps again, and reverted the disk back to IDE, and then it booted perfectly as before and I just had to increase the volume in Windows to utilize the full 40 GB disk.

    Thanks for the tip!

    -Anders

  16. July 16th, 2012 at 10:46 | #16

    Hi, I had the same problem while converting an XP virtual machine from VMWare Player 4.x to ESXi5, and you detailed explanation helped me a lot.
    I would be happy to write down the same informations but in Italian, which is my language (I write from Bologna, Italy).
    Can I reuse your images and copy them into my site? It would be very easy fro me not to have to redo the whole process only to make screenshots.

    Thanks however for your explanation.

    Kind Regards,
    Claudio Bassi
    Bologna, Italy

  17. David
    July 27th, 2012 at 10:54 | #17

    This is one AWESOME tip.
    Thanks a LOT. It really helped me out

  18. Danny
    August 9th, 2012 at 21:50 | #18

    Hi,

    Had the same problem with ESXi 4

    Added a second drive (SCIS 30GB) to my VM
    Booted Windows VM and formated the drive as D:
    Installed Acronis True Image Home on the Windows VM, did a HD Clone from IDE (C:) to SCSI (D:)
    Shut down Windows Vm
    Deleted IDE Drive
    Rebooted VM. Voila.

  19. Larry Pytlak
    August 15th, 2012 at 20:12 | #19

    Excellent procedure and well documented. The procedure on VMware was not illistrated as your is which makes a big difference!

    Thank you

  20. pierre
    December 6th, 2012 at 09:02 | #20

    Thank you for the procedure.
    I ran a VtoV with the VM offline, and changed the destination size. It works as well.

  21. joensw
    February 13th, 2013 at 14:35 | #21

    thank you
    very usefull

  22. June 26th, 2013 at 05:32 | #22

    Hi James,

    nice work and well documented. Thanks for sharing this !

    best regards
    Hardy

  23. DP
    July 16th, 2013 at 20:49 | #23

    Great job!
    Easy to follow.

  24. Sean
    August 14th, 2013 at 23:05 | #24

    Thank you so much. This helped a lot. Screenshots were especially useful

  25. September 6th, 2013 at 08:00 | #25

    Still works perfectly, thanks!

  26. Nathan
    December 5th, 2013 at 17:05 | #26

    Thanks so much for this. YOU ROCK

  27. March 3rd, 2014 at 15:29 | #27

    This worked for me! Thanks.

  28. Rich_Bcn
    March 11th, 2014 at 16:16 | #28

    Fantastic blog, worked first time

  29. June 21st, 2014 at 17:53 | #29

    Thanks for a very helpful article Clem! A little extra tidbit: for those using cheap white boxes with ESXi for fun, if you do not have a SCSI CD drive on the host ESXi host the the Add Hardware "SCIS Device" may be greyed out as "SCSI Device (unavailable)" with the Information "This device cannot be added to this Virtual machine because: There are no non-disk SCSI devices available on this host". Simply add a new "Hard Disk" instead, "Creating a new virtual disk" setting "Virtual Device Node" to "SCSI (0:1)" in place of using the CDROM as Clem did.

*