'create an interim network for this vif; and build
the vif_rec which will be used by xapi to create VM vif'

def plug(self, instance, vif, vm_ref=None, device=None):

    if (not vm_ref):
        vm_ref = vm_utils.lookup(self._session, instance['name'])
    if (not vm_ref):
        raise exception.VirtualInterfacePlugException(('Cannot    find    instance    %s,    discard    vif    plug' % instance['name']))
    vif_ref = self._get_vif_ref(vif, vm_ref)
    if vif_ref:
        LOG.debug('VIF    %s    already    exists    when    plug    vif', vif_ref, instance=instance)
        return vif_ref
    if (not device):
        device = 0
    network_ref = self.create_vif_interim_network(vif)
    vif_rec = {}
    vif_rec['device'] = str(device)
    vif_rec['network'] = network_ref
    vif_rec['VM'] = vm_ref
    vif_rec['MAC'] = vif['address']
    vif_rec['MTU'] = '1500'
    vif_rec['qos_algorithm_type'] = ''
    vif_rec['qos_algorithm_params'] = {}
    vif_rec['other_config'] = {'nicira-iface-id': vif['id'], 'neutron-port-id': vif['id']}
    vif_ref = self._create_vif(vif, vif_rec, vm_ref)
    self.hot_plug(vif, instance, vm_ref, vif_ref)
    return vif_ref
