VMware Cloud Community
vmCalgary
Enthusiast
Enthusiast
Jump to solution

Change nfspath for datastore for multiple vhosts

Our NFS path has changed for a vcenter / datastore.

Old path: /xyz

New path /vol/xyz

If I were adding a new datastore I'd go with the following:

$nfshost = "172.22.225.97"

$nfspath = "/vol/xyz"

$servers = get-content <filename> <-- list of virtual host names

foreach ($server in $servers) {

  

    ""

    "Adding NFS Datastores to ESX host: $server"

    "-----------------"

    "<datastore name>"

    New-Datastore -VMHost $server -Name "<datastore name>" -Nfs -NfsHost $nfshost -Path $nfspath

}

How do I rename / reset the nfs path for an existing datastore? Is this possible with Set-Datastore?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I'm afraid not.
Afaik there is no API method either to reconfigure a datastore.

The only way I can think of, is to remove the datastore and create a new one with the new configuration parameters.


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

I'm afraid not.
Afaik there is no API method either to reconfigure a datastore.

The only way I can think of, is to remove the datastore and create a new one with the new configuration parameters.


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

Reply
0 Kudos
vmCalgary
Enthusiast
Enthusiast
Jump to solution

Thanks Luc. Not the answer I wanted but easy enough.

Reply
0 Kudos