Launch VM Instances on Compute Node

Procedure

  1. Log in to the network node using SSH and go to the EFA folder.
    # cd efa
  2. Download the server cloud image file.
    # wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
  3. Launch the VM instance.
    # sudo virt-customize -a bionic-server-cloudimg-amd64.img  --root-password password:password 
    
    # openstack image create --disk-format qcow2 --public --file bionic-server-cloudimg-amd64.img  vlan-capable-image 
     
    # The only vNIC in your instance corresponds to the parent port, so boot your instance with the parent port given. 
    # Do not add child ports as NICs to 'nova boot / openstack server create'. 
    
    # openstack server create --flavor ds512M --image vlan-capable-image --nic port-id=port0 --availability-zone Compute-1  trunk-instance-1 
    
    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
  4. Launch the second VM instance.
    # 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