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
19 ### Download opensds-installer code
21 git clone https://gerrit.opnfv.org/gerrit/stor4nfv
22 cd stor4nfv/ci/ansible
25 ### Install ansible tool
26 To install ansible, run the commands below:
28 # This step is needed to upgrade ansible to version 2.4.2 which is required for the "include_tasks" ansible command.
29 chmod +x ./install_ansible.sh && ./install_ansible.sh
30 ansible --version # Ansible version 2.4.x is required.
33 ### Configure opensds cluster variables:
34 ##### System environment:
35 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`:
37 # 'hotpot_only' is the default integration way, but you can change it to 'csi'
39 nbp_plugin_type: hotpot_only
40 # The IP (127.0.0.1) should be replaced with the opensds actual endpoint IP
41 opensds_endpoint: http://127.0.0.1:50040
45 If `lvm` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
50 Modify ```group_vars/lvm/lvm.yaml```, change `tgtBindIp` to your real host ip if needed:
56 If `ceph` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
58 enabled_backend: ceph # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'.
61 Configure ```group_vars/ceph/all.yml``` with an example below:
63 ceph_origin: repository
64 ceph_repository: community
65 ceph_stable_release: luminous # Choose luminous as default version
66 public_network: "192.168.3.0/24" # Run 'ip -4 address' to check the ip address
67 cluster_network: "{{ public_network }}"
68 monitor_interface: eth1 # Change to the network interface on the target machine
69 devices: # For ceph devices, append ONE or MULTIPLE devices like the example below:
70 - '/dev/sda' # Ensure this device exists and available if ceph is chosen
71 #- '/dev/sdb' # Ensure this device exists and available if ceph is chosen
72 osd_scenario: collocated
76 If `cinder` is chosen as storage backend, modify `group_vars/osdsdock.yml`:
78 enabled_backend: cinder # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'
80 # Use block-box install cinder_standalone if true, see details in:
81 use_cinder_standalone: true
84 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.
86 ### Check if the hosts can be reached
88 ansible all -m ping -i local.hosts
91 ### Run opensds-ansible playbook to start deploy
93 ansible-playbook site.yml -i local.hosts
96 ## 2. How to test opensds cluster
98 Firstly configure opensds CLI tool:
100 sudo cp /opt/opensds-linux-amd64/bin/osdsctl /usr/local/bin/
101 export OPENSDS_ENDPOINT=http://{your_real_host_ip}:50040
102 export OPENSDS_AUTH_STRATEGY=keystone
103 source /opt/stack/devstack/openrc admin admin
105 osdsctl pool list # Check if the pool resource is available
108 Then create a default profile:
110 osdsctl profile create '{"name": "default", "description": "default policy"}'
115 osdsctl volume create 1 --name=test-001
125 osdsctl volume delete <your_volume_id>
129 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.
131 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.
133 ## 3. How to purge and clean opensds cluster
135 ### Run opensds-ansible playbook to clean the environment
137 ansible-playbook clean.yml -i local.hosts
140 ### Run ceph-ansible playbook to clean ceph cluster if ceph is deployed
143 sudo ansible-playbook infrastructure-playbooks/purge-cluster.yml -i ceph.hosts
146 In addition, clean up the logical partition on the physical block device used by ceph, using the ```fdisk``` tool.
148 ### Remove ceph-ansible source code (optional)
150 sudo rm -rf /opt/ceph-ansible