#!/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" openstack vim register --config-file ./kolla-sample-vim.yaml --description "kolla sample vim" --is-default kolla-sample-vim echo "Creating sample VNFD" openstack vnf descriptor create --vnfd-file ./kolla-sample-vnfd.yaml kolla-sample-vnfd echo "Creating sample VNF" VNFD_ID=$(openstack vnf descriptor list | awk '/kolla-sample-vnfd/ { print $2 }') openstack vnf create --vnfd-id ${VNFD_ID} kolla-sample-vnf } gen_config deploy