Hi Paul,
You can set the static MAC address and VLAN in the interface section of the VM xml.
So it will not change even when the VM shuts down and restarts.
VM interface xml:
<interface type='network'>
<mac address='52:54:00:85:e2:cd'/>
<source network='hostdev_net'/>
<vlan>
<tag id='42'/>
</vlan>
</interface>
And set the network(vf pool) with xml like below:
# cat hostnet.xml
<network>
<name>hostdev_net</name>
<forward mode='hostdev' managed='yes'>
<pf dev='eth0'/>
</forward>
</network>
or:
# cat hostnet.xml
<network>
<name>hostdev_net</name>
<forward mode='hostdev' managed='yes'>
<address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x2'/>
</forward>
</network>
(the address is VF's pci address, you can specify multiple addresses at once)
# virsh net-define hostnet.xml
# virsh net-start hostdev_net
Hope it helps.
BR
Yalan