Highlighted
Contributor
Contributor

Failed to create VMFS datastore - Cannot change the host configuration

Jump to solution

I try to add a LUN as a new Datastore, provided from a HPE MSA 2040 SAS, using a HPE 241 SAS HBA to a vSphere 6.7 System.

The HW is a HPE Proliant 380 Gen9 Server. The MSA2040 is direct attached using SAS Controllers.

The LUN is available in the MSA Utility Software and shown in the "Add Datastore" Wizard as expected.

But during the "Add Datastore" procedure, I get the error "Cannot change the host configuration".

Please find below the summary details of the "Add Datastore" Wizard:

General

Name: MSA2040VDISKA

Type: VMFS

Datastore size: 2.64 TB

Device and Formatting

Disk/LUN: HP Serial Attached SCSI Disk (naa.600c0ff0001e3b26fc879d5f01000000)

Partition Format: GPT

VMFS Version: VMFS 6

Block Size: 1 MB

Space Reclamation Granularity: 1 MB

Space Reclamation Priority Low: Deleted or unmapped blocks are reclaimed on the LUN at low priority

Looking to the device on the ESX Console, is not showing any existing partition on this LUN:

[root@HCDORDEVOPSENP1:~] partedUtil getptbl /vmfs/devices/disks/naa.600c0ff0001e3b26fc879d5f01000000

unknown

352571 255 63 5664055296

Does anyone know how to troubleshoot this error?

Is anyone may be able to help or point me to the root cause of this error?

Thank you in advance.

Kind regards Bernd

1 Solution

Accepted Solutions
Highlighted
Contributor
Contributor

Thank you both for your replies.

In the meantime I found the root cause:

The MSA had "unwritable cache" data in its controllers and therefore the LUN was provided only read-only.

Unfortunately this was not shown in the SMU of the MSA2040.

The following command (in a ssh session on the MSA's controller) showed this very clear:

# show unwritable-cache

Unwritable System Cache

-----------------------

Percent of unwritable cache in controller A: 98

Percent of unwritable cache in controller B: 98

As we changed the controllers of this box recently (before connecting to the ESX Server) and created the LUN completely new, there is no useful data in the cache.

Therefore the following command will clear the cache and finally provide the LUN read/writable:

# clear cache

Clearing cache for a volume that is offline or quarantined could result in unrecoverable data loss.

Do you want to continue? (y/n) y

Success: Command completed successfully. - If unwritable cache data existed, it has been cleared.

After some seconds, the "show unwritable-cache" command shows 0 Percent of unwritable data in each controller.

Now adding the Datastore to the vSphere Server worked as expected without any error.

Hope this helps may be others.

kind regards Bernd

View solution in original post

3 Replies
Highlighted
Immortal
Immortal

The top 3 reasons for "failed to create VMFS datastore" are probably:

- the volume is already known to the ESXi and is configured to be used for scratch or swap-files

- volume is not using 512 bytes block size

- volume still has old data with an obscure partition layout

Sometimes it helps to wipe the first few GBs of the volume first - you would do that with:

dd if=/dev/zero bs=1M count=3000 of=/dev/disks/naa.600c0ff0001e3b26fc879d5f01000000 conv=notrunc

That command is not always allowed - if not try to use a Linux system to wipe the volume.

Also have a look into the vmkernel.log right after such a dd-command or another attempt to use partedUtil.

Finally have a look into esx.conf - make sure that the device is not listed in that file.

Do you need support with a recovery problem ? - call me via skype "sanbarrow"
Highlighted
User Moderator
User Moderator

If wiping as explained in the previous reply doesn't help, then please verify that the LUN has been presented in R/W mode from the storage array.

As an alternative, you may try to create a VMFS6  datastore from the command line:

  1. partedUtil getUsableSectors "/vmfs/devices/disks/naa.600c0ff0001e3b26fc879d5f01000000"
  2. partedUtil setptbl "/vmfs/devices/disks/naa.600c0ff0001e3b26fc879d5f01000000" gpt "1 2048 56640552XX AA31E02A400F11DB9590000C2911D1B8 0"
  3. vmkfstools -C vmfs6 -S "MSA2040VDISKA" "/vmfs/devices/disks/naa.600c0ff0001e3b26fc879d5f01000000:1"

Note: Replace the last sector (in red) with the output of the "getUsableSectors" command.

André

Highlighted
Contributor
Contributor

Thank you both for your replies.

In the meantime I found the root cause:

The MSA had "unwritable cache" data in its controllers and therefore the LUN was provided only read-only.

Unfortunately this was not shown in the SMU of the MSA2040.

The following command (in a ssh session on the MSA's controller) showed this very clear:

# show unwritable-cache

Unwritable System Cache

-----------------------

Percent of unwritable cache in controller A: 98

Percent of unwritable cache in controller B: 98

As we changed the controllers of this box recently (before connecting to the ESX Server) and created the LUN completely new, there is no useful data in the cache.

Therefore the following command will clear the cache and finally provide the LUN read/writable:

# clear cache

Clearing cache for a volume that is offline or quarantined could result in unrecoverable data loss.

Do you want to continue? (y/n) y

Success: Command completed successfully. - If unwritable cache data existed, it has been cleared.

After some seconds, the "show unwritable-cache" command shows 0 Percent of unwritable data in each controller.

Now adding the Datastore to the vSphere Server worked as expected without any error.

Hope this helps may be others.

kind regards Bernd

View solution in original post