Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PCEI for Azure IoT Edge Call Flow (High-level)

Openstack HEAT Example

HEAT Template and Environment Files

Template (pcei_base.yaml)

#####

heat_template_version: 2013-05-23

description: Heat template that deploys PCEI IoT Edge VM in Openstack


##############
# #
# PARAMETERS #
# #
##############

parameters:
pcei_image_name:
type: string
label: Image name or ID
description: Image to be used for compute instance
pcei_flavor_name:
type: string
label: Flavor
description: Type of instance (flavor) to be used
os_private_net_id:
type: string
label: os management network name or ID
description: Private network that connects os components and the VNF
os_private_subnet_id:
type: string
label: os management sub-network name or ID
description: Private sub-network that connects os components and the VNF
os_private_net_cidr:
type: string
label: os private network CIDR
description: The CIDR of the protected private network
pcei_private_ip_0:
type: string
label: VNF IP Address
description: IP address that is assigned to the IoT Edge
pcei_name_0:
type: string
label: VNF name
description: Name of the vPacketGenerator
key_name:
type: string
label: Key pair name
description: Public/Private key pair name
pub_key:
type: string
label: Public key
description: Public key to be installed on the compute instance

#############
# #
# RESOURCES #
# #
#############

resources:
random-str:
type: OS::Heat::RandomString
properties:
length: 4

my_keypair:
type: OS::Nova::KeyPair
properties:
name:
str_replace:
template: base_rand
params:
base: { get_param: key_name }
rand: { get_resource: random-str }
public_key: { get_param: pub_key }
save_private_key: false


# Instance behing vRouter
pcei_private_0_port:
type: OS::Neutron::Port
properties:
network: { get_param: os_private_net_id }
fixed_ips: [{"subnet": { get_param: os_private_subnet_id }, "ip_address": { get_param: pcei_private_ip_0 }}]

pcei_0:
type: OS::Nova::Server
properties:
image: { get_param: pcei_image_name }
flavor: { get_param: pcei_flavor_name }
name: { get_param: pcei_name_0 }
key_name: { get_resource: my_keypair }
networks:
# - network: { get_param: os_private_net_id }
- port: { get_resource: pcei_private_0_port }
user_data_format: RAW
user_data: |
#cloud-config
password: pcei
chpasswd: { expire: False }
ssh_pwauth: True
runcmd:
- [ sh, -xc, "sed -i 's,#UseDNS yes,UseDNS no,' /etc/ssh/sshd_config" ]
- systemctl restart sshd.service


Environment (pcei_base.env)

#########

parameters:

pcei_image_name: ubuntu1604

pcei_flavor_name: l3

os_private_net_id: provider

os_private_subnet_id: provider

os_private_net_cidr: 10.121.11.0/24

pcei_private_ip_0: 10.121.11.91

pcei_name_0: PCEI-IOT-EDGE

key_name: maskey1

pub_key: ssh-rsa AAAAB3NzaC1y


Openstack HEAT Command

openstack stack create -t pcei_base.yaml -e pcei_base.env