Hello Luc,
I am trying to change networkname of the network adapter (network adapter of vcenter)using powercli.
this adapter is currently configured to DPG on cisco1k and i want to change to standard port group in order to fix the requirement of vcenter upgrade as DPG is configured as static port binding.
get-vm "vmname"|Get-NetworkAdapter|Set-NetworkAdapter -NetworkName "Management Network"
i got following error :
could you suggest anything related to this error.
Does this give the same error?
$pg = Get-VirtualPortGroup -Name "Management Network"
Get-VM "vmname" | Get-NetworkAdapter | Set-NetworkAdapter -Portgroup $pg
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is there any output from get-vm "vmname"|Get-NetworkAdapter ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes it gave network adapter (only one is configured) just selected name only here.
Does this give the same error?
$pg = Get-VirtualPortGroup -Name "Management Network"
Get-VM "vmname" | Get-NetworkAdapter | Set-NetworkAdapter -Portgroup $pg
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i got following
However :smileyconfused:
$pg for some reasons give two values though i see only one in c# client.
You probably have this VSS portgroup defined on multiple ESXi nodes.
Can you display more info from $pg?
$pg | Select Name,Key,VlanId,VMHostId
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
and i need to chose host21 i think i need to start with esxi host then to vss and portgroup.
but problem is i cant to this change from client also.not from directly login to esxi host from client.
one problem i can think is that currently this is configured on DPG of cisco1k and i think we need to shutdown vmto do this .
Not sure you need to power off the VM for this.
The Web Client has a procedure to move a VM from a VDS portgroup to a VSS portgroup.
I'll have to check if that can be done through code
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i did following but got following.
i got the issue actually there was no vm standrad port group created on vss.by mistake i was trying to change to vmkernlport .
sorry for trouble.