diff options
29 files changed, 19 insertions, 1035 deletions
diff --git a/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh b/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh deleted file mode 100644 index dd815c22..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -if [ -d "/var/local/osd" ]; then -echo "clear /var/local/osd" -rm -r /var/local/osd/ -umount /var/local/osd -rm -r /var/local/osd -fi - - -#safe check -ps -ef |grep lvremove |awk '{print $2}' |xargs kill -9 -ps -ef |grep vgremove |awk '{print $2}' |xargs kill -9 -ps -ef |grep vgcreate |awk '{print $2}' |xargs kill -9 -ps -ef |grep lvcreate |awk '{print $2}' |xargs kill -9 - -if [ -L "/dev/storage-volumes/ceph0" ]; then -echo "remove lv vg" -lvremove -f /dev/storage-volumes/ceph0 -fi - - -echo "lvcreate" -lvcreate -l 100%FREE -nceph0 storage-volumes -echo "mkfs" -mkfs.xfs -f /dev/storage-volumes/ceph0 - -if [ ! -d "/var/local/osd" ]; then -echo "mount osd" -mkdir -p /var/local/osd -mount /dev/storage-volumes/ceph0 /var/local/osd -fi - diff --git a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_Debian.yml b/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_Debian.yml deleted file mode 100644 index 39a5cf8f..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_Debian.yml +++ /dev/null @@ -1,74 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -- name: create ceph cluster - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ mon_nodes.stdout_lines[0] }} - tags: - - create_ceph_cluster - -- name: default config for ceph - ini_file: - dest: "{{ ceph_cluster_dir[0] }}/ceph.conf" - section: "{{ item.section }}" - option: "{{ item.option }}" - value: "{{ item.value }}" - with_items: - - { section: "global", option: "osd_journal_size", value: "1024" } - - { section: "global", option: "osd_pool_default_size", value: "2" } - - { section: "global", option: "public_network", value: "{{ mgmt_cidr }}" } - - { section: "global", option: "cluster_network", value: "{{ storage_cidr }}" } - -- name: install ceph for every nodes includes jumpserver - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy install {{ ceph_cluster_hosts.stdout_lines[0]}} - ignore_errors: true - -- name: create monitor node in controller group - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy --overwrite-conf mon create-initial - -- name: gather keys - shell: sleep 5 && cd {{ ceph_cluster_dir[0] }} && ceph-deploy gatherkeys {{ inventory_hostname }} - ignore_errors: True - -- name: copy create_osd.sh to host1 - copy: src=create_osd.sh dest=~/create_osd.sh mode=0777 - tags: - - create_osd - -- name: copy create_osd.sh to other nodes - shell: scp -o StrictHostKeyChecking=no ~/create_osd.sh {{ item }}:~/ - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - -- name: create osd - shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "~/create_osd.sh" - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - -- name: prepare create osd - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd prepare {{ item }}:/var/local/osd - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - - -- name: activate osd - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd activate {{ item }}:/var/local/osd && ceph-deploy osd activate {{ item }}:/var/local/osd - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - - activate_osd - -- name: create admin node - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy admin {{ ceph_cluster_hosts.stdout_lines[0] }} diff --git a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_RedHat.yml b/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_RedHat.yml deleted file mode 100644 index f648a9ea..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_RedHat.yml +++ /dev/null @@ -1,73 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -- name: create ceph cluster - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ mon_nodes.stdout_lines[0] }} - tags: - - create_ceph_cluster - -- name: default config for ceph - ini_file: - dest: "{{ ceph_cluster_dir[0] }}/ceph.conf" - section: "{{ item.section }}" - option: "{{ item.option }}" - value: "{{ item.value }}" - with_items: - - { section: "global", option: "osd_journal_size", value: "1024" } - - { section: "global", option: "osd_pool_default_size", value: "2" } - - { section: "global", option: "public_network", value: "{{ mgmt_cidr }}" } - - { section: "global", option: "cluster_network", value: "{{ storage_cidr }}" } - -- name: install ceph for every nodes includes jumpserver - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy install --no-adjust-repos --repo-url http://10.1.0.12/cblr/repo_mirror/centos7-juno-ppa --gpg-url http://10.1.0.12/cblr/repo_mirror/centos7-juno-ppa/ceph_key_release.asc {{ ceph_cluster_hosts.stdout_lines[0]}} - -- name: create monitor node in controller group - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy --overwrite-conf mon create-initial - -- name: gather keys - shell: sleep 5 && cd {{ ceph_cluster_dir[0] }} && ceph-deploy gatherkeys {{ inventory_hostname }} - ignore_errors: True - -- name: copy create_osd.sh to host1 - copy: src=create_osd.sh dest=~/create_osd.sh mode=0777 - tags: - - create_osd - -- name: copy create_osd.sh to other nodes - shell: scp -o StrictHostKeyChecking=no ~/create_osd.sh {{ item }}:~/ - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - -- name: create osd - shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "~/create_osd.sh" - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - -- name: prepare create osd - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd prepare {{ item }}:/var/local/osd - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - - -- name: activate osd - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd activate {{ item }}:/var/local/osd - with_items: - - "{{ groups['ceph_osd'] }}" - tags: - - create_osd - - activate_osd - -- name: create admin node - shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy admin {{ ceph_cluster_hosts.stdout_lines[0] }} diff --git a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_openstack_conf.yml b/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_openstack_conf.yml deleted file mode 100644 index 2ff9b788..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_openstack_conf.yml +++ /dev/null @@ -1,45 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -- name: chown of glance/api.log - shell: ssh -o StrictHostKeyChecking=no {{ item }} -t "chown -R glance:glance /var/log/glance" - with_items: - - "{{ groups['controller'] }}" - tags: - - ceph_conf_glance - ignore_errors: True - -- name: modify glance-api.conf for ceph - shell: ssh -o StrictHostKeyChecking=no {{ item }} -t "sed -i 's/^\(default_store\).*/\1 = rbd/g' /etc/glance/glance-api.conf && sed -i '/^\[glance_store/a stores = rbd\nrbd_store_pool = images\nrbd_store_user = glance\nrbd_store_ceph_conf = /etc/ceph/ceph.conf\nrbd_store_chunk_size = 8\nshow_image_direct_url=True' /etc/glance/glance-api.conf" - with_items: - - "{{ groups['controller'] }}" - tags: - - ceph_conf_glance - -- name: restart glance - shell: ssh -o StrictHostKeyChecking=no {{ item }} -t "rm -f /var/log/glance/api.log && chown -R glance:glance /var/log/glance && service {{ glance_service }} restart" - with_items: - - "{{ groups['controller'] }}" - tags: - - ceph_conf_glance - ignore_errors: True - -- name: modify cinder.conf for ceph - shell: ssh -o StrictHostKeyChecking=no {{ item }} -t "sed -i 's/^\(volume_driver\).*/\1 = cinder.volume.drivers.rbd.RBDDriver/g' /etc/cinder/cinder.conf && sed -i 's/^\(rbd_secret_uuid\).*/\1 = {{ ceph_uuid.stdout_lines[0] }}/g' /etc/cinder/cinder.conf && sed -i '/^\[DEFAULT/a rbd_pool = volumes\nrbd_ceph_conf = /etc/ceph/ceph.conf\nrbd_flatten_volume_from_snapshot = false\nrbd_max_clone_depth = 5\nrbd_store_chunk_size = 4\nrados_connect_timeout = -1\nglance_api_version = 2\nrbd_user = cinder\nrbd_secret_uuid = {{ ceph_uuid.stdout_lines[0] }}' /etc/cinder/cinder.conf && service {{ cinder_service }} restart" - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_conf_cinder - -- name: modify nova.conf for ceph - shell: ssh -o StrictHostKeyChecking=no {{ item }} -t "sed -i 's/^\(images_type\).*/\1 = rbd/g' /etc/nova/nova-compute.conf && sed -i 's/^\(rbd_secret_uuid\).*/\1 = {{ ceph_uuid.stdout_lines[0] }}/g' /etc/nova/nova-compute.conf && sed -i '/^\[libvirt/a images_rbd_pool = vms\nimages_rbd_ceph_conf = /etc/ceph/ceph.conf\nrbd_user = cinder\nrbd_secret_uuid = {{ ceph_uuid.stdout_lines[0] }}\ndisk_cachemodes=\"network=writeback\"\nlive_migration_flag=\"VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED\"' /etc/nova/nova-compute.conf && service {{ nova_service }} restart" - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_conf_nova diff --git a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_openstack_pre.yml b/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_openstack_pre.yml deleted file mode 100644 index 8770525e..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_openstack_pre.yml +++ /dev/null @@ -1,76 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: create pool - shell: ceph osd pool create {{ item }} 50 - with_items: - - volumes - - images - - backups - - vms - -- name: create ceph users for openstack - shell: ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images' && ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images' - -- name: send glance key to controller nodes - shell: ceph auth get-or-create client.glance | ssh {{ item }} tee /etc/ceph/ceph.client.glance.keyring && ssh {{ item }} chown glance:glance /etc/ceph/ceph.client.glance.keyring - with_items: - - "{{ groups['controller'] }}" - -- name: send cinder key to compute nodes - shell: ceph auth get-or-create client.cinder | ssh {{ item }} tee /etc/ceph/ceph.client.cinder.keyring && ssh {{ item }} chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_send_key - -- name: copy cinder key to compute node - shell: ceph auth get-key client.cinder | ssh {{ item }} tee client.cinder.key - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_copy_secret - -- name: gen ceph uuid - shell: uuidgen - register: ceph_uuid - tags: - - ceph_copy_secret - -- name: gen template secret.xml - template: src=secret.j2 dest=~/secret.xml mode=0777 - tags: - - ceph_copy_secret - -- name: copy secret.xml to compute nodes - shell: scp -o StrictHostKeyChecking=no ~/secret.xml {{ item }}:~/secret.xml - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_copy_secret - -- name: undefine libvirt secret in case of repeatedly execute ceph_deploy - shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "virsh secret-list | awk '\$1 ~ /[0-9]+/ {print \$1}' | xargs virsh secret-undefine" - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_copy_secret - ignore_errors: True - - -- name: create key for libvirt on compute nodes - shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "virsh secret-define --file secret.xml && virsh secret-set-value --secret {{ ceph_uuid.stdout_lines[0] }} --base64 \$(cat client.cinder.key)" - with_items: - - "{{ groups['compute'] }}" - tags: - - ceph_copy_secret - ignore_errors: True - - diff --git a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_setup_env.yml b/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_setup_env.yml deleted file mode 100644 index 7b3099e2..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_setup_env.yml +++ /dev/null @@ -1,103 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -- include_vars: "{{ ansible_os_family }}.yml" - -- name: copy rsa secret key from compass-core to host1 - copy: src=/root/.ssh/id_rsa dest=/root/.ssh/id_rsa mode=0600 - -- name: copy rsa pub key from compass-core to host1 - copy: src=/root/.ssh/id_rsa.pub dest=/root/.ssh/id_rsa.pub mode=0644 - -- name: gen ssh key for no-ask access to every nodes - shell: if [ ! -f ~/.ssh/id_rsa.pub ]; then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; else echo "already gen ssh key!"; fi; - -- name: copy key to node - shell: ssh-copy-id -i ~/.ssh/id_rsa.pub -o StrictHostKeyChecking=no root@{{ item }} - with_items: - - "{{ groups['all'] }}" - -- name: install ceph-related packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" - with_items: packages | union(packages_noarch) - -- name: clear cluster_hosts_name - file: path=cluster_hosts_name state=absent - tags: - - create_ceph_cluster - - ceph_install - -- name: clear cluster_controller_nodes - file: path=cluster_controller_nodes state=absent - tags: - - create_ceph_cluster - - ceph_install - -- name: clear ceph_mon_nodes - file: path=ceph_mon_nodes state=absent - tags: - - create_ceph_cluster - - ceph_install - -- name: echo hosts name to file - shell: echo -n "{{ item }} " >> cluster_hosts_name - with_items: - - "{{ groups['all'] }}" - tags: - - create_ceph_cluster - - ceph_install - -- name: register hosts name - shell: cat cluster_hosts_name - register: ceph_cluster_hosts - tags: - - create_ceph_cluster - - echo_hosts - - ceph_install - -- name: echo controller name to file - shell: echo -n "{{ item }} " >> cluster_controller_nodes - with_items: - - "{{ groups['controller'] }}" - tags: - - create_ceph_cluster - - ceph_install - -- name: register controller nodes - shell: cat cluster_controller_nodes - register: controller_nodes - tags: - - create_ceph_cluster - - echo_hosts - - ceph_install - -- name: echo ceph-mon name to file - shell: echo -n "{{ item }} " >> ceph_mon_nodes - with_items: - - "{{ groups['ceph_mon'] }}" - tags: - - create_ceph_cluster - - ceph_install - -- name: register ceph-mon nodes - shell: cat ceph_mon_nodes - register: mon_nodes - tags: - - create_ceph_cluster - - echo_hosts - - ceph_install - -- name: gen clean ceph script - template: src=clean_ceph.j2 dest=~/clean_ceph.sh mode=0777 - -- name: clean ceph data of last deploy - shell: ~/clean_ceph.sh - -- name: mkdir for ceph-cluster - file: path={{ ceph_cluster_dir[0] }} state=directory mode=0755 diff --git a/deploy/adapters/ansible/roles/ceph-deploy/tasks/main.yml b/deploy/adapters/ansible/roles/ceph-deploy/tasks/main.yml deleted file mode 100644 index 8b90a1b6..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/tasks/main.yml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -- include: ceph_setup_env.yml - tags: - - ceph_deploy - - ceph_setup_env - - ceph_install - -- include: ceph_install_Debian.yml - when: ansible_os_family == "Debian" - tags: - - ceph_deploy - - ceph_install - -- include: ceph_install_RedHat.yml - when: ansible_os_family == "RedHat" - tags: - - ceph_deploy - - ceph_install - -- include: ceph_openstack_pre.yml - tags: - - ceph_deploy - - ceph_openstack_pre - - ceph_openstack - -- include: ceph_openstack_conf.yml - tags: - - ceph_deploy - - ceph_openstack_conf - - ceph_openstack - -- meta: flush_handlers diff --git a/deploy/adapters/ansible/roles/ceph-deploy/templates/clean_ceph.j2 b/deploy/adapters/ansible/roles/ceph-deploy/templates/clean_ceph.j2 deleted file mode 100644 index a089167d..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/templates/clean_ceph.j2 +++ /dev/null @@ -1,8 +0,0 @@ -if [ -d "{{ ceph_cluster_dir[0] }}" ]; then -cd {{ ceph_cluster_dir[0] }} -ceph-deploy purge {{ ceph_cluster_hosts.stdout_lines[0] }} -ceph-deploy purgedata {{ ceph_cluster_hosts.stdout_lines[0] }} -ceph-deploy forgetkeys -cd .. -rm -r {{ ceph_cluster_dir[0] }} -fi diff --git a/deploy/adapters/ansible/roles/ceph-deploy/templates/secret.j2 b/deploy/adapters/ansible/roles/ceph-deploy/templates/secret.j2 deleted file mode 100644 index a0ffc6e3..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/templates/secret.j2 +++ /dev/null @@ -1,6 +0,0 @@ -<secret ephemeral='no' private='no'> - <uuid>{{ ceph_uuid.stdout_lines[0] }}</uuid> - <usage type='ceph'> - <name>client.cinder secret</name> - </usage> -</secret> diff --git a/deploy/adapters/ansible/roles/ceph-deploy/vars/Debian.yml b/deploy/adapters/ansible/roles/ceph-deploy/vars/Debian.yml deleted file mode 100644 index 1da42323..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/vars/Debian.yml +++ /dev/null @@ -1,30 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -packages: - - ceph-deploy - - python-flask - - libgoogle-perftools4 - - libleveldb1 - - liblttng-ust0 - - libsnappy1 - - librbd1 - - librados2 - - python-ceph - - ceph - - ceph-mds - - ceph-common - - ceph-fs-common - - gdisk - -services: [] - -cinder_service: cinder-volume -nova_service: nova-compute -glance_service: glance-api diff --git a/deploy/adapters/ansible/roles/ceph-deploy/vars/RedHat.yml b/deploy/adapters/ansible/roles/ceph-deploy/vars/RedHat.yml deleted file mode 100644 index d0310f8b..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/vars/RedHat.yml +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -packages: - - ceph-radosgw - - fcgi - - ceph-deploy - - ceph - -services: [] - -cinder_service: openstack-cinder-volume -nova_service: openstack-nova-compute -glance_service: openstack-glance-api diff --git a/deploy/adapters/ansible/roles/ceph-deploy/vars/main.yml b/deploy/adapters/ansible/roles/ceph-deploy/vars/main.yml deleted file mode 100644 index 6de7e9f0..00000000 --- a/deploy/adapters/ansible/roles/ceph-deploy/vars/main.yml +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -packages_noarch: [] - -ceph_cluster_dir: - - /root/ceph-cluster diff --git a/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf b/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf index 8ecda649..66d9948a 100644 --- a/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf +++ b/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf @@ -52,7 +52,7 @@ volumes_dir=/var/lib/cinder/volumes volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver [keystone_authtoken] -auth_uri = http://{{ internal_vip.ip }}:5000/v2.0 +auth_uri = http://{{ internal_vip.ip }}:5000/v3 identity_uri = http://{{ internal_vip.ip }}:35357 admin_tenant_name = service admin_user = cinder diff --git a/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf b/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf index 4d8e49ce..0660cba9 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf +++ b/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf @@ -51,7 +51,7 @@ volumes_dir=/var/lib/cinder/volumes volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver [keystone_authtoken] -auth_uri = http://{{ internal_vip.ip }}:5000/v2.0 +auth_uri = http://{{ internal_vip.ip }}:5000/v3 identity_uri = http://{{ internal_vip.ip }}:35357 admin_tenant_name = service admin_user = cinder diff --git a/deploy/client.py b/deploy/client.py index 174356e0..0d51ce20 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -834,6 +834,21 @@ class CompassClient(object): ) raise RuntimeError("redeploy cluster failed") + def get_cluster_state(self, cluster_id): + for _ in range(10): + try: + status, cluster_state = self.client.get_cluster_state(cluster_id) + if self.is_ok(status): + break + except: + status = 500 + cluster_state = "" + + LOG.error("can not get cluster %s's state, try again" % cluster_id) + time.sleep(6) + + return status, cluster_state + def get_installing_progress(self, cluster_id): def _get_installing_progress(): """get intalling progress.""" @@ -843,16 +858,9 @@ class CompassClient(object): current_time = time.time while current_time() < deployment_timeout: - status, cluster_state = self.client.get_cluster_state(cluster_id) + status, cluster_state = self.get_cluster_state(cluster_id) if not self.is_ok(status): - LOG.error("can not get cluster state") - - # maybe a transient error? - time.sleep(5) - status, cluster_state = self.client.get_cluster_state(cluster_id) - if not self.is_ok(status): - # OK, there's something wrong - raise RuntimeError("can not get cluster state") + raise RuntimeError("can not get cluster state") if cluster_state['state'] in ['UNINITIALIZED', 'INITIALIZED']: if current_time() >= action_timeout: diff --git a/deploy/conf/baremetal_cluster.yml b/deploy/conf/baremetal_cluster.yml deleted file mode 100644 index 798099a4..00000000 --- a/deploy/conf/baremetal_cluster.yml +++ /dev/null @@ -1,37 +0,0 @@ -TYPE: baremetal -FLAVOR: cluster -POWER_TOOL: smmset - -hosts: - - name: host1 - mac: '64:3e:8c:4c:6d:a3' - location: 14 - roles: - - controller - - ha - - - name: host2 - mac: '64:3e:8c:4c:6d:37' - location: 15 - roles: - - controller - - ha - - - name: host3 - mac: '64:3e:8c:4c:6c:d7' - location: 16 - roles: - - controller - - ha - - - name: host4 - mac: '64:3e:8c:4c:6b:7b' - location: 17 - roles: - - compute - - - name: host5 - location: 18 - mac: '64:3e:8c:4c:68:2b' - roles: - - compute diff --git a/deploy/conf/baremetal_cluster_sh.yml b/deploy/conf/baremetal_cluster_sh.yml deleted file mode 100644 index fe329548..00000000 --- a/deploy/conf/baremetal_cluster_sh.yml +++ /dev/null @@ -1,44 +0,0 @@ - -TYPE: baremetal -FLAVOR: cluster -POWER_TOOL: ipmitool - -ipmiUser: root -ipmiPass: Huawei@123 -ipmiVer: '1.0' - -hosts: - - name: host1 - mac: 'D8:49:0B:DA:2A:28' - ipmiUser: root - ipmiPass: Huawei@123 - ipmiIp: 192.168.2.145 - roles: - - controller - - ha - - - name: host2 - mac: 'D8:49:0B:DA:5B:5D' - ipmiIp: 192.168.2.155 - roles: - - controller - - ha - - - name: host3 - mac: 'D8:49:0B:DA:5A:B7' - ipmiIp: 192.168.2.165 - roles: - - controller - - ha - - - name: host4 - mac: 'D8:49:0B:DA:58:99' - ipmiIp: 192.168.2.175 - roles: - - compute - - - name: host5 - mac: 'D8:49:0B:DA:56:85' - ipmiIp: 192.168.2.185 - roles: - - compute diff --git a/deploy/conf/baremetal_five.yml b/deploy/conf/baremetal_five.yml deleted file mode 100644 index 6e46e3b2..00000000 --- a/deploy/conf/baremetal_five.yml +++ /dev/null @@ -1,45 +0,0 @@ - -TYPE: baremetal -FLAVOR: five -POWER_TOOL: ipmitool - -ipmiUser: root -ipmiPass: Huawei@123 - -hosts: - - name: host1 - mac: '11:22:33:44:55' - ipmiUser: root - ipmiPass: Huawei@123 - ipmiIp: 192.168.2.100 - roles: - - controller - - network - - - name: host2 - mac: '11:22:33:44:55' - ipmiIp: 192.168.2.100 - roles: - - compute - - storage - - - name: host3 - mac: '11:22:33:44:55' - ipmiIp: 192.168.2.100 - roles: - - compute - - storage - - - name: host4 - mac: '11:22:33:44:55' - ipmiIp: 192.168.2.100 - roles: - - compute - - storage - - - name: host5 - mac: '11:22:33:44:55' - ipmiIp: 192.168.2.100 - roles: - - compute - - storage diff --git a/deploy/conf/five.conf b/deploy/conf/five.conf deleted file mode 100644 index beff1c54..00000000 --- a/deploy/conf/five.conf +++ /dev/null @@ -1,8 +0,0 @@ -export ADAPTER_OS_PATTERN='(?i)ubuntu-14\.04\.3.*' -#export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*1503-01.*'} -export REPO_NAME=${REPO_NAME:-"trusty-juno-ppa"} -#export REPO_NAME=${REPO_NAME:-"centos7-juno-ppa"} -export ADAPTER_NAME="openstack_juno" -export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$" -export ADAPTER_FLAVOR_PATTERN="single-controller" -export DEFAULT_ROLES="" diff --git a/deploy/conf/hardware_environment/huawei_us_lab/pod1/dha.yml b/deploy/conf/hardware_environment/huawei_us_lab/pod1/dha.yml deleted file mode 100644 index 47df7ff7..00000000 --- a/deploy/conf/hardware_environment/huawei_us_lab/pod1/dha.yml +++ /dev/null @@ -1,39 +0,0 @@ - -TYPE: baremetal -FLAVOR: cluster -POWER_TOOL: ipmitool - -ipmiUser: root -ipmiVer: '2.0' - -hosts: - - name: host2 - mac: 'E0:24:7F:02:15:A3' - ipmiIp: 172.16.130.28 - ipmiPass: huawei@123 - roles: - - controller - - ha - - - name: host3 - mac: 'D8:49:0B:DA:2A:28' - ipmiIp: 172.16.130.29 - ipmiPass: Huawei@123 - roles: - - controller - - ha - - - name: host4 - mac: 'D8:49:0B:DA:5B:5D' - ipmiIp: 172.16.130.30 - ipmiPass: Huawei@123 - roles: - - compute - - - name: host5 - mac: 'D8:49:0B:DA:56:85' - ipmiIp: 172.16.130.31 - ipmiPass: Huawei@123 - roles: - - compute - diff --git a/deploy/conf/hardware_environment/huawei_us_lab/pod1/network.yml b/deploy/conf/hardware_environment/huawei_us_lab/pod1/network.yml deleted file mode 100644 index 154f4150..00000000 --- a/deploy/conf/hardware_environment/huawei_us_lab/pod1/network.yml +++ /dev/null @@ -1,90 +0,0 @@ -nic_mappings: [] -bond_mappings: [] - -provider_net_mappings: - - name: br-prv - network: physnet - interface: eth1 - type: ovs - role: - - controller - - compute - -sys_intf_mappings: - - name: mgmt - interface: eth1 - vlan_tag: 101 - type: vlan - role: - - controller - - compute - - - name: storage - interface: eth1 - vlan_tag: 102 - type: vlan - role: - - controller - - compute - - - name: external - interface: br-prv - type: ovs - role: - - controller - - compute - -ip_settings: - - name: mgmt - ip_ranges: - - - "172.16.1.1" - - "172.16.1.254" - cidr: "172.16.1.0/24" - role: - - controller - - compute - - - name: storage - ip_ranges: - - - "172.16.2.1" - - "172.16.2.254" - cidr: "172.16.2.0/24" - role: - - controller - - compute - - - name: external - ip_ranges: - - - "192.168.10.10" - - "192.168.10.50" - cidr: "192.168.10.0/24" - gw: "192.168.10.1" - role: - - controller - - compute - -internal_vip: - ip: 172.16.1.222 - netmask: "24" - interface: mgmt - -public_vip: - ip: 192.168.10.51 - netmask: "24" - interface: external - -onos_nic: eth2 -public_net_info: - enable: True - network: ext-net - type: flat - segment_id: 10 - subnet: ext-subnet - provider_network: physnet - router: router-ext - enable_dhcp: False - no_gateway: False - external_gw: "192.168.10.1" - floating_ip_cidr: "192.168.10.0/24" - floating_ip_start: "192.168.10.100" - floating_ip_end: "192.168.10.200" diff --git a/deploy/conf/virtual_cluster.yml b/deploy/conf/virtual_cluster.yml deleted file mode 100644 index aa2a1b3e..00000000 --- a/deploy/conf/virtual_cluster.yml +++ /dev/null @@ -1,32 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - ceph-adm - - ceph-mon - - - name: host2 - roles: - - controller - - ha - - ceph-mon - - - name: host3 - roles: - - controller - - ha - - ceph-mon - - - name: host4 - roles: - - compute - - ceph-osd - - - name: host5 - roles: - - compute - - ceph-osd diff --git a/deploy/conf/virtual_cluster_odl.yml b/deploy/conf/virtual_cluster_odl.yml deleted file mode 100644 index e2ee19c6..00000000 --- a/deploy/conf/virtual_cluster_odl.yml +++ /dev/null @@ -1,29 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - odl - - - name: host2 - roles: - - controller - - ha - - odl - - - name: host3 - roles: - - controller - - ha - - odl - - - name: host4 - roles: - - compute - - - name: host5 - roles: - - compute diff --git a/deploy/conf/virtual_cluster_onos.yml b/deploy/conf/virtual_cluster_onos.yml deleted file mode 100644 index fcd07efc..00000000 --- a/deploy/conf/virtual_cluster_onos.yml +++ /dev/null @@ -1,29 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - onos - - - name: host2 - roles: - - controller - - ha - - onos - - - name: host3 - roles: - - controller - - ha - - onos - - - name: host4 - roles: - - compute - - - name: host5 - roles: - - compute diff --git a/deploy/conf/virtual_cluster_opencontrail.yml b/deploy/conf/virtual_cluster_opencontrail.yml deleted file mode 100644 index 56240f35..00000000 --- a/deploy/conf/virtual_cluster_opencontrail.yml +++ /dev/null @@ -1,25 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - opencontrail - - - name: host2 - roles: - - compute - - - name: host3 - roles: - - compute - - - name: host4 - roles: - - compute - - - name: host5 - roles: - - compute diff --git a/deploy/conf/virtual_five.yml b/deploy/conf/virtual_five.yml deleted file mode 100644 index f42f3d62..00000000 --- a/deploy/conf/virtual_five.yml +++ /dev/null @@ -1,29 +0,0 @@ -TYPE: virtual -FLAVOR: five - -hosts: - - name: host1 - roles: - - controller - - network - - - name: host2 - roles: - - compute - - storage - - - name: host3 - roles: - - compute - - storage - - - name: host4 - roles: - - compute - - storage - - - name: host5 - roles: - - compute - - storage - diff --git a/deploy/conf/vm_environment/nosdn.yml b/deploy/conf/vm_environment/nosdn.yml deleted file mode 100644 index aa2a1b3e..00000000 --- a/deploy/conf/vm_environment/nosdn.yml +++ /dev/null @@ -1,32 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - ceph-adm - - ceph-mon - - - name: host2 - roles: - - controller - - ha - - ceph-mon - - - name: host3 - roles: - - controller - - ha - - ceph-mon - - - name: host4 - roles: - - compute - - ceph-osd - - - name: host5 - roles: - - compute - - ceph-osd diff --git a/deploy/conf/vm_environment/odl.yml b/deploy/conf/vm_environment/odl.yml deleted file mode 100644 index e2ee19c6..00000000 --- a/deploy/conf/vm_environment/odl.yml +++ /dev/null @@ -1,29 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - odl - - - name: host2 - roles: - - controller - - ha - - odl - - - name: host3 - roles: - - controller - - ha - - odl - - - name: host4 - roles: - - compute - - - name: host5 - roles: - - compute diff --git a/deploy/conf/vm_environment/onos.yml b/deploy/conf/vm_environment/onos.yml deleted file mode 100644 index fcd07efc..00000000 --- a/deploy/conf/vm_environment/onos.yml +++ /dev/null @@ -1,29 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -hosts: - - name: host1 - roles: - - controller - - ha - - onos - - - name: host2 - roles: - - controller - - ha - - onos - - - name: host3 - roles: - - controller - - ha - - onos - - - name: host4 - roles: - - compute - - - name: host5 - roles: - - compute |