# openstack port create port0_2 \ --network net0 parent_mac_2="$( openstack port show port0_2 | awk '/ mac_address / { print $4 }' )"
# openstack port create port1_2 \ --network net1 --mac-address "$parent_mac_2"
# openstack port create port2_2 \ --network net2 --mac-address "$parent_mac_2"
# openstack network trunk create trunk0_2 \ --parent-port port0_2
# openstack network trunk set trunk0_2 \ --subport port=port1_2,segmentation-type=inherit
# openstack network trunk set trunk0_2 \ --subport port=port2_2,segmentation-type=inherit
# openstack server create --flavor ds512M --image vlan-capable-image --nic port-id=port0_2 --availability-zone Compute-2 trunk-instance-2
On the VM
# sudo ip link add link eth0 name eth0.101 type vlan id 101
# sudo ifconfig eth0.101 up
# sudo dhclient eth0.101
# sudo ip link add link eth0 name eth0.102 type vlan id 102
# sudo ifconfig eth0.102 up
# sudo dhclient eth0.102