Update stor4nfv install scripts according to opensds aruba release
[stor4nfv.git] / tutorials / stor4nfv-openstack-scenario.md
1 # OpenSDS Integration with OpenStack on Ubuntu
2
3 All the installation work is tested on `Ubuntu 16.04`, please make sure you have
4 installed the right one.
5
6 ## Environment Prepare
7
8 * OpenStack (Supposed you have deployed)
9 ```shell
10 openstack endpoint list # Check the endpoint of the killed cinder service
11 ```
12
13 * packages
14
15 Install following packages:
16 ```bash
17 apt-get install -y git curl wget
18 ```
19 * docker
20
21 Install docker:
22 ```bash
23 wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_18.03.1~ce-0~ubuntu_amd64.deb
24 dpkg -i docker-ce_18.03.1~ce-0~ubuntu_amd64.deb 
25 ```
26 * golang
27
28 Check golang version information:
29 ```bash
30 root@proxy:~# go version
31 go version go1.9.2 linux/amd64
32 ```
33 You can install golang by executing commands below:
34 ```bash
35 wget https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz
36 tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
37 echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
38 echo 'export GOPATH=$HOME/gopath' >> /etc/profile
39 source /etc/profile
40 ```
41
42 ## Start deployment
43 ### Download opensds-installer code
44 ```bash
45 git clone https://gerrit.opnfv.org/gerrit/stor4nfv
46 cd stor4nfv/ci/ansible
47 ```
48
49 ### Install ansible tool
50 To install ansible, run the commands below:
51 ```bash
52 # This step is needed to upgrade ansible to version 2.4.2 which is required for the "include_tasks" ansible command.
53 chmod +x ./install_ansible.sh && ./install_ansible.sh
54 ansible --version # Ansible version 2.4.x is required.
55 ```
56
57 ### Configure opensds cluster variables:
58 ##### System environment:
59 Change `opensds_endpoint` field in `group_vars/common.yml`:
60 ```yaml
61 # The IP (127.0.0.1) should be replaced with the opensds actual endpoint IP
62 opensds_endpoint: http://127.0.0.1:50040
63 ```
64
65 Change `opensds_auth_strategy` field to `noauth` in `group_vars/auth.yml`:
66 ```yaml
67 # OpenSDS authentication strategy, support 'noauth' and 'keystone'.
68 opensds_auth_strategy: noauth
69 ```
70
71 ##### Ceph
72 If `ceph` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
73 ```yaml
74 enabled_backend: ceph # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'.
75 ```
76
77 Configure ```group_vars/ceph/all.yml``` with an example below:
78 ```yml
79 ceph_origin: repository
80 ceph_repository: community
81 ceph_stable_release: luminous # Choose luminous as default version
82 public_network: "192.168.3.0/24" # Run 'ip -4 address' to check the ip address
83 cluster_network: "{{ public_network }}"
84 monitor_interface: eth1 # Change to the network interface on the target machine
85 devices: # For ceph devices, append ONE or MULTIPLE devices like the example below:
86   - '/dev/sda' # Ensure this device exists and available if ceph is chosen
87   #- '/dev/sdb'  # Ensure this device exists and available if ceph is chosen
88 osd_scenario: collocated
89 ```
90
91 ### Check if the hosts can be reached
92 ```bash
93 ansible all -m ping -i local.hosts
94 ```
95
96 ### Run opensds-ansible playbook to start deploy
97 ```bash
98 ansible-playbook site.yml -i local.hosts
99 ```
100
101 And next build and run cindercompatibleapi module:
102 ```shell
103 cd $GOPATH/src/github.com/opensds/opensds
104 go build -o ./build/out/bin/cindercompatibleapi github.com/opensds/opensds/contrib/cindercompatibleapi
105 ```
106
107 ## Test
108 ```shell
109 export CINDER_ENDPOINT=http://10.10.3.173:8776/v3 # Use endpoint shown above
110 export OPENSDS_ENDPOINT=http://127.0.0.1:50040
111
112 ./build/out/bin/cindercompatibleapi
113 ```
114
115 Then you can execute some cinder cli commands to see if the result is correct,
116 for example if you execute the command `cinder type-list`, the result will show
117 the profile of opnesds.
118
119 For detailed test instruction, please refer to the 5.3 section in
120 [OpenSDS Aruba PoC Plan](https://github.com/opensds/opensds/blob/development/docs/test-plans/OpenSDS_Aruba_POC_Plan.pdf).