Remove-VMSwitch fails.

Jul 25, 2012 at 1:00 AM

Hello,

I created an external switch by "New-VMExternalSwitch" and deleted the external switch by "Remove-VMSwitch". Then, tried to recreate an external switch by "New-VMExternalSwitch" on the same physical network interface, but I got the below error, and it ends up creating an private switch 'vswitch' not an externalswitch. so I could delete the private switch 'vswitch'. (seems to create a private interface by defaul when external switch creation failure) Once I failed to creating an external switch in the 2nd time on the physical network interface, I have to reinstall device driver to create an external switch on the same network interface.

I tested creating an external interface from GUI (Virtual Network Manager), then remove it, and re-creation works fine. I think 'Remove-VMSwitch' seems to lock something, so re-creation doesn't work after that. Could you anyone take a look at this issue?

Thank you. Spark.

PS C:\CVS\IteExtensionCode\Virtualization\VirtualizationTest\Tools\Virtualization\Hyper-V\W2K8> New-VMExternalSwitch -VirtualSwitchName 'vswitch' -ExternalEther
net 'Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client)'

Confirm
Are you sure you want to perform this action?
Performing operation "Use Host network card for an external virtual network" on Target "Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Name                           Learnable Status
                               Addresses
----                           --------- ------
vswitch                        1024      {OK}


PS C:\CVS\IteExtensionCode\Virtualization\VirtualizationTest\Tools\Virtualization\Hyper-V\W2K8> Remove-VMSwitch -VirtualSwitch 'vswitch'

Confirm
Are you sure you want to perform this action?
Performing operation "Delete Virtual Switch" on Target "vswitch".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
OK
PS C:\CVS\IteExtensionCode\Virtualization\VirtualizationTest\Tools\Virtualization\Hyper-V\W2K8> New-VMExternalSwitch -VirtualSwitchName 'vswitch' -ExternalEther
net 'Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client)'

Confirm
Are you sure you want to perform this action?
Performing operation "Use Host network card for an external virtual network" on Target "Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
Test-WMIResult : Failed to create the external Switch vswitch on Server .:
<INSTANCE CLASSNAME="Msvm_Error"><PROPERTY NAME="CIMStatusCode" TYPE="uint32"><VALUE>1</VALUE></PROPERTY><PROPERTY NAME="CIMStatusCodeDescription" PROPAGATED="
true" TYPE="string"></PROPERTY><PROPERTY NAME="ErrorSource" PROPAGATED="true" TYPE="string"></PROPERTY><PROPERTY NAME="ErrorSourceFormat" TYPE="uint16"><VALUE>
0</VALUE></PROPERTY><PROPERTY NAME="ErrorType" TYPE="uint16"><VALUE>4</VALUE></PROPERTY><PROPERTY NAME="Message" TYPE="string"><VALUE>Switch set up failed, nam
e='997367ee-1c51-4d6d-8cc0-560173509c80', external port='vswitch_ExternalPort', internal port='vswitch_InternalPort', NIC='{040FA1F9-8A94-47B6-9641-40DCBF9DDAC
5}', internal name='vswitch', internal friendly name='vswitch', error=2147749896, mof code=0.</VALUE></PROPERTY><PROPERTY.ARRAY NAME="MessageArguments" TYPE="s
tring"><VALUE.ARRAY><VALUE>997367ee-1c51-4d6d-8cc0-560173509c80</VALUE><VALUE>vswitch_ExternalPort</VALUE><VALUE>vswitch_InternalPort</VALUE><VALUE>{040FA1F9-8
A94-47B6-9641-40DCBF9DDAC5}</VALUE><VALUE>vswitch</VALUE><VALUE>vswitch</VALUE><VALUE>2147749896</VALUE><VALUE>0</VALUE></VALUE.ARRAY></PROPERTY.ARRAY><PROPERT
Y NAME="MessageID" TYPE="string"><VALUE>14070</VALUE></PROPERTY><PROPERTY NAME="OtherErrorSourceFormat" PROPAGATED="true" TYPE="string"></PROPERTY><PROPERTY NA
ME="OtherErrorType" PROPAGATED="true" TYPE="string"></PROPERTY><PROPERTY NAME="OwningEntity" TYPE="string"><VALUE>Microsoft-Windows-Hyper-V-Network</VALUE></PR
OPERTY><PROPERTY NAME="PerceivedSeverity" TYPE="uint16"><VALUE>3</VALUE></PROPERTY><PROPERTY NAME="ProbableCause" TYPE="uint16"><VALUE>0</VALUE></PROPERTY><PRO
PERTY NAME="ProbableCauseDescription" PROPAGATED="true" TYPE="string"></PROPERTY><PROPERTY.ARRAY NAME="RecommendedActions" PROPAGATED="true" TYPE="string"></PR
OPERTY.ARRAY></INSTANCE>
+
At C:\CVS\IteExtensionCode\Virtualization\VirtualizationTest\Tools\Virtualization\Hyper-V\W2K8\Modules\HyperV\Network.ps1:200 char:54
+                        if ( ($result | Test-wmiResult <<<<  -wait -JobWaitText ($lstr_ExternalSwitchSetup  -f $virtualSwitchName) `
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-WMIResult

PS C:\CVS\IteExtensionCode\Virtualization\VirtualizationTest\Tools\Virtualization\Hyper-V\W2K8>get-vmswitch

Name                           Learnable Status
                               Addresses
----                           --------- ------
vswitch                        1024      {OK}

PS C:\CVS\IteExtensionCode\Virtualization\VirtualizationTest\Tools\Virtualization\Hyper-V\W2K8> Remove-VMSwitch -VirtualSwitch 'vswitch'

Confirm
Are you sure you want to perform this action?
Performing operation "Delete Virtual Switch" on Target "vswitch".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
OK