I'm using Set-Network Adapter to fix-up guest servers when a portgroup is renamed. The request seems to make the required changes then crashses. In vCenter I don't see any errors in the Recent Tasks list.
I am using the following code:
No, that shouldn't be a problem.
Are you by any chance using PowerGui ?
There have been mentions of the exact same message when using an older version of PowerGui and the PowerPack.
See New-VM error (Operation is not valid due to the current state of the object.)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Can you check the state of the NIC ?
Have a look at all the properties on the object returned by
Get-VMHost vmware.host | Get-VM | Get-NetworkAdapter | Where {$_.NetworkName -eq "old_name"}
I suspect there might be a VM with a NIC in a funny state
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
Looking at the returned data it all looks fine. I've now run it individualy on 4 different guests on that cluster and also 3 guests on a ESXi 4.0 server with the same result.
Could it be an issue with me using PowerCLI 5.1 against a 5.0 vCenter?
Thanks
Iain
No, that shouldn't be a problem.
Are you by any chance using PowerGui ?
There have been mentions of the exact same message when using an older version of PowerGui and the PowerPack.
See New-VM error (Operation is not valid due to the current state of the object.)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I have PowerGUI installed (current version 3.2.0.2237) but I'm using a seperate PowerCLI prompt to do my testing. I have just tested it with PowerGUI closed and the issue still exists. I then un-installed PowerGUI and the issue existed in the PowerCLI prompt I already had open, but when I launched a new prompt the issues wasn't present. Either PowerGUI was the caused of the issue or the prompt shell that was open, I suspect PowerGUI based on the previous reported issue.
I had better look for a new editor.
Thanks
Iain
Before you decide to throw away PowerGui, you could check if the PowerPack is causing the problem.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Just came across the same problem - no powerpack / PowerGUI being used...
Here is the output from the command
Just noticed this thread http://communities.vmware.com/thread/425459 and yes I am using v3 of Powershell
Do you still have a client with PS v2 somewhere ?
Curious to know if this is also a PS v3 feature.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you have PowerShell v3 installed you can still start PowerShell v2 with:
PowerShell -version 2
From a different machine running
Command completes successfully...
And by feature - do you mean bug ???
Well, you can't file a bug for something that is not supported, now can you
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for raising this, we of course want to know of any issues you hit in PS3 via these communities to help us provide support in the future.
Ran into the same thing again today - (which is strange becuase this was working - but all of a sudden it stopped today) with the New-Harddisk cmdlet.
with powershell -version 2 it works fine..