VMware Cloud Community
saidar
Contributor
Contributor

can't use set-virtualswitch with some ESX

Hi i get this problem when execute the following command  :

PowerCLI C:\> Get-VMHost 10.136.22.1 | Get-VirtualSwitch  | where {$_.Name -eq "vSwitch1"} | Set-VirtualSwitch -nic "vmnic"
Perform operation?
Perform operation 'Configuring virtual switch.' on virtual switch 'vSwitch1'
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
Set-VirtualSwitch : 11/21/2012 11:58:07 AM    Set-VirtualSwitch        An error occurred during host configuration.
At line:1 char:97
+ Get-VMHost 10.136.22.1 | Get-VirtualSwitch  | where {$_.Name -eq "vSwitch1"} | Set-VirtualSwitch <<<<  -nic "vmnic"
    + CategoryInfo          : NotSpecified: (:) [Set-VirtualSwitch], ViError
    + FullyQualifiedErrorId : Client20_VirtualNetworkService_SetVirtualSwitch25_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVirtualSwitch
PowerCLI C:\>

Note : This issue not happened with ESX GA

0 Kudos
10 Replies
iw123
Commander
Commander

Hi,

If you use the -name parameter rather than using 'where', does it work?

e.g.

Get-VMHost 10.136.22.1 | Get-VirtualSwitch  -name "vSwitch1" | Set-VirtualSwitch -nic "vmnic_ib0"

*Please, don't forget the awarding points for "helpful" and/or "correct" answers
0 Kudos
saidar
Contributor
Contributor

No the same thing "An error occured during host configuration"

0 Kudos
LucD
Leadership
Leadership

Is the name of vnic correct ?

Do you see it when you do

Get-VMHost 10.136.22.1 | Get-VMHostNetworkAdapter | Select Name


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
saidar
Contributor
Contributor

yes i saw the network adapter "

just reminder  : this issue not happened with ESX GA

"VMware ESXi 5.1.0 build-799733"
0 Kudos
LucD
Leadership
Leadership

Are you connected to the ESXi host or to a vCenter ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
saidar
Contributor
Contributor

am connected to vcenter

0 Kudos
saidar
Contributor
Contributor

Update : i connect directly to the ESX , retry the same command working fine .

what should i do , if i connected to vcenter not no ESX vsphere clinent

0 Kudos
LucD
Leadership
Leadership

Try adding the Server parameter.

Update: that is wrong, it assumes there is a connection to the ESXi server through Connect-VIServer

Are you sure

Get-VMHost 10.136.22.1 | Get-VirtualSwitch  | where {$_.Name -eq "vSwitch1"} | Select Name

only returns 1 vSwitch


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
saidar
Contributor
Contributor

Thank you very much

working fine now Smiley Happy

0 Kudos
saidar
Contributor
Contributor

Long time passed over this issue
again i have the same problem

Even if connect to ESX directly i get the same error

"

Set-VirtualSwitch : 2/23/2014 11:22:47 AMSet-VirtualSwitch    An error occurred during host configuration.   

At line:1 char:1

+ Set-VirtualSwitch -VirtualSwitch (Get-VMHost 10.136.209.1 | Get-VirtualSwitch |  ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo      : NotSpecified: (:) [Set-VirtualSwitch], ViError
+ FullyQualifiedErrorId : Client20_VirtualNetworkService_SetVirtualSwitch25_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVirtualSwitch
0 Kudos