vmfex vdsm hook
===================

Add Cisco VM-FEX Port Profile to Virtual Machine

vmfex hook:
Add Cisco VM-FEX Port Profile to Virtual Machine
since the only unique parameter passed from the engine to the VM is the
MAC, a dictionary-like mapping of MAC to port profile will be used
Sample:
vmfex={'00:11:22:33:44:55:66':'Profile1',
       '00:11:22:33:44:55:67':'Profile2',...} (one line)

Will add 2 virtual nics attached to profile1 and profile2 using
the vnic MAC addresses specified, replacing the actual NICs assigned
to the VM.

A VM NIC with a MAC that is not mentioned in this dictionary will not be
altered, and will remain attached to the bridge/logical network defined
for it in the engine.

Libvirt internals:
Replace the existing interface xml:
    <interface type="bridge">
        <mac address="<mac>"/>
        <model type="virtio"/>
        <source bridge="<logical network>"/>
    </interface>

with the following interface xml:
    <interface type='network'>
      <mac address='<mac>'/>
      <source network='direct-pool'/>
      <virtualport type='802.1Qbh'>
          <parameters profileid='<Port Profile>'/>
      </virtualport>
      <model type='virtio'/>
    </interface>

Dynamic network with libvirt (define a NIC pool, so libvirt can assign VMs to NICs dynamically):

      <network>
        <name>direct-pool</name>
        <forward mode="passthrough">
          <interface dev="eth3"/>
          <interface dev="eth4"/>
          <interface dev="eth5"/>
          <interface dev="eth6"/>
          <interface dev="eth7"/>
          <interface dev="eth8"/>
          <interface dev="eth9"/>
          <interface dev="eth10"/>
          <interface dev="eth11"/>
        </forward>
      </network>

Using libvirt, the network is defined like this:

   virsh net-define /tmp/direct-pool.xml
   virsh net-start direct-pool
   virsh net-autostart direct-pool

(where /tmp/direct-pool.xml contains the xml above)

(everything else is autogenerated, and shouldn't be specified
when defining a guest (but whatever is there after definition
should be left in place, e.g. the PCI address)). Note that these
interface definitions are completely static - you never need to modify
them due to migration, or starting up/shutting down the guest.
