Add cindercompatibleapi binary file
[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
27 ## Start deployment
28 ### Download opensds-installer code
29 ```bash
30 git clone https://gerrit.opnfv.org/gerrit/stor4nfv
31 cd stor4nfv/ci/ansible
32 ```
33
34 ### Install ansible tool
35 To install ansible, run the commands below:
36 ```bash
37 # This step is needed to upgrade ansible to version 2.4.2 which is required for the "include_tasks" ansible command.
38 chmod +x ./install_ansible.sh && ./install_ansible.sh
39 ansible --version # Ansible version 2.4.x is required.
40 ```
41
42 ### Configure opensds cluster variables:
43 ##### System environment:
44 Change `opensds_endpoint` field in `group_vars/common.yml`:
45 ```yaml
46 # The IP (127.0.0.1) should be replaced with the opensds actual endpoint IP
47 opensds_endpoint: http://127.0.0.1:50040
48 ```
49
50 Change `opensds_auth_strategy` field to `noauth` in `group_vars/auth.yml`:
51 ```yaml
52 # OpenSDS authentication strategy, support 'noauth' and 'keystone'.
53 opensds_auth_strategy: noauth
54 ```
55
56 ##### Ceph
57 If `ceph` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
58 ```yaml
59 enabled_backend: ceph # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'.
60 ```
61
62 Configure ```group_vars/ceph/all.yml``` with an example below:
63 ```yml
64 ceph_origin: repository
65 ceph_repository: community
66 ceph_stable_release: luminous # Choose luminous as default version
67 public_network: "192.168.3.0/24" # Run 'ip -4 address' to check the ip address
68 cluster_network: "{{ public_network }}"
69 monitor_interface: eth1 # Change to the network interface on the target machine
70 devices: # For ceph devices, append ONE or MULTIPLE devices like the example below:
71   - '/dev/sda' # Ensure this device exists and available if ceph is chosen
72   #- '/dev/sdb'  # Ensure this device exists and available if ceph is chosen
73 osd_scenario: collocated
74 ```
75
76 ### Check if the hosts can be reached
77 ```bash
78 ansible all -m ping -i local.hosts
79 ```
80
81 ### Run opensds-ansible playbook to start deploy
82 ```bash
83 ansible-playbook site.yml -i local.hosts
84 ```
85
86 ## Test
87 ```shell
88 export CINDER_ENDPOINT=http://10.10.3.173:8776/v3 # Use endpoint shown above
89 export OPENSDS_ENDPOINT=http://127.0.0.1:50040
90
91 chmod +x ../bin/cindercompatibleapi && ../bin/cindercompatibleapi
92 ```
93
94 Please create a default opensds profile after initializing opensds cluster:
95 ```shell
96 osdsctl profile create '{"name": "default", "description": "default policy"}'
97 ```
98
99 Then you can execute some cinder cli commands to see if the result is correct,
100 for example if you execute the command `cinder type-list`, the result will show
101 the profile of opnesds.
102
103 For detailed test instruction, please refer to the 5.3 section in
104 [OpenSDS Aruba PoC Plan](https://github.com/opensds/opensds/blob/development/docs/test-plans/OpenSDS_Aruba_POC_Plan.pdf).