@@ -108,7 +108,8 @@ cd devops/descriptor-packages/tools
-a --image nextepc-spgwmme-base --vcpu 2 --memory 4096 --storage 10 \
--interfaces 3 --vendor OSM_VNFONB_TF --nsd vEPC
```
2. Modify the VNFD (at ~/vEPC/vEPC_vnfd/vEPC_vnfd.yaml), to replace the names of our first VDU and its connection points.
- Modify the VNFD (at ~/vEPC/vEPC_vnfd/vEPC_vnfd.yaml), to replace the names of our first VDU and its connection points.
```
...
vdu:
@@ -139,7 +140,8 @@ cd devops/descriptor-packages/tools
internal-connection-point-ref: spgwmme-s6a
...
```
3. Add the second VDU, you can copy and paste the first one, adapting the number of interfaces and VM Flavor.
- Add the second VDU, you can copy and paste the first one, adapting the number of interfaces and VM Flavor.
```
...
vdu:
@@ -166,7 +168,8 @@ cd devops/descriptor-packages/tools
external-connection-point-ref: hss-s6a
...
```
4. Modify the s6a connection point to be 'internal' one, mapped to internal CPs and VLD to interconnect both VDUs.
- Modify the s6a connection point to be 'internal' one, mapped to internal CPs and VLD to interconnect both VDUs.
```
...
vdu:
@@ -207,7 +210,8 @@ cd devops/descriptor-packages/tools
name: s6a
...
```
5. Modify the external connection points that will be exposed to the Network Service level, and set the management one.
- Modify the external connection points that will be exposed to the Network Service level, and set the management one.
```
...
connection-point:
@@ -219,7 +223,8 @@ cd devops/descriptor-packages/tools
cp: spgwmme-mgmt
...
```
6. We will set a particular subnet prefix for our internal VLD, to be able to set our own IP addresses at instantiation time.
- We will set a particular subnet prefix for our internal VLD, to be able to set our own IP addresses at instantiation time.
```
...
ip-profiles:
@@ -236,7 +241,8 @@ cd devops/descriptor-packages/tools
ip-profile-ref: s6a
...
```
7. Now, let's add the EPA requirements to the SPGW VDU.
- Now, let's add the EPA requirements to the SPGW VDU.
```
...
vdu:
@@ -259,7 +265,8 @@ cd devops/descriptor-packages/tools
external-connection-point-ref: spgwmme-sgi
...
```
8. Finally, let's specify the cloud-init file names in the descriptor, and copy them to the corresponding folder (~/vEPC/vEPC_vnfd/cloud_init/)
- Finally, let's specify the cloud-init file names in the descriptor, and copy them to the corresponding folder (~/vEPC/vEPC_vnfd/cloud_init/)
```
...
vdu:
@@ -274,7 +281,7 @@ cd devops/descriptor-packages/tools
## Building the VNF Package for Day-1
1. Let's start with the SPGW day-1 operations by populating the descriptor with 'initial config primitives'. The management interface is already set at the "spgw_mgmt" CP, so OSM will connect to this machine when defining a configuration at the VNF level. A 'config' primitive is required to pass the parameters for SSH connection.
- Let's start with the SPGW day-1 operations by populating the descriptor with 'initial config primitives'. The management interface is already set at the "spgw_mgmt" CP, so OSM will connect to this machine when defining a configuration at the VNF level. A 'config' primitive is required to pass the parameters for SSH connection.
The only parameter that is auto-populated is 'rw_mgmt_ip' (the management IP address), the other ones will need to be provided at instantiation time.
Note that we are setting names for primitives (operations), order of execution, parameters, and the juju charm that will implement all of them.
```
@@ -305,7 +312,8 @@ Note that we are setting names for primitives (operations), order of execution,
charm: spgwcharm
...
```
2. Now, let's modify the descriptor to include operations for the HSS VDU. For this, we will use a configuration block at the VDU level, and specify the management interface for this particular VDU.
- Now, let's modify the descriptor to include operations for the HSS VDU. For this, we will use a configuration block at the VDU level, and specify the management interface for this particular VDU.
```
...
vdu:
@@ -343,7 +351,8 @@ Note that we are setting names for primitives (operations), order of execution,
charm: hsscharm
...
```
2. Finally, we need to build the 'spgwcharm' and 'hsscharm' that will implement these operations. Let's start with the SPGW.
- Finally, we need to build the 'spgwcharm' and 'hsscharm' that will implement these operations. Let's start with the SPGW.
```
# Prepare the environment
snap install charm --classic
@@ -477,7 +486,8 @@ def restart_spgw():
charms.sshproxy._run(cmd)
remove_flag('actions.restart-spgw')
```
3. Proceed in a similar way for the HSS, and provide the following contents to the reactive file:
- Proceed in a similar way for the HSS, and provide the following contents to the reactive file:
```
from charms.reactive import when, when_not, set_flag
@@ -515,12 +525,13 @@ def restart_hss():
charms.sshproxy._run(cmd)
remove_flag('actions.restart-hss')
```
4. Charms need to be built and copied into the package, but we can do this in a later stage after Day-2 operations have been defined.
- Charms need to be built and copied into the package, but we can do this in a later stage after Day-2 operations have been defined.
## Building the VNF Package for Day-2
1. As defined earlier, the only VDU containing reconfiguration primitives is the SPGW. Let's add it to the descriptor first. We can define default values in this kind of primitive.
- As defined earlier, the only VDU containing reconfiguration primitives is the SPGW. Let's add it to the descriptor first. We can define default values in this kind of primitive.
```
...
vnf-configuration:
@@ -535,7 +546,8 @@ def restart_hss():
data-type: STRING
default-value: '192.168.2.1'
```
2. Back to the SPGW charm folder, modify the actions.yaml file to include this new primitive, ading the respective executable file at the 'actions' folder, and finally adding the primitive at the 'reactive' file.
- Back to the SPGW charm folder, modify the actions.yaml file to include this new primitive, ading the respective executable file at the 'actions' folder, and finally adding the primitive at the 'reactive' file.
```
# Modify the actions.yaml file
...
@@ -586,7 +598,8 @@ def add_route():
charms.sshproxy._run(cmd)
remove_flag('actions.add-route')
```
3. Build both charms and copy them to the VNF folder
- Build both charms and copy them to the VNF folder
1. To test the VNF package, you need to first include it into a NS Package created in an earlier stage. Its content should be similar to the following one, where VLDs are mapped to the external connection points of the VNF, and external networks are expected to be already present at the VIM ('vim-network-name' attribute)
- To test the VNF package, you need to first include it into a NS Package created in an earlier stage. Its content should be similar to the following one, where VLDs are mapped to the external connection points of the VNF, and external networks are expected to be already present at the VIM ('vim-network-name' attribute)
Note that, for this example, we are setting some IP address values, to be requested to the VIM's IPAM (subnet should match at the VIM), to match some pre-existing configurations inside the VNF.
```
nsd:nsd-catalog:
@@ -676,14 +690,16 @@ nsd:nsd-catalog:
vnfd-connection-point-ref: spgwmme-sgi
ip-address: 192.168.2.11
```
2. Compress both packages and upload them to OSM.
- Compress both packages and upload them to OSM.
```
tar -cvzf vepc_vnfd.tar.gz vepc_vnfd/
tar -cvzf vepc_nsd.tar.gz vepc_nsd/
osm vnfd-create vepc_vnfd.tar.gz
osm nsd-create vepc_nsd.tar.gz
```
3. Prepare a file with the instantiaton parameters. Note that it also includes a 'vnf' block that modifies the internal VLD at instantiation time to set its IP addresses (at VIM IPAM level) so they match with the ones we are providing.
- Prepare a file with the instantiaton parameters. Note that it also includes a 'vnf' block that modifies the internal VLD at instantiation time to set its IP addresses (at VIM IPAM level) so they match with the ones we are providing.
```
additionalParamsForVnf:
- member-vnf-index: '1'
@@ -702,27 +718,32 @@ vnf:
- id-ref: hss-s6a
ip-address: 10.0.6.20
```
4. Instantiate the VNF! Make sure you have registered a VIM with the compute and EPA requirements you need for the VNF.
- Instantiate the VNF! Make sure you have registered a VIM with the compute and EPA requirements you need for the VNF.
5. Monitor the primitives execution status and NS status with the following commands. Remember that the instantiation flow from Release 6 onwards is as follows: (1) Charm execution enviroment preparation, (2) VM Instantiation, (3) Primitives execution
- Monitor the primitives execution status and NS status with the following commands. Remember that the instantiation flow from Release 6 onwards is as follows: (1) Charm execution enviroment preparation, (2) VM Instantiation, (3) Primitives execution
```
osm ns-list
juju switch [NS_ID]
juju status
juju debug-log
```
6. When the NS reaches the 'configured' state, ssh to the HSS or SPGW/MME, and check if the HSS - MME session is established. This means that Day-1 operations worked.
- When the NS reaches the 'configured' state, ssh to the HSS or SPGW/MME, and check if the HSS - MME session is established. This means that Day-1 operations worked.
sctp 0 0 10.0.6.15:3868 10.0.6.20:55662 ESTABLISHED
```
7. We can also test Day-2 reconfiguration operations by running the primitive that adds routes to the SPGW (no host routes allowed in this example). This can be done through the OSM UI or the CLI, for example:
- We can also test Day-2 reconfiguration operations by running the primitive that adds routes to the SPGW (no host routes allowed in this example). This can be done through the OSM UI or the CLI, for example:
8. Finally, visit the Prometheus GUI at OSM IP (port 9091), or Grafana Dashboard at port 3000 (if the PM Stack was installed) and look for the 'osm_cpu_utilization' and 'osm_average_memory_utilization' metrics.
- Finally, visit the Prometheus GUI at OSM IP (port 9091), or Grafana Dashboard at port 3000 (if the PM Stack was installed) and look for the 'osm_cpu_utilization' and 'osm_average_memory_utilization' metrics.