VMware Cloud Community
rob1024
Contributor
Contributor

Problems with new-cluster and move-cluster do not work

I'm trying to script adding datacenters, clusters, and hosts. I'm trying to do this to assist in migrating to a completely new vCenter server.

new-datacenter work fine with new-datacenter -location datacenters -Name "Test"

new-cluster -location "Test" -Name "TestCluster"

Error Message

-


New-Cluster : 9/21/2009 3:16:05 PM New-Cluster 56EBE065-48D5-40D2-AA53-F0

7948771CC8 A specified parameter was not correct.

At line:1 char:18

+ $c1 = New-Cluster <<<< -name TestCluster2 -Location Test

+ CategoryInfo : NotSpecified: (Smiley Happy , InvalidArgument

Exception

+ FullyQualifiedErrorId : Client20_ComputeResourceServiceImpl_CreateCluste

r_ViError,VMware.VimAutomation.VimAutomation.Commands.NewCluster

-


Using the move-cluster command, I get this error message. Keep in mind that manually trying to move a cluster in vCenter even with no Hosts in the cluster will result in "Operation is not supported for this Object".

-


Move-Cluster : 9/21/2009 3:02:22 PM Move-Cluster 56EBE065-48D5-40D2-AA53-

F07948771CC8 The items belong to different Datacenters.

At line:1 char:13

+ move-cluster <<<< (get-cluster "Test Cluster") -Destination (get-datacenter

-name "Test1")

+ CategoryInfo : InvalidArgument: (Smiley Happy , InvalidArgu

mentException

+ FullyQualifiedErrorId : Client20_VmHostServiceImpl_AssertSameDatacenter_

DifferentDatacenters,VMware.VimAutomation.Commands.MoveCluster

-


Any help would be appreciated.

0 Kudos
3 Replies
admin
Immortal
Immortal

Could you try

Get-Datacenter Test | New-Cluster -Name TestCluster

The thing about -Location is that it may be picking up an object named Test that is not your Test datacenter. This style is more explicit and rules that possibility out.

In the second case, it looks like the error is coming from the server side. Are you able to do the move in vCenter client or do you get the same error?

=====

Carter Shanklin

Read the PowerCLI Blog
[Follow me on Twitter|http://twitter.com/cshanklin]

rob1024
Contributor
Contributor

Everything seems to be working now. Appears to have been a problem with my Powershell plugin install. I was trying to get some of the Update Manager commands to work and read there was a problem with Windows Toolkit 1.5, so I rolled back to 1.0. Then I uninstalled all and install vSphere PowerCLI 4.0 and it works, even with new-cluster -Location Test -Name TestCluster. The way you suggested works, also.

Near as I can figure it was a problem with the PS pluggin for VIM.

0 Kudos
Zsoldier
Expert
Expert

I'm kind of curious, does Move-Cluster work in any case when trying to move a cluster from one DataCenter to another?

This entry in help of the Move-Cluster cmdlet leads me to believe it is possible, but doesn't seem to work even when a cluster has no hosts associated with it.

-Destination <VIContainer>

+ Specify the folder or datacenter where you want to move the clusters. If a datacenter is specified for the -Des+

+ tination parameter, the cluster is moved to its "hostFolder" folder. The "hostFolder" is a system folder and is+

+ guaranteed to exist.+

Chris Nakagaki (Zsoldier)

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos