I am running the command below
Remove-Datastore -Datastore datastore -VMHost host -Confirm:$False
the error gets thrown
Remove-Datastore A specified parameter was not correct - full error output attached (hostname has been blacked out)
am I missing something obvious?
Any help appreciated.
Did you check that
Get-VMHost -Name host
and
Get-Datastore -Name datastore
both return objects?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes - I was able to add it just fine but when I try and remove I get that error.
I should note when I do get-datastore -name datastore it does return it 7 times - is that odd?
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?
Do you have multiple connections open?
Check what is in $global:defaultviservers
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
when I run that command I am just seeing the one server connection.
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?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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?
Yes, but is it the datastorename that was reused, or are all these datastores using the same LUN?
And you would need to do
Get-Datastore -Name datastore -VMHost host -Location $dc |
Remove-Datastore -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes the datastore name is reused since it is an NFS mount
ok that makes sense thank you!