VMware Cloud Community
alasdair_carnie
Enthusiast
Enthusiast

new-datastore on ESX4i Installable local disk

Hi all,

I have an ESX4i installable Host and am trying to delete and recreate the local vmfs datastore.

I can list and delete the datastore no problem, but when I try and create it again, I get a "cannot find specified disk or disk already in use" error I have tried extracting the lun information with get-scsilun and scsilunpath as well as reading all the posts I can find on here about the new-datastore command.

The command I am running is

New-Datastore -vmhost $esxHost -Vmfs -Name LocalStor -path vmhba1:0:0:1

When I add the datastore manually, the wizard shows all the ESX4i partition on the disk and offers the option of using the remaining free space. I have tried partition numbers other than 1, but if I look at the properties of the existing partitions then 1 is the only logical number to use.

If I can't easily delete and recreate this datastore can someone reconned a command to wipe the content of the datastore.

Thanks.

Reply
0 Kudos
2 Replies
Herschelle
Enthusiast
Enthusiast

Have you tried using the Indentifier instead of the PathID?

If you go to the wizard and get to the select Disk/LUN page there will be columns Name, Path ID, LUN, Capacity etc

If click and drag the column divider between Name and Path ID to the right, this will reveal an Identifier column.

For my SAN LUNs they look like this naa.60020e80050001000000763100003f03, so then I used this command.

$vmhost = Get-VMHost -Name myesx
$LunName = "test-lun-01"
$LunPath = "naa.60020e80050001000000763100003f03"
$BlockSize = 1
New-Datastore -Vmfs -VMHost $vmhost -Name $LunName -Path $LunPath -BlockSizeMB $BlockSize

I do not have a Host I can play with to test if this also work on Local storage, however this might assist.

Reply
0 Kudos
LucD
Leadership
Leadership

Have a look at my Create VMFS datastores on a “free space” partition post to check if these function solve your problem ?

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos