-
1. Re: error thrown when using remove-datastore cmdlet
LucD Oct 11, 2018 8:39 AM (in response to lorried82)Did you check that
Get-VMHost -Name host
and
Get-Datastore -Name datastore
both return objects?
-
2. Re: error thrown when using remove-datastore cmdlet
lorried82 Oct 11, 2018 8:44 AM (in response to LucD)yes - I was able to add it just fine but when I try and remove I get that error.
-
3. Re: error thrown when using remove-datastore cmdlet
lorried82 Oct 11, 2018 8:47 AM (in response to lorried82)I should note when I do get-datastore -name datastore it does return it 7 times - is that odd?
-
4. Re: error thrown when using remove-datastore cmdlet
lorried82 Oct 11, 2018 8:49 AM (in response to lorried82)ok so I just ran the command again and let it run through and it did complete successfully one time out of 7 tires. so the issue must be the weirdness on why it returns 7 results - any thoughts on that?
-
5. Re: error thrown when using remove-datastore cmdlet
LucD Oct 11, 2018 9:23 AM (in response to lorried82)Do you have multiple connections open?
Check what is in $global:defaultviservers
-
6. Re: error thrown when using remove-datastore cmdlet
lorried82 Oct 11, 2018 9:33 AM (in response to LucD)when I run that command I am just seeing the one server connection.
-
7. Re: error thrown when using remove-datastore cmdlet
LucD Oct 11, 2018 10:02 AM (in response to lorried82)Ok, one connection is ok.
Is that to a vCenter?
Are there perhaps 7 ESXi nodes connected to that vCenter?
Or are there datastores with names that closely resemble each other?
Can you show the output with the 7 datastores that are returned? -
8. Re: error thrown when using remove-datastore cmdlet
lorried82 Oct 11, 2018 11:27 AM (in response to LucD)Yes to a vCenter.
There are 30+ ESXi servers that are connected to the vCenter but now that you say that I think the issue is that the datastore is in 7 different dataCenters so maybe that is my issue? I need to add the -Location attribute
would that make sense?
-
9. Re: error thrown when using remove-datastore cmdlet
LucD Oct 11, 2018 11:46 AM (in response to lorried82)Yes, but is it the datastorename that was reused, or are all these datastores using the same LUN?
And you would need to do
$dc = Get-Datacenter -Name datacenterGet-Datastore -Name datastore -VMHost host -Location $dc |
Remove-Datastore -Confirm:$false
-
10. Re: error thrown when using remove-datastore cmdlet
lorried82 Oct 12, 2018 5:56 AM (in response to LucD)yes the datastore name is reused since it is an NFS mount
ok that makes sense thank you!