a64a660b5600f323d1ee8bc854c03e353ba3f599
[integration.git] / docs / docs_vCPE.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2    International License. http://creativecommons.org/licenses/by/4.0
3    Copyright 2018 Huawei Technologies Co., Ltd.  All rights reserved.
4
5 .. _docs_vcpe:
6
7 vCPE Use Case
8 ----------------------------
9
10 Description
11 ~~~~~~~~~~~
12 vCPE use case is based on Network Enhanced Residential Gateway architecture specified in Technical Report 317 (TR-317), which defines how service providers deploy residential broadband services like High Speed Internet Access. The use case implementation has infrastructure services and customer service. The common infrastructure services are deployed first and shared by all customers. The use case demonstrates ONAP capabilities to design, deploy, configure and control sophisticated services.      
13
14 More details on the vCPE Use Case can be found on wiki page https://wiki.onap.org/pages/viewpage.action?pageId=3246168
15
16 Source Code
17 ~~~~~~~~~~~
18 vcpe test scripts: https://git.onap.org/integration/tree/test/vcpe?h=dublin
19
20 How to Use
21 ~~~~~~~~~~
22 Most part of the use case has been automated by vcpe scripts. For the details on how to run the scripts, please refer to the use case tutorial on https://wiki.onap.org/display/DW/vCPE+Use+Case+Tutorial%3A+Design+and+Deploy+based+on+ONAP.
23
24 Here are the main steps to run the use case in Integration lab environment, where vCPE script is pre-installed on Rancher node under /root/integration/test/vcpe:
25
26 1. Run Robot script from Rancher node to onboard VNFs, create and distribute models for vCPE four infrastructure services, i.e. infrastructure, brg, bng and gmux
27
28 :: 
29
30    demo-k8s.sh onap init
31  
32 2. Add customer SDN-ETHERNET-INTERNET (see the use case tutorial wiki page for detail)
33
34 3. Add identity-url to RegionOne data in A&AI. First use POSTMAN to GET cloud-region RegionOne data, then add identity-url and PUT back to A&AI
35
36 ::
37
38    GET https://{{aai}}:{{port}}/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne
39
40 ::
41
42    PUT https://{{aai}}:{{port}}/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne
43    {
44        "cloud-owner": "CloudOwner",
45        "cloud-region-id": "RegionOne",
46        "cloud-type": "SharedNode",
47        "owner-defined-type": "OwnerType",
48        "cloud-region-version": "v1",
49        "identity-url": "http://10.12.25.2:5000/v2.0",
50        "cloud-zone": "CloudZone",
51        "resource-version": "1559336510793",
52        "relationship-list": {
53            ... ...
54
55 4. Add route on sdnc cluster VM node, which is the cluster VM node where pod sdnc-sdnc-0 is running on. This will allow ONAP SDNC to configure BRG later on. 
56  
57 ::
58
59    ip route add 10.3.0.0/24 via 10.0.101.10 dev ens3
60
61
62 5. Install Python and other Python libraries
63
64 ::
65  
66    integration/test/vcpe/bin/setup.sh
67
68
69 6. Change the Openstack env parameters and one customer service related parameter in vcpecommon.py
70
71 :: 
72
73     cloud = { 
74         '--os-auth-url': 'http://10.12.25.2:5000',
75         '--os-username': 'xxxxxxxxxx',
76         '--os-user-domain-id': 'default',
77         '--os-project-domain-id': 'default',
78         '--os-tenant-id': 'xxxxxxxxxxxxxxxx' if oom_mode else '1e097c6713e74fd7ac8e4295e605ee1e',
79         '--os-region-name': 'RegionOne',
80         '--os-password': 'xxxxxxxxxxx',
81         '--os-project-domain-name': 'xxxxxxxxx' if oom_mode else 'Integration-SB-07',
82         '--os-identity-api-version': '3' 
83     }   
84
85     common_preload_config = { 
86         'oam_onap_net': 'xxxxxxxx' if oom_mode else 'oam_onap_lAky',
87         'oam_onap_subnet': 'xxxxxxxxxx' if oom_mode else 'oam_onap_lAky',
88         'public_net': 'xxxxxxxxx',
89         'public_net_id': 'xxxxxxxxxxxxx'
90     }   
91
92 ::
93
94     # CHANGEME: vgw_VfModuleModelInvariantUuid is in rescust service csar, open service template with filename like service-VcpesvcRescust1118-template.yml and look for vfModuleModelInvariantUUID under groups vgw module metadata. 
95     self.vgw_VfModuleModelInvariantUuid = 'xxxxxxxxxxxxxxx'
96
97 7. Initialize vcpe
98
99 ::
100    
101    vcpe.py init
102
103 8. Run a command from Rancher node to insert vcpe customer service workflow entry in SO catalogdb. You should be able to see a sql command printed out from the above step output at the end, and use that sql command to replace the sample sql command below (inside the double quote) and run it from Rancher node:
104
105 ::
106
107    kubectl exec dev-mariadb-galera-mariadb-galera-0 -- mysql -uroot -psecretpassword catalogdb -e "INSERT INTO service_recipe (ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, SERVICE_PARAM_XSD, RECIPE_TIMEOUT, SERVICE_TIMEOUT_INTERIM, CREATION_TIMESTAMP, SERVICE_MODEL_UUID) VALUES ('createInstance','1','vCPEResCust 2019-06-03 _04ba','/mso/async/services/CreateVcpeResCustService',NULL,181,NULL, NOW(),'6c4a469d-ca2c-4b02-8cf1-bd02e9c5a7ce')"
108
109 9. Run Robot to create and distribute for vCPE customer service. This step assumes step 1 has successfully distributed all vcpe models except customer service model
110
111 ::
112
113    ete-k8s.sh onap distributevCPEResCust
114
115 10. Instantiate vCPE infra services
116
117 ::
118
119     vcpe.py infra
120
121 11. From Rancher node run vcpe healthcheck command to check connectivity from sdnc to brg and gmux, and vpp configuration of brg and gmux.
122
123 ::
124
125     healthcheck-k8s.py --namespace <namespace name> --environment <env name>
126
127 12. Instantiate vCPE customer service.
128
129 ::
130
131     vcpe.py customer
132
133 13. Update libevel.so in vGMUX VM and restart the VM. This allows vGMUX to send events to VES collector in close loop test. See tutorial wiki for details
134
135 14. Run heatbridge. The heatbridge command usage: demo-k8s.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>, please refer to vCPE tutorial page on how to fill in those paraemters. See an example as following:
136
137 ::
138
139     ~/integration/test/vcpe# ~/oom/kubernetes/robot/demo-k8s.sh onap heatbridge vcpe_vfmodule_e2744f48729e4072b20b_201811262136 d8914ef3-3fdb-4401-adfe-823ee75dc604 vCPEvGMUX 10.0.101.21
140
141 15. Start closed loop test by triggering packet drop VES event, and monitor if vGMUX is restarting. You may need to run the command twice if the first run fails
142
143 :: 
144
145     vcpe.py loop
146
147
148 Test Status
149 ~~~~~~~~~~~~~~~~~~~~~
150 The use case has been tested for Dublin release, the test report can be found on https://wiki.onap.org/display/DW/vCPE+%28Heat%29+-+Dublin+Test+Status
151
152 Known Issues and Workaround
153 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154 1) NATs are installed on BRG and vBNG. In order to allow SDNC to send BRG configuration message through vBNG, SDNC host VM IP address is preloaded on BRG and vBNG during VM instantiation, and provisioned into the NATs. If SDNC changes its host VM, SDNC host VM IP changes and we need to manually update the IP in /opt/config/sdnc_ip.txt. Then run:
155
156 ::
157
158   root>vppctl tap delete tap-0
159   root>vppctl tap delete tap-1
160   root>/opt/nat_service.sh
161   root>vppctl restart
162
163 2) During vCPE customer service instantiation, though vGW should come up successfully BRG vxlan tunnel configuration is likely to fail in SDNC cluster environment due to SDNC unreachable to BRG. See more detail in JIRA INT-1127. One workaround is to run vCPE use case with SDNC cluster disabled.
164
165 3) In some Openstack environments (e.g. Ocata version), there is an issue with DHCP anti-spoofing rules preventing BRG to receive DHCP reply (Option 82) from DHCP. By default Openstack neutron is using *IptablesFirewallDriver*, which is actively inserting *Prevent DHCP Spoofing by VM* rules into linuxbridge firewall rules. This feature should prevent mailicious traffic from rogue VM inside Openstack, however it's affecting also vCPE usecase. Manual tweaking of fw rules is not persistent and those rules are automatically regenerated, but one can disable this logic by switching to *neutron.agent.firewall.NoopFirewallDriver*. More details can be found on https://codesomniac.com/2017/07/how-to-run-a-dhcp-server-as-openstack-instance/
166
167    **NOTE:** To propagate change in firewall_driver one needs to restart neutron-linuxbridge-agent and also openstack-nova-compute services.
168
169    Additionally Neutron's Port Security Extension Driver is by default preventing any routing functions of an instance (be it a router or VNF). Hence for smoothest vCPE experience it's advised to either disable the packet filtering by setting port_security_enabled flag for a network/port to "False" or alternatively add allowed_address_pairs to relevant VNFs ports with appropriate network prefixes. Port security driver can be also disabled globally, for more insight into Port Security Extension Driver please visit https://wiki.openstack.org/wiki/Neutron/ML2PortSecurityExtensionDriver