summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--requirements.txt1
-rwxr-xr-xtox.ini8
-rw-r--r--workloads/ansible/openo/nfv/README.md121
-rw-r--r--workloads/ansible/openo/nfv/group_vars/all21
-rw-r--r--workloads/ansible/openo/nfv/nfv_launch.yml116
-rw-r--r--workloads/ansible/openo/nfv/templates/admin-openrc.sh.j220
7 files changed, 289 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index a752346..88a6cce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,10 +23,8 @@ setuptools*.egg/
23!/.mailmap 23!/.mailmap
24!/.pylintrc 24!/.pylintrc
25!/.testr.conf 25!/.testr.conf
26run/
27*.retry
26 28
27# Files created by releasenotes build 29# Files created by releasenotes build
28releasenotes/build 30releasenotes/build
29
30 Contact GitHub API Training Shop Blog About
31
32
diff --git a/requirements.txt b/requirements.txt
index 48c2f4f..8c39620 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,3 +5,4 @@
5pbr>=1.8 # Apache-2.0 5pbr>=1.8 # Apache-2.0
6ansible>=2.0.0.0 # GNU LGPL 3.0 6ansible>=2.0.0.0 # GNU LGPL 3.0
7shade==1.13.2 # Apache-2.0 7shade==1.13.2 # Apache-2.0
8docker-py==1.9.0 # Apache-2.0
diff --git a/tox.ini b/tox.ini
index 844f5ba..1139c24 100755
--- a/tox.ini
+++ b/tox.ini
@@ -54,3 +54,11 @@ setenv =
54 ANSIBLE_INVENTORY = {env:K8S_DIR}/hosts 54 ANSIBLE_INVENTORY = {env:K8S_DIR}/hosts
55 ANSIBLE_CONFIG = {env:K8S_DIR}/ansible.cfg 55 ANSIBLE_CONFIG = {env:K8S_DIR}/ansible.cfg
56commands = ansible-playbook -e "action=apply {posargs}" {env:K8S_DIR}/site.yml 56commands = ansible-playbook -e "action=apply {posargs}" {env:K8S_DIR}/site.yml
57
58[testenv:nfv]
59deps =
60 {[testenv:ansible]deps}
61setenv =
62 {[testenv:ansible]setenv}
63 NFV_DIR = {toxinidir}/workloads/ansible/openo/nfv
64commands = ansible-playbook {env:NFV_DIR}/nfv_launch.yml
diff --git a/workloads/ansible/openo/nfv/README.md b/workloads/ansible/openo/nfv/README.md
new file mode 100644
index 0000000..822181e
--- /dev/null
+++ b/workloads/ansible/openo/nfv/README.md
@@ -0,0 +1,121 @@
1# NFV Ansible deployments on OpenStack Cloud
2
3This ansible playbook will install an OPEN-O first then deploy
4Clearwater vIMS by OPEN-O.
5
6Once the script finishes, a vIMS is ready to be used.
7
8## Status
9
10Complete
11
12## Requirements
13
14- [Install Ansible](http://docs.ansible.com/ansible/intro_installation.html)
15- [Install docker-py 1.9.0](https://github.com/docker/docker-py)
16- Make sure there is a VM to be used to install OPEN-O.
17
18 It should meet the requirements below
19
20 - at least 4 CPUs, 64G RAM, 100G Disk
21
22- Make sure the OpenStack cloud is able to deploy at least 7 nodes.
23
24 Each node requires resources as below
25
26 - 1 CPU, 2G RAM, 2G RAM, 20G Disk
27
28- Clone this project into a directory to the VM
29
30## Ansible
31
32Ansible will be used to orchestrate the whole process
33
34### Prep
35
36#### General OpenStack Settings
37
38Before running the script, cloud environment authentication needs to be
39provided. Please update the file under group_vars/all
40
41There is one example for your reference
42
43 ##### group_vars/all::
44
45 os_project_domain_name: default
46 os_user_domain_name: default
47 os_username: admin
48 os_password: password
49 os_project_name: admin
50 os_auth_url: http://205.156.212.201:5000/v3
51 os_identity_api_version: 3
52 os_region_name: RegionOne
53
54## Run the script to deploy vIMS with the help of OPEN-O
55
56With your cloud environment set, you should be able to run the script::
57
58 tox -e nfv
59
60The above command will firstly install Ansible and other required packages.
61
62Then, it will deploy OPEN-O, and a vIMS will be set up by
63OPEN-O. This step is done by OPNFV Opera Project.
64
65[OPNFV Opera Project](https://github.com/opnfv/opera)
66
67Also, OPNFV Functest is leveraged to test the vIMS to make sure it is
68working.
69
70[OPNFV Functest Project](https://github.com/opnfv/functest)
71
72## The results of the work load successful run
73
74If everything goes well, it will accomplish the following::
75
76 1. Deploy OPEN-O docker containers
77 2. Create security group
78 3. Add security rules to allow icmp, tcp and ucp ports
79 4. Deploy a VM on OpenStack and install Juju
80 5. Connect Juju with OPEN-O and OpenStack
81 6. Configure OPEN-O with vIMS topology definition
82 7. Deploy vIMS Clearwater via OPEN-O
83 8. Test the vIMS Clearwater by leveraging OPNFV Functest
84 9. Create user on Ellis of vIMS Clearwater
85 10. Create calling number on Ellis of vIMS Clearwater
86
87### Environment Information
88
89- OPEN-O can be accessed through
90
91http://VM_host_IP/openoui/common/default.html
92
93- Calling information is put under {{ playbook_dir }}/run/results/ellis.info
94
95- Log is put under {{ playbook_dir }}/run/results/opera.log
96
97
98## Execution Duration
99
100The process involves pulling 20+ docker images and downloading about nearly 4G
101OpenStack images. The time it takes can be impacted by the network enormously.
102Thus the duration varies from lab to lab. If this step is once run, it will be
103skipped in the future round of execution. One suggestion is to run this step
104in advance to decrease the whole execution duration.
105
106The deployment and configuration of OPEN-O takes approximately 30~40 minutes.
107
108The deployment of vIMS Clearwater takes about 30~40 minutes. It also depends on
109the network as vIMS downloads quite a number of packages.
110
111
112## Next Steps
113
114### Make a call via SIP client
115
116Install the SIP client, e.g. jitsi and configure the client with calling
117information.
118
119### Cleanup
120
121Script is needed to clean up the environment.
diff --git a/workloads/ansible/openo/nfv/group_vars/all b/workloads/ansible/openo/nfv/group_vars/all
new file mode 100644
index 0000000..6773403
--- /dev/null
+++ b/workloads/ansible/openo/nfv/group_vars/all
@@ -0,0 +1,21 @@
1---
2# Licensed under the Apache License, Version 2.0 (the "License"); you may
3# not use this file except in compliance with the License. You may obtain
4# a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11# License for the specific language governing permissions and limitations
12# under the License.
13
14os_project_domain_name: default
15os_user_domain_name: default
16os_username: admin
17os_password: password
18os_project_name: admin
19os_auth_url: http://205.156.212.201:5000/v3
20os_identity_api_version: 3
21os_region_name: RegionOne
diff --git a/workloads/ansible/openo/nfv/nfv_launch.yml b/workloads/ansible/openo/nfv/nfv_launch.yml
new file mode 100644
index 0000000..a142109
--- /dev/null
+++ b/workloads/ansible/openo/nfv/nfv_launch.yml
@@ -0,0 +1,116 @@
1---
2# Licensed under the Apache License, Version 2.0 (the "License"); you may
3# not use this file except in compliance with the License. You may obtain
4# a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11# License for the specific language governing permissions and limitations
12# under the License.
13
14- hosts: localhost
15 remote_user: root
16 max_fail_percentage: 0
17 tasks:
18 - set_fact:
19 starttime: "{{ ansible_date_time }}"
20
21 - set_fact:
22 exec_dir: "{{ playbook_dir }}/run"
23
24 - set_fact:
25 opera_dir: "{{ exec_dir }}/opera"
26
27 - set_fact:
28 results_dir: "{{ exec_dir }}/results"
29
30 - name: Creates execution directory
31 file: path={{ exec_dir }} state=directory
32
33 - name: pull OPNFV Opera code
34 git:
35 repo: https://github.com/opnfv/opera.git
36 dest: "{{ opera_dir }}"
37 update: no
38
39 - name: config admin-openrc.sh
40 template:
41 src: admin-openrc.sh.j2
42 dest: "{{ opera_dir }}/conf/admin-openrc.sh"
43
44 - name: pull OPNFV Functest docker image to test vIMS
45 docker_image:
46 name: yaohelan/functest:stable
47 state: present
48 force: yes
49
50 - name: Creates result directory
51 file: path={{ results_dir }} state=directory
52
53 - name: create the opera log file
54 file: dest={{ results_dir }}/opera.log state=touch
55
56 - name: deploy OPEN-O and vIMS
57 shell: "{{ opera_dir }}/opera_launch.sh > opera.log"
58 args:
59 chdir: "{{ results_dir }}"
60
61 - name: create openstack.creds
62 shell: cp {{ opera_dir }}/conf/admin-openrc.sh {{ opera_dir }}/conf/openstack.creds
63
64 - name: remove OPNFV Functest docker container
65 shell: "docker rm -f functest-opera || true"
66
67 - name: get open-o endpoint
68 shell: . {{ opera_dir }}/work/scripts/open-o.conf; echo $OPENO_IP:$COMMON_SERVICES_MSB_PORT
69 register: openo_endpoint
70
71 - name: Creates Functest result directory
72 file: path={{ results_dir }}/functest state=directory
73
74 - name: run OPNFV Functest docker container
75 command: "docker run -id
76 -v {{ opera_dir }}/conf/openstack.creds:/home/opnfv/functest/conf/openstack.creds
77 -v {{ results_dir }}/functest:/home/opnfv/functest/results
78 -e INSTALLER_TYPE=unknown
79 -e DEPLOY_SCENARIO=unknown
80 -e OPENO_MSB_ENDPOINT={{ item }}
81 -e CI_DEBUG=false
82 --name=functest-opera
83 yaohelan/functest:stable /bin/bash"
84 with_items: "{{ openo_endpoint.stdout_lines }}"
85
86 - name: start OPNFV Functest docker container
87 command: "docker start functest-opera"
88
89 - name: run vIMS test on OPNFV Functest
90 command: docker exec functest-opera python /home/opnfv/repos/functest/functest/ci/run_tests.py -t opera_ims
91
92 - name: copy call information
93 command: docker cp functest-opera:/home/opnfv/functest/results/opera_ims/ellis.info {{ results_dir }}/ellis.info
94
95 - name: get end time
96 shell: date '+%H:%M:%S'
97 register: end_time
98
99 - debug:
100 msg: >-
101 Access OPEN-O dashboard at
102 http://{{ openo_endpoint.stdout_lines }}
103
104 - name: get Ellis call information
105 command: /bin/cat {{ results_dir }}/ellis.info
106 register: details
107
108 - debug:
109 msg: >-
110 Ellis details
111 {{ details.stdout_lines }}
112
113 - debug:
114 msg: >-
115 The work load started at {{ starttime.time }},
116 ended at {{ end_time.stdout }}
diff --git a/workloads/ansible/openo/nfv/templates/admin-openrc.sh.j2 b/workloads/ansible/openo/nfv/templates/admin-openrc.sh.j2
new file mode 100644
index 0000000..bbf8bfa
--- /dev/null
+++ b/workloads/ansible/openo/nfv/templates/admin-openrc.sh.j2
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13export OS_PROJECT_DOMAIN_NAME={{ os_project_domain_name }}
14export OS_USER_DOMAIN_NAME={{ os_user_domain_name }}
15export OS_USERNAME={{ os_username }}
16export OS_PASSWORD={{ os_password }}
17export OS_PROJECT_NAME={{ os_project_name }}
18export OS_AUTH_URL={{ os_auth_url }}
19export OS_IDENTITY_API_VERSION={{ os_identity_api_version }}
20export OS_REGION_NAME={{ os_region_name }}