<

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

Published on
23,897 Points
10,797 Views
6 Endorsements
Last Modified:
Approved
Andrew Hancock (VMware vExpert / EE MVE^2)
MVE^2, Expert of the Year 2017-2011, Scribe 2016-2012, Author of the Year 2017-6,2013-2012 VMware vExpert 2018-2011 27 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." 

HostDatastoreSystem.QueryVmfsDatastoreCr
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


show-disks1.jpg
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

disk-erased.jpg
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
****************************************************************************
 
6
Comment
1 Comment
 
LVL 9

Expert Comment

by:Senior IT System Engineer
Hi Andrew,

How do I format my drive to become 4K sector so that it is usable for VMFS data store ?
0

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Join & Write a Comment

Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
This video shows you how to use a vSphere client to connect to your ESX host as the root user. Demonstrates the basic connection of bypassing certification set up. Demonstrates how to access the traditional view to begin managing your virtual mac…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month