Error: Operation is not valid due to the current state of the object

  • 7010895
  • 09-Oct-2012
  • 09-Oct-2012

Environment

PlateSpin Forge
PlateSpin Migrate
PlateSpin Protect

Situation

When attempting to add or refresh a container using VMWare vCenter credentials the job fails with an error similar to the following:
 
"... Exception: Failed to add new machine . Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object. at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at PlateSpin.Athens.Sdk.ContainerExtensions.ToCluster(IEnumerable`1 nodes) at PlateSpin.Athens.GetMachineInfoNameSpace.VMwareVCenterGetMachineInfo.retrieveInfoInternal(List`1 listVMsForFullInfo) at PlateSpin.Athens.GetMachineInfoNameSpace.VMwareVCenterGetMachineInfo.RetrieveInfo() at PlateSpin.Athens.Operations.Machine.Add.DiscoveryProvider.DoDiscovery() at PlateSpin.Athens.Operations.Machine.Add.AddMachine.Execute(IActionContext context).
 Exception caught in Controller.Execution.Action.run()
 ...."

Resolution

In order to resolve this issue it is necessary to increase the access the credentials being used have to the cluster:
 
1. Open the VMWare client
2. Connect to the Virtual Center server
3. Click on the datacenter or cluster being discovered or refreshed
4. Go to the Permissions tab
5. Right-click and select Add Permission
6. Under Users and Groups click Add
7. Locate the user credentials being used to discover/refresh the containers, then click Add and Ok
8. Change the Assigned Role to Administrator
9. Click Ok

Cause

This issue occurs because the credentials used to discover or refresh the vCenter server don't have Administrator-level access to the Data-Center or cluster.