#!/bin/bash function gen_config { echo "Generating sample config" DEMO_NET=$(openstack network list | awk '/demo-net/ { print $2 }') IMAGE_ID=$(openstack image list | awk '/cirros/ { print $2 }') cat > ./kolla-sample-vim.yaml < ./kolla-sample-vnfd.yaml < /proc/sys/net/ipv4/ip_forward CP11: type: tosca.nodes.nfv.CP.Tacker properties: management: true order: 0 anti_spoofing_protection: false requirements: - virtualLink: node: VL1 - virtualBinding: node: VDU1 VL1: type: tosca.nodes.nfv.VL properties: network_name: ${DEMO_NET} vendor: Tacker EOF } function deploy { echo "Registering sample VIM" tacker vim-register --is-default --config-file ./kolla-sample-vim.yaml --description "kolla sample vim" kolla-sample-vim echo "Creating sample VNFD" tacker vnfd-create --vnfd-file ./kolla-sample-vnfd.yaml kolla-sample-vnfd echo "Creating sample VNF" VNFD_ID=$(tacker vnfd-list | awk '/kolla-sample-vnfd/ { print $2 }') tacker vnf-create --vnfd-id ${VNFD_ID} kolla-sample-vnf } gen_config deploy