VMware Cloud Community
tickermcse76
Contributor
Contributor
Jump to solution

move-vmhost error - the specified parameter destination expects a single value

I'm running into an error using Move-VMHost under PowerCLI versions 5.5 R2 Patch 1 and 5.8 Release 1.

There are 6 clusters in the datacenter.  To successfully move the VM Host between 5 of the clusters I can run:

Get-VMHost vmhostname | Move-VMHost Destination "ClusterName"

But one cluster in particular always fails when specified as the destination, with error message:

The specified parameter 'Desintation' expects a single value, but your name criteria 'cluster6' corresponds to multiple values.

The only way I can get it working is to do:

Get-VMHost vmhostname | |move -VMHost -Destination (get-cluster | where {$_.name -eq "cluster6"})

How could "cluster6" match multiple cluster names?  Is this just a bug in PowerCLI?  I started using PowerCLI more recently and noticed some cmdlets can be a little quirky ( for example had some other issues with Get-VMHostStorage and found others have had similar problems with it).  I'm using this move process in part of a larger automated deployment script.  Would prefer to make it as efficient as possible without having to insert the extra Get-Cluster command if at all possible. 

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The Destination parameter on the Move-VMHost cmdlet accepts any VIContainer, not just clusters.

I suspect there might another VIContainer with the same name.

What does this return ?

Get-Inventory -Name 'cluster6'


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

View solution in original post

Reply
0 Kudos
4 Replies
sneddo
Hot Shot
Hot Shot
Jump to solution

Does Get-Cluster -Name "Cluster6" return multiple values? Can't say I've ever seen this issue before.

Reply
0 Kudos
tickermcse76
Contributor
Contributor
Jump to solution

(get-cluster -name "cluster6").count returns 1.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The Destination parameter on the Move-VMHost cmdlet accepts any VIContainer, not just clusters.

I suspect there might another VIContainer with the same name.

What does this return ?

Get-Inventory -Name 'cluster6'


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

Reply
0 Kudos
tickermcse76
Contributor
Contributor
Jump to solution

Get-Inventory returns both a folder and a cluster; good catch!

Reply
0 Kudos