The heat template must define each of the two CF VMs being used by the VNF. This definition includes configuring the port that connects to the DI internal network, as well as the port that connects to the CF management network, specifying the StarOS boot parameter file and the StarOS Day 0 configuration file. The definition of the first CF is shown here with an explanation; the second CF is defined in a similar way.
CF DI Internal Network
This section creates the CF DI internal network. Use this section twice, once for each of
the two CFs that must be configured. # is either 1 or 2.
# Port connected to unique DI-network
qvpc_cf_0#_port_int:
type: OS::Neutron::Port
properties:
network: {get_param: network_di_internal}
allowed_address_pairs:
-ip_address: "172.16.0.0/18"
qvpc_cf_#_port_int is port connected to the DI internal network. The value of the network is extracted from the parameter network_di_internal which is retrieved from the ENV file.
The property allowed_address_pairs must be in each di-internal port. Because the di_internal port is assigned an IP address by the VPC-DI in the 17.16.0.0/18 network which is different from its address in neutron, we need to configure the allowed_address_pairs property to allow traffic on those address to pass through the port. The allowed address pair extension extends the port attribute to enable you to specify arbitrary MAC address or IP address (CIDR) pairs that are allowed to pass through a port regardless of the subnet associated with the network.
CF Management Network
This section creates the CF management network. Use this section twice, once for each of
the two CFs that must be configured. # is either 1 or 2.
# Port connected to the management network
qvpc_cf_0#_port_mgmt:
type: OS::Neutron::Port
properties:
network: {get_param: network_di_mgmt}
allowed_address_pairs:
- ip_address: {get_param: qvpc_vip_addr}
qvpc_cf_#_port_mgmt represents the port definition
of the port connected to the OAM network. The value is extracted from the
parameter
network_di_mgmt
which is retrieved from the ENV file.
SSH Keys
DI inter-VM communication is now only possible via authentication through externally supplied SSH keys. These keys are passed as part of the HEAT deployment. Public and private keys are required.
Generate the public and private SSH keys. Create a file called user_key.pub containing the public key. Create a file called user_key containing the private key. Ensure that both of these files are stored on the configuration drive. These files are referenced by HEAT:
personality:
"user_key.pub": |
ssh-rsa
<public_key>
"user_key": |
-----BEGIN RSA PRIVATE KEY-----
<private_key>
-----END RSA PRIVATE KEY-----
Create CF VM
This section creates the CF VM. Use this section twice, once for each of the two CFs that
must be created. # is either 1 or 2.
qvpc_cf_0#:
type: OS::Nova::Server
properties:
# Create VM of format “<vnf_name>_cf_0#”
name:
str_replace:
template: ${VF_NAME}_cf_0#
params:
${VF_NAME}: {get_param: vnf_name}
# Use active CF image and CF Flavor
image: {get_param: qvpc_image_cf1 }
flavor: {get_param: flavor_cf }
networks:
- port: {get_resource: qvpc_cf_0#_port_int}
- port: {get_resource: qvpc_cf_0#_port_mgmt}
config_drive: True
personality:
"user_key.pub": |
ssh-rsa
<public_key>
"user_key": |
-----BEGIN RSA PRIVATE KEY-----
<private_key>
-----END RSA PRIVATE KEY-----
The CF VM (qvpc_cf_#) is created with the previously defined
parameters and named according to the convention "<vnf_name>_cf_#". The
vnf_name is
retrieved from the ENV file as are the image and flavor to be used to create
the VNF.
The personality is the StarOS boot
parameter file and the StarOS Day 0 configuration as described here:
StarOS Boot Parameter File
# Associate Active CF VM to slot-1 in the VNF instance and identify that its a CF
"staros_param.cfg":
str_replace:
template: |
CARDSLOT=$CARD_NUMBER
CARDTYPE=$CARD_TYPE
CPUID=$CPUID
params:
$CARD_NUMBER: 1
$CARD_TYPE: CFC
$CPUID: 0
For information regarding the StarOS boot
parameter file, refer to Configuring Boot Parameters. $Card_Number refers to
the number of the slot, which here is 1, but is 2 for the second CF. The $CPUID is always 0.
StarOS Day 0 Configuration
# Day 0 config for the VNF Instance to configure the OAM interface, OAM user, system hostname and enable ssh and sftp access
"staros_config.txt":
str_replace:
template: |
config
system hostname $VF_NAME-cf-$SLOT_CARD_NUMBER
context local
administrator admin password cisco123 ftp
interface LOCAL1
ip address $CF_VIP_ADDR 255.255.255.0
#exit
ip route 0.0.0.0 0.0.0.0 $CF_VIP_GATEWAY LOCAL1
ssh generate key
server sshd
subsystem sftp
#exit
server telnetd
server ftpd
#exit
port ethernet 1/1
bind interface LOCAL1 local
no shutdown
#exit
snmp community public read-only
end
params:
$VF_NAME: {get_param: vnf_name}
$SLOT_CARD_NUMBER: 1
$ADMIN_PASSWD: {get_param: admin_password}
$CF_VIP_ADDR: {get_param: qvpc_vip_addr}
$CF_VIP_GATEWAY: {get_param: qvpc_vip_gateway}
availability_zone: {get_param: availability_zone}
$SLOT_CARD_NUMBER
refers to the number of the slot, which here is 1 but is 2 for the second CF. The other
parameters, including the availability zone are taken from the ENV file.