code: func (s HostVsanSystem) updateVnic(ctx context.Context, device string, enable bool) error {
  	var vsan mo.HostVsanSystem
  
  	err := s.Properties(ctx, s.Reference(), []string{"config.networkInfo.port"}, &vsan)
  	if err != nil {
  		return err
  	}
  
  	info := vsan.Config
  
  	var port []types.VsanHostConfigInfoNetworkInfoPortConfig
  
  	for _, p := range info.NetworkInfo.Port {
  		if p.Device == device {
  			continue
  		}
  
  		port = append(port, p)
  	}
  
  	if enable {
  		port = append(port, types.VsanHostConfigInfoNetworkInfoPortConfig{
  			Device: device,
  		})
  	}
  
  	info.NetworkInfo.Port = port
  
  	task, err := s.Update(ctx, info)
  	if err != nil {
  		return err
  	}
  
  	_, err = task.WaitForResult(ctx, nil)
  	return err
  }
docs: // updateVnic in support of the HostVirtualNicManager.{SelectVnic,DeselectVnic} methods