Hi,
I have a strange problem when I try to swap VLANs on a Virtual Machine using PowerCLI. I use the below code for that:
Set-NetworkAdapter -NetworkAdapter $nic -NetworkName $VLANID -Connected:$false -Confirm:$false| Set-NetworkAdapter -Connected:$True -Confirm:$false
After applying it, the VLAN changes to the value of VLANID, however in the Summary tab of my VM I can see both: old and new vlans connected. When I access settings of that VM, I can see only one NIC connected* only to the new VLAN*.
What is the best way to do this?
Thanks!
Hi,
Are there any Snapshots on the VM?
A Snapshot also keeps the old network informations and you'll see both networks in the summary view.
Regards
Thanks a lot EKardinal!
That was it. It didn't think it could be so simple.
Regards,
Kamil
I suspect this is a timing and refresh issue in the client.
To make absolutely sure you could try a unregister/register of the VM.
That way you should see the latest info in the client
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No, it was caused by the snapshot created before modification (As suggested by EKardinal). Removing the snapshot solved this issue. Thanks for help guys! You made my day.
