At this point you have MicroK8s installed, Charmed OSM deployed on top of MicroK8s and MicroStack configured as a VIM. We will now deploy a basic network service to exercise the environment.
Network Service
Download sample NSD (Network Service Descriptor) and VNFD (Virtual Network Function Descriptor):
wget http://bit.ly/basic_vnfd -O hackfest_basic_vnf.tar.gz
wget http://bit.ly/basic_nsd -O hackfest_basic_ns.tar.gz
Then, upload the downloaded packages to OSM:
osmclient.osm upload-package hackfest_basic_vnf.tar.gz
osmclient.osm upload-package hackfest_basic_ns.tar.gz
You can list the existing NSDs and VNFDs with the following commands:
osmclient.osm nsd-list
+-------------------+--------------------------------------+
| nsd name | id |
+-------------------+--------------------------------------+
| hackfest_basic-ns | 1eac876d-4406-4a55-b99a-baee9a672eb6 |
+-------------------+--------------------------------------+
osmclient.osm vnfd-list
+--------------------+--------------------------------------+
| nfpkg name | id |
+--------------------+--------------------------------------+
| hackfest_basic-vnf | d913b8e4-2f92-4c3d-bba0-2a3ad567190d |
+--------------------+--------------------------------------+
Now, as the packages have been uploaded, you can create a basic Network Service:
osmclient.osm ns-create --ns_name hackfest_basic_ns \
--nsd_name hackfest_basic-ns \
--vim_account microstack \
--config '{
vld: [ { name: mgmtnet, vim-network-name: test } ]
}'
/snap/osmclient/37/lib/python2.7/site-packages/osmclient/sol005/ns.py:164: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
ns_config = yaml.load(config)
The Network Service is being deployed. You can check its status by executing the osmclient.osm ns-list
command. Wait until the config status turns to “configured”.
+-------------------+--------------------------------------+--------------------+---------------+-----------------+
| ns instance name | id | operational status | config status | detailed status |
+-------------------+--------------------------------------+--------------------+---------------+-----------------+
| hackfest_basic_ns | acad055e-37f4-4b59-bb31-9a6c3b972be7 | running | configured | done |
+-------------------+--------------------------------------+--------------------+---------------+-----------------+
You can now SSH to the machine that was launched by executing the following command:
IP=`microstack.openstack server list -c Networks -f value --name basic | awk '{ print $2 }'`
ssh ubuntu@$IP -i .ssh/id_microstack
The authenticity of host '10.20.20.24 (10.20.20.24)' can't be established.
ECDSA key fingerprint is SHA256:hJYfYoa70RxYBeWZjYBt6nAVu8vqILW1xbYtnJaDPAo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.20.20.24' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-166-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@hackfest-basic-ns-1-hackfest-basic-vm-1:~$
Network Service with Day-1/Day-2 configuration
The previous Network Service that we deployed was very basic. Now, we will introduce more complexity, by adding Day-1 and Day-2 configuration to the VNF being onboarded using Proxy Charms.
First, let’s remove the existing Network Service:
osmclient.osm ns-delete acad055e-37f4-4b59-bb31-9a6c3b972be7
Then, download NS and VNF descriptors:
wget http://bit.ly/simplecharm_vnfd -O hackfest_simplecharm_vnf.tar.gz
wget http://bit.ly/simplecharm_nsd -O hackfest_simplecharm_ns.tar.gz
Upload the downloaded packages to OSM:
osmclient.osm upload-package hackfest_simplecharm_vnf.tar.gz
osmclient.osm upload-package hackfest_simplecharm_ns.tar.gz
Create the Network Service:
osmclient.osm ns-create --ns_name hackfest_simplecharm_ns \
--nsd_name hackfest_simplecharm-ns \
--vim_account microstack \
--config '{
vld: [ { name: mgmtnet, vim-network-name: test } ]
}'
/snap/osmclient/37/lib/python2.7/site-packages/osmclient/sol005/ns.py:164: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
ns_config = yaml.load(config)
The Network Service is being deployed. Again, you can check its status by executing the osmclient.osm
command. Wait until the config status turns to “configured”.
It can take up to 5 minutes for the Network Service to be deployed.
osmclient.osm ns-list
+-------------------------+--------------------------------------+--------------------+---------------+-----------------+
| ns instance name | id | operational status | config status | detailed status |
+-------------------------+--------------------------------------+--------------------+---------------+-----------------+
| hackfest_simplecharm_ns | ba9d0007-45a7-4bc7-bb66-05c808cd31a5 | running | configured | done |
+-------------------------+--------------------------------------+--------------------+---------------+-----------------+
The action available in this Network Service consists of creating a file inside the VNF at the path specified by the filename parameter.
Execute the action:
osmclient.osm ns-action --action_name touch \
--vnf_name 1 \
--params '{filename: /home/ubuntu/touched}' \
hackfest_simplecharm_ns
/snap/osmclient/37/lib/python2.7/site-packages/osmclient/scripts/osm.py:2808: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
op_data['primitive_params'] = yaml.load(params)
10b41672-e0bc-4cca-ba4e-4607d910ee1e
And check whether the file has been created:
IP=`microstack.openstack server list -c Networks -f value --name simplecharm | awk '{ print $2 }'`
ssh ubuntu@$IP -i .ssh/id_microstack ls
The authenticity of host '10.20.20.24 (10.20.20.24)' can't be established.
ECDSA key fingerprint is SHA256:PhIBx7jV8gTuGK5Hu/tqpEPdiTrg7zzGwHFa2CEbLT0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.20.20.24' (ECDSA) to the list of known hosts.
first-touch
touched