// ClearExternalPort will attach an external ethernet port to this switch.
// This operation will make this VMswitch an "external" VM switch.
ClearExternalPort will attach an external ethernet port to this switch.
This operation will make this VMswitch an "external" VM switch.
// ClearExternalPort will attach an external ethernet port to this switch . // This operation will make this VMswitch an " external " VM switch .
func (v VirtualSwitch) ClearExternalPort() (bool, error) {
	extPort, err := v.getSwitchExternalPortAllocSettings()
	if err != nil {
		if err != wmi.ErrNotFound {
			return false, errors.Wrap(err, "getSwitchExternalPortAllocSettings")
		}
	}
	if extPort == "" {
		return false, nil
	}
	resources := []string{
		extPort,
	}
	removed, err := v.ClearInternalPort()
	if err != nil {
		return false, errors.Wrap(err, "ClearInternalPort")
	}
	err = v.removeSwitchResources(resources)
	if err != nil {
		return false, errors.Wrap(err, "removeSwitchResources")
	}
	if removed {
		err = v.SetInternalPort()
		if err != nil {
			return false, errors.Wrap(err, "SetInternalPort")
		}
	}
	return true, nil
}
func ( v VirtualSwitch ) ClearExternalPort ( ) ( bool , error ) { extPort , err := v . getSwitchExternalPortAllocSettings ( ) if err != nil { if err != wmi . ErrNotFound { return false , errors . Wrap ( err , " " ) } } if extPort == " " { return false , nil } resources := [ ] string { extPort , } removed , err := v . ClearInternalPort ( ) if err != nil { return false , errors . Wrap ( err , " " ) } err = v . removeSwitchResources ( resources ) if err != nil { return false , errors . Wrap ( err , " " ) } if removed { err = v . SetInternalPort ( ) if err != nil { return false , errors . Wrap ( err , " " ) } } return true , nil }
ClearExternalPort will attach an external ethernet port to this switch.
ClearExternalPort will attach an external ethernet port to this switch .
// management OS was enabled on the switch. Re-add the internal port