From 26dc69be54a4bc20bd27aa1d97c995ebde8e4acd Mon Sep 17 00:00:00 2001 From: David Garcia Date: Tue, 14 Jul 2020 13:04:30 +0200 Subject: [PATCH] Update test procedures for VNF Proxy charms, native charms, vnf relations, ns relations. Add ha-proxy-charm procedure --- 02-osm-nfvi-test-plan.md | 355 +++++++++++++++++++++++++-------------- 03-osm-rel8-tests.md | 75 +++++++++ 2 files changed, 305 insertions(+), 125 deletions(-) diff --git a/02-osm-nfvi-test-plan.md b/02-osm-nfvi-test-plan.md index 91f193b..9a82eb8 100644 --- a/02-osm-nfvi-test-plan.md +++ b/02-osm-nfvi-test-plan.md @@ -92,9 +92,9 @@ openstack image create --file intel_gen.qcow --container-format bare --disk-form 1. Create VIM ```bash - osm vim-create --name  --account_type openstack --auth_url  --user  --password  -- tenant  --description "my description" - # The config dictionary should have the relevant options for accessing the NB API via TLS -     --config '{...}' + osm vim-create --name --account_type openstack --auth_url --user --password -- tenant --description "my description" + # The config dictionary should have the relevant options for accessing the NB API via TLS + --config '{...}' ``` 2. Check metrics at Prometheus, visiting [`http://[OSM_IP]:9091`](http://[OSM_IP]:9091) and looking for `osm_vim_status` metric. @@ -103,31 +103,31 @@ openstack image create --file intel_gen.qcow --container-format bare --disk-form 3. Delete VIM ```bash - osm vim-delete | + osm vim-delete | ``` ### \[BASIC-02\] Basic VNF ```bash -osm vnpkg-create hackfest_basic_vnf.tar.gz -osm nspkg-create hackfest_basic_ns.tar.gz -osm ns-create --ns_name hackfest1 --nsd_name hackfest_basic-ns --vim_account | --ssh_keys  --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' -osm ns-list -osm ns-show hackfest1 +osm vnpkg-create hackfest_basic_vnf.tar.gz +osm nspkg-create hackfest_basic_ns.tar.gz +osm ns-create --ns_name hackfest1 --nsd_name hackfest_basic-ns --vim_account | --ssh_keys --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' +osm ns-list +osm ns-show hackfest1 osm vnf-list --ns hackfest1 -ssh -i  ubuntu@ -osm ns-delete hackfest1 +ssh -i ubuntu@ +osm ns-delete hackfest1 ``` ### \[BASIC-03\] Multi-VDU VNF ```bash -osm vnpkg-create hackfest_multivdu_vnf.tar.gz -osm nspkg-create hackfest_multivdu_ns.tar.gz -osm ns-create --ns_name hackfest2 --nsd_name hackfest_multivdu-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' -osm ns-list -osm ns-show hackfest2 -# The management VMs, as declared in the NSD, have to be connected to VIM network "mgmt". +osm vnpkg-create hackfest_multivdu_vnf.tar.gz +osm nspkg-create hackfest_multivdu_ns.tar.gz +osm ns-create --ns_name hackfest2 --nsd_name hackfest_multivdu-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' +osm ns-list +osm ns-show hackfest2 +# The management VMs, as declared in the NSD, have to be connected to VIM network "mgmt". osm vnf-list --ns hackfest2 # Get some variables MGMT_IP_VNF1=`osm vnf-list --ns hackfest2 |awk '$8=="1" {print $14}'` @@ -140,9 +140,9 @@ VNF2_ID=`osm vnf-list --ns hackfest2 |awk '$8=="2" {print $2}'` osm vnf-show $VNF2_ID --literal |grep dataVM-eth0 dataVM_IP_VNF2=`osm vnf-show $VNF2_ID --literal |grep dataVM-eth0|awk '{print $3}' |awk -F "," '{print $1}'` # SSH to mgmtVM of each VNF and get IP addresses -ssh osm@ (pwd: osm4u) +ssh osm@ (pwd: osm4u) ip a l -ssh osm@ (pwd: osm4u) +ssh osm@ (pwd: osm4u) ip a l # Then ping from mgmtVM in VNF1 to mgmtVM in VNF2, and vice-versa with different packet sizes (64, 100, 1500, 9000) # In mgmtVM of VNF1: @@ -150,27 +150,27 @@ for i in 56 92 1492 8992; do ping -s $i -c 3 -W 1 ; done # In mgmtVM of VNF2: for i in 56 92 1492 8992; do ping -s $i -c 3 -W 1 ; done # Jump to dataVM of each VNF from mgmtVM -ssh osm@ (pwd: osm4u) +ssh osm@ (pwd: osm4u) ip a l ip a l -ssh osm@ (pwd: osm4u) +ssh osm@ (pwd: osm4u) # Then ping from dataVM in VNF1 to dataVM in VNF2, and vice-versa with different packet sizes (64, 100, 1500, 9000) # In mgmtVM of VNF1: for i in 56 92 1492 8992; do ping -s $i -c 3 -W 1 ; done # In mgmtVM of VNF2: for i in 56 92 1492 8992; do ping -s $i -c 3 -W 1 ; done -osm ns-delete hackfest2 +osm ns-delete hackfest2 ``` In addition, to test that it is possible to specify management IP addresses as parameters at instantiation time: ```bash -osm ns-create --ns_name hackfest2 --nsd_name hackfest_multivdu-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: , vnfd-connection-point-ref: [ {member-vnf-index-ref: "1", vnfd-connection-point-ref: vnf-mgmt, ip-address:  }]}]}' -osm ns-show hackfest2 +osm ns-create --ns_name hackfest2 --nsd_name hackfest_multivdu-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: , vnfd-connection-point-ref: [ {member-vnf-index-ref: "1", vnfd-connection-point-ref: vnf-mgmt, ip-address: }]}]}' +osm ns-show hackfest2 osm vnf-list --ns hackfest2 # Get some variables MGMT_IP_VNF1=`osm vnf-list --ns hackfest2 |awk '$8=="1" {print $14}'` -ssh osm@ (pwd: osm4u) +ssh osm@ (pwd: osm4u) ip a l # Check that the IP address was the one assigned as instantiation parameter ``` @@ -178,17 +178,17 @@ ip a l ### \[BASIC-04\] VNF with cloud-init ```bash -osm vnfpkg-create hackfest_cloudinit_vnf.tar.gz -osm nspkg-create hackfest_cloudinit_ns.tar.gz -osm ns-create --ns_name hackfest3 --nsd_name hackfest_cloudinit-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' -osm ns-list -osm ns-show hackfest3 -# The management VMs, as declared in the NSD, have to be connected to VIM network "mgmt". +osm vnfpkg-create hackfest_cloudinit_vnf.tar.gz +osm nspkg-create hackfest_cloudinit_ns.tar.gz +osm ns-create --ns_name hackfest3 --nsd_name hackfest_cloudinit-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' +osm ns-list +osm ns-show hackfest3 +# The management VMs, as declared in the NSD, have to be connected to VIM network "mgmt". osm vnf-list --ns hackfest3 -ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init -sudo ls /root/helloworld.txt    # The file has been injected via cloud-init -sudo cat /root/helloworld.txt   # The file has been injected via cloud-init -osm ns-delete hackfest3 +ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init +sudo ls /root/helloworld.txt # The file has been injected via cloud-init +sudo cat /root/helloworld.txt # The file has been injected via cloud-init +osm ns-delete hackfest3 ``` ### \[BASIC-05\] Instantiation parameters in cloud-init @@ -220,35 +220,39 @@ osm ns-delete hackfest3 ### \[BASIC-06\] VNF with charm +[VNFD Package](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ha_proxy_charm_vnf) + +[NSD Package](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ha_proxy_charm_ns) + ```bash -osm vnfpkg-create hackfest_proxycharm_vnf.tar.gz -osm nspkg-create hackfest_proxycharm_ns.tar.gz -osm ns-create --ns_name hackfest5 --nsd_name hackfest_proxycharm-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' -osm ns-list -osm ns-show hackfest5 -osm vnf-list --ns hackfest5 -# Connect to both VNFs and check that the file /home/ubuntu/first-touch exists -ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init -ls /home/ubuntu/first-touch   #This file is created by the charm -ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init -ls /home/ubuntu/first-touch   #This file is created by the charm -osm ns-action hackfest5 --vnf_name 1 --action_name touch --params '{filename: /home/ubuntu/mytouch1}' -#Returns an operation ID -osm ns-op-list hackfest5 -osm ns-op-show OP_ID1 -# Wait until the operation is marked as COMPLETED. -osm ns-action hackfest5 --vnf_name 2 --action_name touch --params '{filename: /home/ubuntu/mytouch2}' -# Returns an operation ID -osm ns-op-list hackfest5 -osm ns-op-show OP_ID2 -# Wait until the operation is marked as COMPLETED. -# There should be three operations (1 instantiate, 2 actions), all of them COMPLETED. Otherwise, test 045 failed. -# Connect to both VNFs and check that the files were created from the actions -ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init -ls /home/ubuntu/mytouch1   #This file is created by the primitive -ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init -ls /home/ubuntu/mytouch2   #This file is created by the primitive -osm ns-delete hackfest5 +osm nfpkg-create ha_proxy_charm_vnf +osm nspkg-create ha_proxy_charm_ns +osm ns-create --ns_name basic-06-proxy-charm --nsd_name ha_proxy_charm-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' +osm ns-list +osm ns-show basic-06-proxy-charm +osm vnf-list --ns basic-06-proxy-charm +# Connect to both VNFs and check that the file /home/ubuntu/first-touch exists +ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init +ls /home/ubuntu/first-touch #This file is created by the charm +ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init +ls /home/ubuntu/first-touch #This file is created by the charm +osm ns-action basic-06-proxy-charm --vnf_name 1 --action_name touch --params '{filename: /home/ubuntu/mytouch1}' +#Returns an operation ID +osm ns-op-list basic-06-proxy-charm +osm ns-op-show OP_ID1 +# Wait until the operation is marked as COMPLETED. +osm ns-action basic-06-proxy-charm --vnf_name 2 --action_name touch --params '{filename: /home/ubuntu/mytouch2}' +# Returns an operation ID +osm ns-op-list basic-06-proxy-charm +osm ns-op-show OP_ID2 +# Wait until the operation is marked as COMPLETED. +# There should be three operations (1 instantiate, 2 actions), all of them COMPLETED. Otherwise, test 045 failed. +# Connect to both VNFs and check that the files were created from the actions +ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init +ls /home/ubuntu/mytouch1 #This file is created by the primitive +ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init +ls /home/ubuntu/mytouch2 #This file is created by the primitive +osm ns-delete basic-06-proxy-charm ``` ### \[BASIC-07\] Secure key management @@ -330,7 +334,7 @@ osm ns-delete hackfest5 3. Deploy in the VIM created in step 1 ```bash - osm ns-create --ns_name noPortSecurity --nsd_name hackfest_multivdu-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' + osm ns-create --ns_name noPortSecurity --nsd_name hackfest_multivdu-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' osm ns-list osm ns-show noPortSecurity osm ns-show noPortSecurity --literal @@ -363,7 +367,7 @@ osm ns-show hfmetrics Scale the VNF: ```bash -osm vnf-scale --scale-out --scaling-group vdu_autoscale hfmetrics 1 +osm vnf-scale --scale-out --scaling-group vdu_autoscale hfmetrics 1 ``` Check that the SCALE operation has completed. @@ -425,46 +429,56 @@ osm vnf-show ``` 1. Download and import the following packages: - - [`Native ns.tar.gz`](https://osm.etsi.org/wiki/index.php/File:Native_ns.tar.gz) - - [`Native vnf.tar.gz`](https://osm.etsi.org/wiki/index.php/File:Native_vnf.tar.gz) + - [`VNFD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/native_charm_vnf) + - [`NSD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/native_charm_ns) 2. Onboard the packages: ```bash - osm upload-package Native_vnf.tar.gz - osm upload-package Native_ns.tar.gz - ``` -3. Onboard the Ubuntu image to your VIM. E.g.: - ```bash - wget https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img - openstack image create --file="./xenial-server-cloudimg-amd64-disk1.img" \ - --container-format=bare \ - --disk-format=qcow2 \ - ubuntu-16.04 + osm nfpkg-create native_charm_vnf + osm nspkg-create native_charm_ns ``` -4. Instantiate the Network Service: +3. Instantiate the Network Service: ```bash - osm ns-create --ns_name test_native_charm --nsd_name native-ns --vim_account | + osm ns-create --ns_name basic-11-native-charms --nsd_name native_charm-ns --vim_account | ``` -5. Wait for operational to become `running`, config status to be `configured`, and detailed status to be `done`. +5. Wait for ns state to become `READY`, and current operation to be `IDLE`. 6. Switch to the Juju model for this network service (the id of the ns instance via `osm ns-list`). ```bash - juju switch ce024838-5c81-47b6-8976-adcb9d17ef57 + juju switch ec73e48c-ed4d-45a3-9b8e-b5eee85bb01d ``` 7. Run `juju status`: ```text - Model Controller Cloud/Region Version SLA Timestamp - ce024838-5c81-47b6-8976-adcb9d17ef57 osm localhost/localhost 2.5.8 unsupported 20:38:24Z + Model Controller Cloud/Region Version SLA Timestamp + ec73e48c-ed4d-45a3-9b8e-b5eee85bb01d controller lxd-cloud/default 2.8.1 unsupported 12:22:35+02:00 - App Version Status Scale Charm Store Rev OS Notes - test-b-mgmtvm-aa active 1 native-ci local 0 ubuntu + App Version Status Scale Charm Store Rev OS Notes + app-vnf-28083fea5dad-vdu-mgmtvm-cnt-z0 active 1 simple-native local 1 ubuntu + app-vnf-a1f49cf974ed-vdu-mgmtvm-cnt-z0 active 1 simple-native local 0 ubuntu - Unit Workload Agent Machine Public address Ports Message - test-b-mgmtvm-aa/0* active idle 0 172.21.248.95 Ready! + Unit Workload Agent Machine Public address Ports Message + app-vnf-28083fea5dad-vdu-mgmtvm-cnt-z0/0* active idle 1 172.16.100.31 + app-vnf-a1f49cf974ed-vdu-mgmtvm-cnt-z0/0* active idle 0 172.16.100.117 - Machine State DNS Inst id Series AZ Message - 0 started 172.21.248.95 manual:172.21.248.95 xenial Manually provisioned machine + Machine State DNS Inst id Series AZ Message + 0 started 172.16.100.117 manual:172.16.100.117 bionic Manually provisioned machine + 1 started 172.16.100.31 manual:172.16.100.31 bionic Manually provisioned machine + ``` +8. Verify that `app-vnf-28083fea5dad-vdu-mgmtvm-cnt-z0/0` and `app-vnf-a1f49cf974ed-vdu-mgmtvm-cnt-z0/0` units are active. +9. Verify that machine 0's and 1's instance id begins with `manual`. +10. List actions and check if day-1 operations have been executed: + ```bash + $ juju show-action-status + actions: + - action: touch + completed at: "2020-07-14 10:18:58" + id: "2" + status: completed + unit: app-vnf-a1f49cf974ed-vdu-mgmtvm-cnt-z0/0 + - action: touch + completed at: "2020-07-14 10:19:05" + id: "4" + status: completed + unit: app-vnf-28083fea5dad-vdu-mgmtvm-cnt-z0/0 ``` -8. Verify that the `test-b-mgmtvm-aa/0` unit is active. -9. Verify that machine 0's instance id begins with `manual`. ### \[BASIC-12\] NS primitives @@ -545,26 +559,45 @@ osm vnf-show 1. Download the following packages: ```bash - wget https://osm-download.etsi.org/ftp/Packages/hackfests/mysql_epa_vnf.tar.gz - wget https://osm-download.etsi.org/ftp/Packages/hackfests/wordpress_epa_vnf.tar.gz - wget https://osm-download.etsi.org/ftp/Packages/hackfests/wordpress_mysql_epa_ns.tar.gz + - [`VNFD Package 1`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ns_relations_requires_vnf) + - [`VNFD Package 2`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ns_relations_provides_vnf) + - [`NSD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ns_relations_ns) ``` 2. Onboard the packages: ```bash - osm upload-package mysql_epa_vnf.tar.gz - osm upload-package wordpress_epa_vnf.tar.gz - osm upload-package wordpress_mysql_epa_ns.tar.gz + osm nfpkg-create ns_relations_requires_vnf + osm nfpkg-create ns_relations_provides_vnf + osm nspkg-create ns_relations_ns ``` 3. Instantiate the Network Service: ```bash - osm ns-create --ns_name nsrelations --nsd_name wordpress_mysql_epa --vim_account | + osm ns-create --ns_name nsrelations --nsd_name ns_relations-ns --vim_account | ``` -5. Wait for operational to become `running`, config status to be `configured`, and detailed status to be `done`. +5. Wait for ns state to become `READY`, and current operation to be `IDLE`. 6. Switch to the Juju model for this network service (the id of the ns instance via `osm ns-list`): ```bash - juju switch ce024838-5c81-47b6-8976-adcb9d17ef57 + juju switch 1cc0f5d3-cb20-432a-bb20-82bd026f3a7a ``` 7. Run `juju status --relations` + ```text + Model Controller Cloud/Region Version SLA Timestamp + 1cc0f5d3-cb20-432a-bb20-82bd026f3a7a controller lxd-cloud/default 2.8.1 unsupported 12:42:46+02:00 + + App Version Status Scale Charm Store Rev OS Notes + app-vnf-0c7aa56eaa4b active 1 simple-native-requires local 0 ubuntu + app-vnf-6ba0c9b229c5 active 1 simple-native-provides local 0 ubuntu + + Unit Workload Agent Machine Public address Ports Message + app-vnf-0c7aa56eaa4b/0* active idle 1 172.16.100.69 + app-vnf-6ba0c9b229c5/0* active idle 0 172.16.100.182 + + Machine State DNS Inst id Series AZ Message + 0 started 172.16.100.182 manual:172.16.100.182 bionic Manually provisioned machine + 1 started 172.16.100.69 manual:172.16.100.69 bionic Manually provisioned machine + + Relation provider Requirer Interface Type Message + app-vnf-6ba0c9b229c5:interface app-vnf-0c7aa56eaa4b:interface interface regular + ``` 8. Verify that the relation is listed. ### \[BASIC-14\] VNF relations @@ -575,25 +608,42 @@ osm vnf-show ``` 1. Download the following packages: - ```bash - wget https://osm-download.etsi.org/ftp/Packages/hackfests/native_blog_vnf.tar.gz - wget https://osm-download.etsi.org/ftp/Packages/hackfests/native_blog_ns.tar.gz - ``` + - [`VNFD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/vnf_relations_vnf) + - [`NSD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/vnf_relations_ns) 2. Onboard the packages: ```bash - osm upload-package native_blog_vnf.tar.gz - osm upload-package native_blog_ns.tar.gz + osm nfpkg-create vnf_relations_vnf + osm nspkg-create vnf_relations_ns ``` 3. Instantiate the Network Service: ```bash - osm ns-create --ns_name vnfrelations --nsd_name native_blog_ns --vim_account | + osm ns-create --ns_name vnfrelations --nsd_name vnf_relations-ns --vim_account | ``` -4. Wait for operational to become `running`, config status to be `configured`, and detailed status to be `done`. +4. Wait for ns state to become `READY`, and current operation to be `IDLE`. 5. Switch to the Juju model for this network service (the id of the ns instance via `osm ns-list`): ```bash - juju switch ce024838-5c81-47b6-8976-adcb9d17ef57 + juju switch b5186d8f-d579-479d-89fd-0130a18c3c05 ``` 6. Run `juju status --relations` + ```text + Model Controller Cloud/Region Version SLA Timestamp + b5186d8f-d579-479d-89fd-0130a18c3c05 controller lxd-cloud/default 2.8.1 unsupported 12:30:59+02:00 + + App Version Status Scale Charm Store Rev OS Notes + app-vnf-8eb9743b0a39-vdu-ple-provides-cnt-z0 active 1 simple-native-provides local 0 ubuntu + app-vnf-8eb9743b0a39-vdu-ple-requires-cnt-z0 active 1 simple-native-requires local 0 ubuntu + + Unit Workload Agent Machine Public address Ports Message + app-vnf-8eb9743b0a39-vdu-ple-provides-cnt-z0/0* active idle 1 172.16.100.69 + app-vnf-8eb9743b0a39-vdu-ple-requires-cnt-z0/0* active idle 0 172.16.100.182 + + Machine State DNS Inst id Series AZ Message + 0 started 172.16.100.182 manual:172.16.100.182 bionic Manually provisioned machine + 1 started 172.16.100.69 manual:172.16.100.69 bionic Manually provisioned machine + + Relation provider Requirer Interface Type Message + app-vnf-8eb9743b0a39-vdu-ple-provides-cnt-z0:interface app-vnf-8eb9743b0a39-vdu-ple-requires-cnt-z0:interface interface regular + ``` 7. Verify that the relation is listed in the bottom of the status message. ### \[BASIC-15\] RBAC setup @@ -736,6 +786,61 @@ docker service update osm_nbi --force \ -In case of finding any issue during test execution, please report to OSM_TECH@LIST.ETSI.ORG. ``` +### \[BASIC-17\] K8s Proxy Charms + +1. Download the following packages: + - [`VNFD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/k8s_proxy_charm_vnf) + - [`NSD Package`](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/k8s_proxy_charm_ns) +2. Onboard the packages: + ```bash + osm nfpkg-create k8s_proxy_charm_vnf + osm nspkg-create k8s_proxy_charm_ns + ``` +3. Instantiate the Network Service: + ```bash + osm ns-create --ns_name basic-17-k8s-proxy-charm --nsd_name k8s_proxy_charm-ns --vim_account | + ``` +4. Wait for ns state to become `READY`, and current operation to be `IDLE`. +5. Switch to the Juju model for this network service (the id of the ns instance via `osm ns-list`), adding `-k8s` at the end: + ```bash + juju switch cb2918cd-e957-41f7-8e5a-f13b4e0d7fe4-k8s + ``` +6. Run `juju status` + ```text + Model Controller Cloud/Region Version SLA Timestamp + cb2918cd-e957-41f7-8e5a-f13b4e0d7fe4-k8s controller microk8s/localhost 2.8.1 unsupported 12:52:46+02:00 + + App Version Status Scale Charm Store Rev OS Address Notes + app-vnf-89990e3e7182 active 1 simple-k8s-proxy local 1 kubernetes 10.152.183.46 + app-vnf-c609c57ddf8b active 1 simple-k8s-proxy local 0 kubernetes 10.152.183.39 + + Unit Workload Agent Address Ports Message + app-vnf-89990e3e7182/0* active idle 10.1.57.83 + app-vnf-c609c57ddf8b/0* active idle 10.1.57.82 + ``` +7. Verify that the column `OS` in the App level shows `kubernetes` +8. Verify day-1 operations + ```bash + osm vnf-list --ns basic-17-k8s-proxy-charm + # Connect to both VNFs and check that the file /home/ubuntu/first-touch exists + ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init + ls /home/ubuntu/first-touch #This file is created by the charm + ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init + ls /home/ubuntu/first-touch #This file is created by the charm + ``` +9. Execute day-2 operations + ```bash + osm ns-action basic-17-k8s-proxy-charm --vnf_name 1 --action_name touch --params '{filename: /home/ubuntu/mytouch1}' + osm ns-action basic-17-k8s-proxy-charm --vnf_name 2 --action_name touch --params '{filename: /home/ubuntu/mytouch2}' + ``` +10. Verify day-2 operations + ```bash + ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init + ls /home/ubuntu/mytouch1 #This file is created by the charm + ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init + ls /home/ubuntu/mytouch2 #This file is created by the charm + ``` + #### Visibility of packages and instances 1. Check you have a `test_user` and `test_project` from previous test. @@ -1175,7 +1280,7 @@ TODO: Under ellaboration. Similar to above, but with day-2 operations ## Kubernetes and cloud-native -### \[K8s-01\] Creation of Kubernetes cluster from OSM +### \[K8s-01\] Creation of Kubernetes cluster from OSM TODO: Under ellaboration. Deployment of a new Kubernetes cluster from OSM using a NS. @@ -1207,7 +1312,7 @@ TODO: Under ellaboration. Deployment of a new Kubernetes cluster from OSM using osm k8scluster-list ``` -### \[K8s-03\] Deployment of CNF from OSM +### \[K8s-03\] Deployment of CNF from OSM 1. Register the Kubernetes cluster in OSM @@ -1307,12 +1412,12 @@ To be performed only SDN assist is required and an SDNC is available. ### \[EPA-04\] EPA underlay SR-IOV ```bash -osm vnfpkg-create hackfest_epasriov_vnf.tar.gz -osm nspkg-create hackfest_epasriov_ns.tar.gz -osm ns-create --ns_name hackfest4 --nsd_name hackfest_epasriov-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' -osm ns-list -osm ns-show hackfest4 -# The management VMs, as declared in the NSD, have to be connected to VIM network "". +osm vnfpkg-create hackfest_epasriov_vnf.tar.gz +osm nspkg-create hackfest_epasriov_ns.tar.gz +osm ns-create --ns_name hackfest4 --nsd_name hackfest_epasriov-ns --vim_account | --config '{vld: [ {name: mgmtnet, vim-network-name: } ] }' +osm ns-list +osm ns-show hackfest4 +# The management VMs, as declared in the NSD, have to be connected to VIM network "". # Get the management IP address of the VNF in this way: MGMT_IP_VNF1=`osm vnf-list --ns hackfest4 |awk '$8=="1" {print $14}'` MGMT_IP_VNF2=`osm vnf-list --ns hackfest4 |awk '$8=="2" {print $14}'` @@ -1324,9 +1429,9 @@ VNF2_ID=`osm vnf-list --ns hackfest4 |awk '$8=="2" {print $2}'` osm vnf-show $VNF2_ID --literal |grep eth0|grep internal dataVM_IP_VNF2=`osm vnf-show $VNF2_ID --literal |grep eth0|grep internal|awk '{print $3}' |awk -F "," '{print $1}'` #Connect to the mgmt VM of VNF 1 -ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init -ssh -i test4.pem ubuntu@  #Jump to the dataVM -# Do the same in VNF 2 and try to run pktgen using instructions in the next step +ssh ubuntu@ (pwd: osm4u) # The password to the default user has been injected via cloud-init +ssh -i test4.pem ubuntu@ #Jump to the dataVM +# Do the same in VNF 2 and try to run pktgen using instructions in the next step ``` Get the port information from the VIM, required to get the MAC address if the NICs are not Niantic: @@ -1409,7 +1514,7 @@ The expected throughtput in Mpps is 14.8 for 10G ports. For VF in 40G ports, the Finally, delete the NS: ```bash -osm ns-delete hackfest4 +osm ns-delete hackfest4 ``` ### \[EPA-05\] EPA underlay Passthrough @@ -1701,10 +1806,10 @@ dataVM_IP_VNF2=`osm vnf-show VNF2_ID --literal |grep eth0|grep internal|awk '{pr VNF3_ID=`osm vnf-list --ns hackfest-multisegment |awk '$8=="vnf3" {print $2}'` osm vnf-show VNF3_ID --literal |grep eth0|grep internal dataVM_IP_VNF3=`osm vnf-show VNF3_ID --literal |grep eth0|grep internal|awk '{print $3}' |awk -F "," '{print $1}' -# Connect to the mgmt VM of VNF 1 (the password to the default user has been injected via cloud-init) -ssh ubuntu@ (pwd: osm4u) -# Jump to the dataVM -ssh -i test4.pem ubuntu@ +# Connect to the mgmt VM of VNF 1 (the password to the default user has been injected via cloud-init) +ssh ubuntu@ (pwd: osm4u) +# Jump to the dataVM +ssh -i test4.pem ubuntu@ # Ping to the other VMs ping ping diff --git a/03-osm-rel8-tests.md b/03-osm-rel8-tests.md index a0a98db..57f992b 100644 --- a/03-osm-rel8-tests.md +++ b/03-osm-rel8-tests.md @@ -198,6 +198,81 @@ For more details on the current operation, run "osm ns-op-show OPERATION_ID" The network service should be removed fine, without leaving models behind. +### \[PR-02\] HA Proxy Charms + +[VNFD Package](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ha_proxy_charm_vnf) + +[NSD Package](https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/tree/master/charm-packages/ha_proxy_charm_ns) + +Create a params.yaml file that will force 2 units of the vnf-member-index=1 Proxy Charm: + +```yaml +additionalParamsForVnf: + - member-vnf-index: "1" + config-units: 2 +``` + +```bash +$ osm ns-create --ns_name ha-proxy-charms --nsd_name ha_proxy_charm-ns --vim_account openstack --config_file params.yaml +7a8b8fb1-3cea-4e86-8cf3-178771d9ac3a +$ juju switch 7a8b8fb1-3cea-4e86-8cf3-178771d9ac3a +controller:admin/default -> controller:admin/7a8b8fb1-3cea-4e86-8cf3-178771d9ac3a +$ watch -c juju status --color +Model Controller Cloud/Region Version SLA Timestamp +7a8b8fb1-3cea-4e86-8cf3-178771d9ac3a controller lxd-cloud/default 2.8.0 unsupported 12:42:29+02:00 + +App Version Status Scale Charm Store Rev OS Notes +app-vnf-3922753a5d75 active 2 simple-ha-proxy local 0 ubuntu +app-vnf-feba90bf85a7 active 1 simple-ha-proxy local 1 ubuntu + +Unit Workload Agent Machine Public address Ports Message +app-vnf-3922753a5d75/0* active idle 0 10.54.156.223 +app-vnf-3922753a5d75/1 active idle 2 10.54.156.29 +app-vnf-feba90bf85a7/0* active idle 1 10.54.156.128 + +Machine State DNS Inst id Series AZ Message +0 started 10.54.156.223 juju-cf61c0-0 xenial Running +1 started 10.54.156.128 juju-cf61c0-1 xenial Running +2 started 10.54.156.29 juju-cf61c0-2 xenial Running +``` + +We can see there are two units for the Proxy Charm of the vnf-member-index=1. The units that have `*` are the leaders. Now we will remove leader machine of the scaled Proxy Charm. + +```bash +$ juju remove-machine 0 --force +$ juju status +Model Controller Cloud/Region Version SLA Timestamp +7a8b8fb1-3cea-4e86-8cf3-178771d9ac3a controller lxd-cloud/default 2.8.0 unsupported 12:48:27+02:00 + +App Version Status Scale Charm Store Rev OS Notes +app-vnf-3922753a5d75 active 1 simple-ha-proxy local 0 ubuntu +app-vnf-feba90bf85a7 active 1 simple-ha-proxy local 1 ubuntu + +Unit Workload Agent Machine Public address Ports Message +app-vnf-3922753a5d75/1* active idle 2 10.54.156.29 +app-vnf-feba90bf85a7/0* active idle 1 10.54.156.128 + +Machine State DNS Inst id Series AZ Message +1 started 10.54.156.128 juju-cf61c0-1 xenial Running +2 started 10.54.156.29 juju-cf61c0-2 xenial Running +``` + +Now the second unit is the leader. Let's execute an action. + +```bash +$ osm ns-action ha-proxy-charms --vnf_name 1 --action_name touch --params '{filename: /home/ubuntu/mysecondunit}' +c4a32267-8d62-4751-9c0f-8c0f65b9ccc7 +$ osm ns-op-list ha-proxy-charms ++--------------------------------------+-------------+-------------+-----------+---------------------+--------+ +| id | operation | action_name | status | date | detail | ++--------------------------------------+-------------+-------------+-----------+---------------------+--------+ +| 3bc998b2-f120-485b-bbfd-6965e800b960 | instantiate | N/A | COMPLETED | 2020-07-13T12:41:10 | - | +| c4a32267-8d62-4751-9c0f-8c0f65b9ccc7 | action | touch | COMPLETED | 2020-07-13T12:49:34 | - | ++--------------------------------------+-------------+-------------+-----------+---------------------+--------+ +``` + +The action has been successfully executed. + ## Kubernetes Features ### [K8S-01] Kubernetes Proxy Charms -- GitLab