Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a
    virtual ethernet card backing information

    network_name
        string, network name

    switch_type
        string, type of switch

    parent_ref
        Parent reference to search for network

def _create_network_backing(network_name, switch_type, parent_ref):
    '''
    Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a
    virtual ethernet card backing information

    network_name
        string, network name

    switch_type
        string, type of switch

    parent_ref
        Parent reference to search for network
    '''
    log.trace('Configuring virtual machine network backing network_name=%s '
              'switch_type=%s parent=%s',
              network_name, switch_type,
              salt.utils.vmware.get_managed_object_name(parent_ref))
    backing = {}
    if network_name:
        if switch_type == 'standard':
            networks = salt.utils.vmware.get_networks(
                parent_ref,
                network_names=[network_name])
            if not networks:
                raise salt.exceptions.VMwareObjectRetrievalError(
                    'The network \'{0}\' could not be '
                    'retrieved.'.format(network_name))
            network_ref = networks[0]
            backing = vim.vm.device.VirtualEthernetCard.NetworkBackingInfo()
            backing.deviceName = network_name
            backing.network = network_ref
        elif switch_type == 'distributed':
            networks = salt.utils.vmware.get_dvportgroups(
                parent_ref,
                portgroup_names=[network_name])
            if not networks:
                raise salt.exceptions.VMwareObjectRetrievalError(
                    'The port group \'{0}\' could not be '
                    'retrieved.'.format(network_name))
            network_ref = networks[0]
            dvs_port_connection = vim.dvs.PortConnection(
                portgroupKey=network_ref.key,
                switchUuid=network_ref.config.distributedVirtualSwitch.uuid)
            backing = \
                vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo()
            backing.port = dvs_port_connection
    return backing