Clearing datastores in ESXi (Call “HostDatastoreSystem.RemoveDatastore” for object “ha-datastoresystem” on ESXi x.x.x.x failed)

When trying to delete a datastore you get following error message

Call "HostDatastoreSystem.RemoveDatastore" for object "ha-datastoresystem" on ESXi

Checked that all VMs are deleted, no ISO images are being referenced from any VM, but the problem still persisted. After checking the logs, I found this error message:

ValidateLayout: Invalid block boundaries: curStart: 522 prevEnd: 522 curEnd: 536

Next step: Trying out a manual deletion of the partitions on the ESXi console/shell.

/var/log # partedUtil "get" "/vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d"
243133 255 63 3905945600
1 63 8386622 6 0
2 8386623 8611902 252 0
3 8613888 3905945599 251 0
/var/log # partedUtil "delete" "/vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d" 3
/var/log # partedUtil "delete" "/vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d" 2
Error: Invalid argument during write on /dev/disks/naa.6782bcb0208864001569518a19be9f9d
Unable to delete partition 2 from device /vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d

/var/log # partedUtil "get" "/vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d"
243133 255 63 3905945600
1 63 8386622 6 0
2 8386623 8611902 252 0
/var/log # dd if=/dev/zero of=/vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d bs=512 conv=notrunc
dd: writing '/vmfs/devices/disks/naa.6782bcb0208864001569518a19be9f9d': Read-only file system
4922+0 records in
4921+0 records out

That made the datastore inaccessible and after a reboot I could reinitialize the datastore again.

More infos about deleting datastores from the cli, here. The proper outlines are documented here on the vmware KB.

No Comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>