1 ## 1. How to install an opensds local cluster
2 ### Pre-config (Ubuntu 16.04)
3 All the installation work is tested on `Ubuntu 16.04`, please make sure you have installed the right one. Also `root` user is suggested before the installation work starts.
7 Install following packages:
9 apt-get install -y git curl wget
15 wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_18.03.1~ce-0~ubuntu_amd64.deb
16 dpkg -i docker-ce_18.03.1~ce-0~ubuntu_amd64.deb
20 Check golang version information:
22 root@proxy:~# go version
23 go version go1.9.2 linux/amd64
25 You can install golang by executing commands below:
27 wget https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz
28 tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
29 echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
30 echo 'export GOPATH=$HOME/gopath' >> /etc/profile
34 ### Download opensds-installer code
36 git clone https://gerrit.opnfv.org/gerrit/stor4nfv
37 cd stor4nfv/ci/ansible
40 ### Install ansible tool
41 To install ansible, run the commands below:
43 # This step is needed to upgrade ansible to version 2.4.2 which is required for the "include_tasks" ansible command.
44 chmod +x ./install_ansible.sh && ./install_ansible.sh
45 ansible --version # Ansible version 2.4.x is required.
48 ### Configure opensds cluster variables:
49 ##### System environment:
50 If you want to integrate stor4nfv with k8s csi, please modify `nbp_plugin_type` to `csi` and also change `opensds_endpoint` field in `group_vars/common.yml`:
52 # 'hotpot_only' is the default integration way, but you can change it to 'csi'
54 nbp_plugin_type: hotpot_only
55 # The IP (127.0.0.1) should be replaced with the opensds actual endpoint IP
56 opensds_endpoint: http://127.0.0.1:50040
60 If `lvm` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
65 Modify ```group_vars/lvm/lvm.yaml```, change `tgtBindIp` to your real host ip if needed:
71 If `ceph` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
73 enabled_backend: ceph # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'.
76 Configure ```group_vars/ceph/all.yml``` with an example below:
78 ceph_origin: repository
79 ceph_repository: community
80 ceph_stable_release: luminous # Choose luminous as default version
81 public_network: "192.168.3.0/24" # Run 'ip -4 address' to check the ip address
82 cluster_network: "{{ public_network }}"
83 monitor_interface: eth1 # Change to the network interface on the target machine
84 devices: # For ceph devices, append ONE or MULTIPLE devices like the example below:
85 - '/dev/sda' # Ensure this device exists and available if ceph is chosen
86 #- '/dev/sdb' # Ensure this device exists and available if ceph is chosen
87 osd_scenario: collocated
91 If `cinder` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
93 enabled_backend: cinder # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'
95 # Use block-box install cinder_standalone if true, see details in:
96 use_cinder_standalone: true
99 Configure the auth and pool options to access cinder in `group_vars/cinder/cinder.yaml`. Do not need to make additional configure changes if using cinder standalone.
101 ### Check if the hosts can be reached
103 ansible all -m ping -i local.hosts
106 ### Run opensds-ansible playbook to start deploy
108 ansible-playbook site.yml -i local.hosts
111 ## 2. How to test opensds cluster
113 Firstly configure opensds CLI tool:
115 sudo cp /opt/opensds-linux-amd64/bin/osdsctl /usr/local/bin/
116 export OPENSDS_ENDPOINT=http://{your_real_host_ip}:50040
117 export OPENSDS_AUTH_STRATEGY=keystone
118 source /opt/stack/devstack/openrc admin admin
120 osdsctl pool list # Check if the pool resource is available
123 Then create a default profile:
125 osdsctl profile create '{"name": "default", "description": "default policy"}'
130 osdsctl volume create 1 --name=test-001
140 osdsctl volume delete <your_volume_id>
144 OpenSDS UI dashboard is available at `http://{your_host_ip}:8088`, please login the dashboard using the default admin credentials: `admin/opensds@123`. Create tenant, user, and profiles as admin.
146 Logout of the dashboard as admin and login the dashboard again as a non-admin user to create volume, snapshot, expand volume, create volume from snapshot, create volume group.
148 ## 3. How to purge and clean opensds cluster
150 ### Run opensds-ansible playbook to clean the environment
152 ansible-playbook clean.yml -i local.hosts
155 ### Run ceph-ansible playbook to clean ceph cluster if ceph is deployed
158 sudo ansible-playbook infrastructure-playbooks/purge-cluster.yml -i ceph.hosts
161 In addition, clean up the logical partition on the physical block device used by ceph, using the ```fdisk``` tool.
163 ### Remove ceph-ansible source code (optional)
165 sudo rm -rf /opt/ceph-ansible