Merge nbp installation into opensds ansible script
[stor4nfv.git] / ci / ansible / README.md
index 2bf2a80..8e86694 100644 (file)
@@ -2,13 +2,6 @@
 This is an installation tool for opensds using ansible.\r
 \r
 ## 1. How to install an opensds local cluster\r
-This installation document assumes there is a clean Ubuntu 16.04 environment. If golang is already installed in the environment, make sure the following parameters are configured in ```/etc/profile``` and run ``source /etc/profile``:\r
-```conf\r
-export GOROOT=/usr/local/go\r
-export GOPATH=$HOME/gopath\r
-export PATH=$PATH:$GOROOT/bin:$GOPATH/bin\r
-```\r
-\r
 ### Pre-config (Ubuntu 16.04)\r
 First download some system packages:\r
 ```\r
@@ -28,6 +21,7 @@ ssh-copy-id -i ~/.ssh/id_rsa.pub <ip_address> # IP address of the target machine
 If use a standalone cinder as backend, you also need to install docker to run cinder service. Please see the [docker installation document](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) for details.\r
 \r
 ### Install ansible tool\r
+To install ansible, you can run `install_ansible.sh` directly or input these commands below:\r
 ```bash\r
 sudo add-apt-repository ppa:ansible/ansible # This step is needed to upgrade ansible to version 2.4.2 which is required for the ceph backend.\r
 sudo apt-get update\r
@@ -35,25 +29,38 @@ sudo apt-get install ansible
 ansible --version # Ansible version 2.4.2 or higher is required for ceph; 2.0.0.2 or higher is needed for other backends.\r
 ```\r
 \r
-### Download opensds source code\r
-```bash\r
-mkdir -p $HOME/gopath/src/github.com/opensds && cd $HOME/gopath/src/github.com/opensds\r
-git clone https://github.com/opensds/opensds.git -b <specified_branch_name>\r
-cd opensds/contrib/ansible\r
-```\r
-\r
 ### Configure opensds cluster variables:\r
 ##### System environment:\r
-Configure the ```workplace``` in `group_vars/common.yml`:\r
+Configure these variables below in `group_vars/common.yml`:\r
+```yaml\r
+opensds_release: v0.1.4 # The version should be at least v0.1.4.\r
+nbp_release: v0.1.0 # The version should be at least v0.1.0.\r
+\r
+container_enabled: <false_or_true>\r
+```\r
+\r
+If you want to integrate OpenSDS with cloud platform (for example k8s), please modify `nbp_plugin_type` variable in `group_vars/common.yml`:\r
+```yaml\r
+nbp_plugin_type: standalone # standalone is the default integration way, but you can change it to 'csi', 'flexvolume'\r
+```\r
+\r
+#### Database configuration\r
+Currently OpenSDS adopts `etcd` as database backend, and the default db endpoint is `localhost:2379,localhost:2380`. But to avoid some conflicts with existing environment (k8s local cluster), we suggest you change the port of etcd cluster in `group_vars/osdsdb.yml`:\r
 ```yaml\r
-workplace: /home/your_username # Change this field according to your username. If login as root, configure this parameter to '/root'\r
+db_endpoint: localhost:62379,localhost:62380\r
+\r
+etcd_host: 127.0.0.1\r
+etcd_port: 62379\r
+etcd_peer_port: 62380\r
 ```\r
 \r
 ##### LVM\r
 If `lvm` is chosen as storage backend, modify `group_vars/osdsdock.yml`:\r
 ```yaml\r
 enabled_backend: lvm # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'\r
-pv_device: "your_pv_device_path" # Specify a block device and ensure it exists if lvm is chosen\r
+pv_devices: # Specify block devices and ensure them existed if you choose lvm\r
+  #- /dev/sdc\r
+  #- /dev/sdd\r
 vg_name: "specified_vg_name" # Specify a name for VG if choosing lvm\r
 ```\r
 Modify ```group_vars/lvm/lvm.yaml```, change pool name to be the same as `vg_name` above:\r
@@ -64,9 +71,12 @@ Modify ```group_vars/lvm/lvm.yaml```, change pool name to be the same as `vg_nam
 If `ceph` is chosen as storage backend, modify `group_vars/osdsdock.yml`:\r
 ```yaml\r
 enabled_backend: ceph # Change it according to the chosen backend. Supported backends include 'lvm', 'ceph', and 'cinder'.\r
-ceph_pool_name: "specified_pool_name" # Specify a name for ceph pool if choosing ceph\r
+ceph_pools: # Specify pool name randomly if choosing ceph\r
+  - rbd\r
+  #- ssd\r
+  #- sas\r
 ```\r
-Modify ```group_vars/ceph/ceph.yaml```, change pool name to be the same as `ceph_pool_name`:\r
+Modify ```group_vars/ceph/ceph.yaml```, change pool name to be the same as `ceph_pool_name`. But if you enable multiple pools, please append the current pool format:\r
 ```yaml\r
 "rbd" # change pool name to be the same as ceph pool\r
 ```\r
@@ -83,7 +93,7 @@ monitor_interface: eth1 # Change to the network interface on the target machine
 ```\r
 ```group_vars/ceph/osds.yml```:\r
 ```yml\r
-devices: # For ceph devices, append one or multiple devices like the example below:\r
+devices: # For ceph devices, append ONE or MULTIPLE devices like the example below:\r
     - '/dev/sda' # Ensure this device exists and available if ceph is chosen\r
     - '/dev/sdb' # Ensure this device exists and available if ceph is chosen\r
 osd_scenario: collocated\r
@@ -126,8 +136,10 @@ sudo ansible-playbook site.yml -i local.hosts
 \r
 ### Configure opensds CLI tool\r
 ```bash\r
-sudo cp $GOPATH/src/github.com/opensds/opensds/build/out/bin/osdsctl /usr/local/bin\r
+sudo cp /opt/opensds-{opensds-release}-linux-amd64/bin/osdsctl /usr/local/bin\r
 export OPENSDS_ENDPOINT=http://127.0.0.1:50040\r
+export OPENSDS_AUTH_STRATEGY=noauth\r
+\r
 osdsctl pool list # Check if the pool resource is available\r
 ```\r
 \r
@@ -169,8 +181,6 @@ cd /opt/ceph-ansible
 sudo ansible-playbook infrastructure-playbooks/purge-cluster.yml -i ceph.hosts\r
 ```\r
 \r
-In addition, clean up the logical partition on the physical block device used by ceph, using the ```fdisk``` tool.\r
-\r
 ### Remove ceph-ansible source code (optional)\r
 ```bash\r
 cd ..\r