VMware: Failed to get disk partition information in vSphere


image

Today I wanted to add a new iSCSI Lun to my vSphere Lab. I got the following error:

image

I had this error in the past, see my previous post: vmware-failed-to-get-disk-partition-information. I tried the solution described in my previous post but it didn’t  work in vSphere.

So I had to search for another solution. Luckily VMware released a KB document. See KB1008886. In this KB document VMware uses the command esxcfg-vmhbadevs. This command is replaced with a new command called esxcfg-scsidevs.

So I ran the esxcfg-scsidevs command on the service console:

image

After running the command, write down the following line: Console Device: /dev/sdc. Start Parted and walk through the following steps.

Note: don’t forget to change the /dev/sdb to the device you need to fix. In my case /dev/sdc.

To change the label and partitioning scheme:

Caution: This removes the pre-existing partition table, and any data on the volume is no longer be available. Ensure you are operating against the correct disk.

  1. Start parted to analyze the existing partition. Print the existing partition information, taking note of the Partition Table, size, and name. Ensure this is the data intended to be removed.
    Run the following commands:
    [root@esx ~]# parted /dev/sdb
    GNU Parted 1.8.1
    Using /dev/sdb
    Welcome to GNU Parted! Type ‘help’ to view a list of commands.
    (parted) print
    Disk geometry for /dev/sdb: 0.000-512.000 megabytes
    Disk label type: gpt
    Number  Start   End    Size   File system  Name                          Flags 
    1      17.4kB  134MB  134MB               Microsoft reserved partition  msftres
  2. Change the partition table (disklabel) type to msdos. This deletes the pre-existing partitions. Print the partition table again to observe the changes. Quit parted.
    Run the following commands:
    (parted) mklabel msdos
    (parted) print
    Disk geometry for /dev/sdb: 0.000-512.000 megabytes
    Disk label type: msdos
    Minor    Start       End     Type      Filesystem  Flags
    (parted) quit
  3. Return to the VI Client and use the Add Storage wizard again. Choose the same LUN, create a new partition, and format it with a VMFS Datastore as normal.

Source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1008886

Advertisements

6 thoughts on “VMware: Failed to get disk partition information in vSphere

  1. Paul

    Thanks a lot. This command saved my life. Do you know how to do it in Esxi 4.0 ? It seems quite different.

    Best regards

    Paul

    Reply
    1. Um...Stuff...

      Something to keep in mind with regards to this error, this is a very vague error and from my experience I had two issues that were throwing the same error. One, check the block size of your drive, apparently VMware doesn’t support block sizes above 512B. The other problem I had was I was trying to add a 4TB ISCSI drive from my SAN and VMware doesn’t support drives larger than 2TB, at least in the version I’m running.

      ESXi 4.0
      CPU: 4 x 2.009GHz
      RAM: 12GB
      Using a SAN that has hardware on their HCL.

      This is my home setup so it may not be the same as others, and it’s not really in a production environment, that is my disclaimer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s