docs: def vnic_attach_to_network_distributed(nicspec, port_group, logger):
          """
          Attach vNIC to a Distributed Port Group network
          :param nicspec: <vim.vm.device.VirtualDeviceSpec>
          :param port_group: <vim.dvs.DistributedVirtualPortgroup>
          :param logger:
          :return: updated 'nicspec'
          """
          if nicspec and network_is_portgroup(port_group):
              network_name = port_group.name
  
              dvs_port_connection = vim.dvs.PortConnection()
              dvs_port_connection.portgroupKey = port_group.key
              dvs_port_connection.switchUuid = port_group.config.distributedVirtualSwitch.uuid
  
              nicspec.device.backing = vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo()
              nicspec.device.backing.port = dvs_port_connection
  
              logger.debug(u"Assigning portgroup '{}' for vNIC".format(network_name))
          else:
              logger.warn(u"Cannot assigning portgroup for vNIC")
          return nicspec