HOW TO: Fix An error has occurred adding datastores to an ESXi 5.x host

Published on
27,363 Points
6 Endorsements
Last Modified:
Andrew Hancock (VMware vExpert / EE Fellow)
MVE^2, Expert of the Year 2017-2011, Scribe 2016-2012, Author of the Year 2018-6,2013-2012 VMware vExpert 2019-2011 30 years of experience.
In my previous Experts Exchange Articles, most have featured Basic and Intermediate VMware and Virtualisation Topics.

If you would like to read my Basic VMware articles,  they are listed at the end of the article for your convenience.

During this series of articles VMware released VMware vSphere 5.5 and VMware vSphere Hypervisor ESXi 5.5. These articles are also applicable to VMware vSphere Hypervisor ESXi 5.0 and 5.5. For consistency, I have used VMware vSphere Hypervisor ESXi 5.1 throughout this series.

I feel this is a little more advanced, so I've not included it in the Basic VMware article series, as it does require some basic Linux skills and command line usage.

Last week, whilst installing VMware vSphere Hypervisor ESXi 5.5 U2 I came across an issue, when trying to add a VMFS5 datastore to an ESXi 5.5 U2 server the following error message was displayed". 

Call "HostDatastoreSystem.QueryVmfsDatastoreCreateOptions" for object "datastoreSystem-xx" on vCenter Server "hostname" failed." 

and the datastore failed to be created. It surprised me that this issue still exists with VMware vSphere Hypervisor ESXi 5.5 U2.

Creating a new VMFS datastore is covered in Step 4 - Conducting a simple task using the VMware vSphere Client of this Article - Part 2: HOW TO: Connect to the VMware vSphere Hypervisor 5.1 (ESXi 5.1) using the vSphere Client

In this article we will show you HOW TO: Fix An error has occurred adding datastores to an ESXi 5.x host​. This method can be used with any version of the VMware vSphere Hypervisor from 5.0 to 5.5.

The issue is simply the VMware vSphere Hypervisor (ESXi), does not understand the existing information on the hard disk or storage array LUN. I've seen the issue when using existing left over disks from previous installations of Windows, Linux or Solaris, even after destroying the contents using the vendor array utilities.

1. Login remotely via SSH or at the console of the ESXi host server.

Login and connect to the VMware vSphere Host ESXi server which has access to the disks or LUN you are trying to create the new datastore on.

see my previous Experts Exchange article

2. Deleting the existing disk partitions

There are two methods to address this issue, remove all the individual partitions from the disk, or overwrite the standard partition table that the VMware vSphere Hypervisor (ESXi) can deal with. I'm going to use the last method, it's quicker and achieves the same goal. 

The supported partition utility in VMware vSphere Hypervisor ESXi 5.x, is called partedUtil.

the command to use is
partedUtil mklabel /dev/disks/<disk id> msdos

Open in new window

this command replaces the partition table on the disk, with a legacy msdos partition table, remember MS DOS? - ("Toto, I don't think we're in DOS anymore"). The legacy MS DOS partition table is a partition table, with which VMware vSphere Hypervisor (ESXi) can deal with, remove and create the VMFS5 datastore. PLEASE NOTE: this will ERASE ALL DATA on the disk specified, so it's important to specify the correct disk.

3. How do we find the correct disk?

At the console prompt type, the following this will show your disks or LUNs on your VMware vSphere Hypervisor (ESXi) host server.
ls -al /dev/disks

Open in new window

the above screenshot shows the disks attached to the VMware vSphere Hypervisor (ESXi), partitions are shown as :1, :2, :3, :4.

The "vml." listings are symbolic links to your disks, which start with mpx.vmhba:C0:XX:XX:XX:Y or they could be listed as "naa.".

4. Erasing the Partition

 Check you have identified the correct disk to delete. PLEASE NOTE: this will ERASE ALL DATA on the disk specified, so it's important to specify the correct disk.

In this tutorial I'm going to delete the partition on disk 

vml.0000000000766d686261313a333a30 -> mpx.vmhba1:C0:T3:L0
the  required is mpx.vmhba1:C0:T3:L0
partedUtil mklabel /dev/disks/mpx.vmhba1\:C0\:T3\:L0 msdos

Open in new window

in the following screenshot, you can see the partition (:1) has disappeared from the last disk -  vml.0000000000766d686261313a333a30 -> mpx.vmhba1:C0:T3:L0

The disk has been erased.

Congratulations, you have successfully destroyed the partition, you will now be able to add your VMFS5 datastore correctly without the error Call "HostDatastoreSystem.QueryVmfsDatastoreCreateOptions" for object "datastoreSystem-xx" on vCenter Server "hostname" failed." 

Basic VMware Articles: 

Thank you for reading my article, please leave valuable feedback. If you liked my VMware article and would like to see more Articles from me, please click the Yes button near the: Was this article helpful? at the bottom of this article just below and to the right of this information. Thank You. Do not forget if you have a question about this article or another VMware, Virtualisation, Windows Server 2012 question, why not post a Question for me and the other Experts Exchange Experts in the VMware, Virtualisation, Windows 2008, Windows 2012 Zones. I look forward to hearing from you. - Andy :- twitter @einsteinagogo
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Get 7 days free