PowerCLI

 Mounting Datastore and keeping signature {No Formating it]

Ayman Mahmoud's profile image
Ayman Mahmoud posted Feb 19, 2025 07:06 AM

Hi All, I am looking to mount a PROD datastore at the DR site, need a way to mount the datastores at DR without re-signature them. The command New-Datastore always format the datastore.

thanks in advance

LucD's profile image
LucD

Did you check with Get-EsxCli if the ESXi node can see the LUN?

$esxcli = Get-EsxCli -VMHost MyEsx -V2
$esxcli.storage.filesystem.list.invoke()

That should return all visible LUNs.
Each entry also shows the LUN's UUID, which you can use to mount the LUN

$esxcli.storage.filesystem.mount.invoke(@{volumelable='MyDS';volumeuuid='5c7e9808-d50cbdb2-fed5-b42e99481b28'})

For the volumelabel you should preferably use the original datastore name.

Ayman Mahmoud's profile image
Ayman Mahmoud

Hi LucD,

First thanks for your quick reply, secondly, when running the command it does not shows the unmounted datastore while thru the web client adding datastore shows the LUNs and their LUN ID, in the command line it didn't list them to get the UUID. attachment may clear my point, 

Attachments  View in library
mount_2.png 24 KB
mount_1.png 38 KB
LucD's profile image
LucD

Could it be that the ESXi node to which you connected the Get-EsxCli does not have that LUN mapped?
The web client shows all available LUNs over all ESXi nodes.

Ayman Mahmoud's profile image
Ayman Mahmoud

i am sure that both ESXi their LUNs are available in the storage devices of the esxi vcenter client, the attachment all shows for esx "dr_esx_31". but not able to do it from the powercli.:(

Attachments  View in library
mount_5.png 67 KB
mount_3.png 57 KB
mount_4.png 31 KB