Add Kolla Ceph filestore CI jobs

Since Rocky bluestore is the default store type used by Kolla Ceph.
Filestore is still used by the customers. The patch allows deploy
both Ceph bluestore OSD and Ceph filestore OSD in Kolla-ansible CI
jobs.

Change-Id: Iaa7c1b2ff35eb649c3a6d9f7266463d8961cdc9e
Signed-off-by: tone.zhang <tone.zhang@arm.com>
This commit is contained in:
tone.zhang 2018-11-23 15:44:40 +08:00
parent f704a78029
commit 6786bc5b77
4 changed files with 55 additions and 19 deletions

View File

@ -4,8 +4,8 @@
kolla_ansible_src_dir: "src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible" kolla_ansible_src_dir: "src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
kolla_ansible_full_src_dir: "{{ zuul.executor.work_root }}/{{ kolla_ansible_src_dir }}" kolla_ansible_full_src_dir: "{{ zuul.executor.work_root }}/{{ kolla_ansible_src_dir }}"
tasks: tasks:
- name: Prepare ceph disks - name: Prepare ceph disks for bluestore and filestore OSD
script: "{{ kolla_ansible_full_src_dir }}/tests/setup_ceph_disks.sh" script: "{{ kolla_ansible_full_src_dir }}/tests/setup_ceph_disks.sh {{ hostvars[inventory_hostname]['ceph_osd_storetype'] }}"
when: scenario == "ceph" when: scenario == "ceph"
become: true become: true

View File

@ -1,23 +1,38 @@
mkdir -p /opt/data/kolla mkdir -p /opt/data/kolla
dd if=/dev/zero of=/opt/data/kolla/ceph-osd0.img bs=5M count=128
if [ $1 = 'filestore' ]; then
#setup devices for Kolla Ceph filestore OSD
dd if=/dev/zero of=/opt/data/kolla/ceph-osd1.img bs=5M count=1000
LOOP=$(losetup -f)
losetup $LOOP /opt/data/kolla/ceph-osd1.img
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_OSD1 1 -1
dd if=/dev/zero of=/opt/data/kolla/ceph-journal1.img bs=5M count=512
LOOP=$(losetup -f)
losetup $LOOP /opt/data/kolla/ceph-journal1.img
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_OSD1_J 1 -1
else
# Setup devices for Kolla Ceph bluestore OSD
dd if=/dev/zero of=/opt/data/kolla/ceph-osd0.img bs=5M count=100
LOOP=$(losetup -f) LOOP=$(losetup -f)
losetup $LOOP /opt/data/kolla/ceph-osd0.img losetup $LOOP /opt/data/kolla/ceph-osd0.img
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD1 1 -1 parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD0 1 -1
dd if=/dev/zero of=/opt/data/kolla/ceph-osd0-b.img bs=5M count=2048 dd if=/dev/zero of=/opt/data/kolla/ceph-osd0-b.img bs=5M count=1000
LOOP=$(losetup -f) LOOP=$(losetup -f)
losetup $LOOP /opt/data/kolla/ceph-osd0-b.img losetup $LOOP /opt/data/kolla/ceph-osd0-b.img
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD1_B 1 -1 parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD0_B 1 -1
dd if=/dev/zero of=/opt/data/kolla/ceph-osd0-w.img bs=5M count=256 dd if=/dev/zero of=/opt/data/kolla/ceph-osd0-w.img bs=5M count=200
LOOP=$(losetup -f) LOOP=$(losetup -f)
losetup $LOOP /opt/data/kolla/ceph-osd0-w.img losetup $LOOP /opt/data/kolla/ceph-osd0-w.img
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD1_W 1 -1 parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD0_W 1 -1
dd if=/dev/zero of=/opt/data/kolla/ceph-osd0-d.img bs=5M count=256 dd if=/dev/zero of=/opt/data/kolla/ceph-osd0-d.img bs=5M count=200
LOOP=$(losetup -f) LOOP=$(losetup -f)
losetup $LOOP /opt/data/kolla/ceph-osd0-d.img losetup $LOOP /opt/data/kolla/ceph-osd0-d.img
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD1_D 1 -1 parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_OSD0_D 1 -1
fi
partprobe partprobe

View File

@ -17,7 +17,7 @@
[storage] [storage]
{% for host in hostvars %} {% for host in hostvars %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} {{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} ceph_osd_store_type={{ 'filestore' if host == 'primary' else 'bluestore' }}
{% endfor %} {% endfor %}
[monitoring] [monitoring]

View File

@ -60,6 +60,13 @@
base_distro: ubuntu base_distro: ubuntu
install_type: source install_type: source
scenario: ceph scenario: ceph
host-vars:
primary:
ceph_osd_storetype: filestore
secondary1:
ceph_osd_storetype: bluestore
secondary2:
ceph_osd_storetype: bluestore
- job: - job:
name: kolla-ansible-centos-source-ceph name: kolla-ansible-centos-source-ceph
@ -70,6 +77,13 @@
base_distro: centos base_distro: centos
install_type: source install_type: source
scenario: ceph scenario: ceph
host-vars:
primary:
ceph_osd_storetype: filestore
secondary1:
ceph_osd_storetype: bluestore
secondary2:
ceph_osd_storetype: bluestore
- job: - job:
name: kolla-ansible-oraclelinux-source-ceph name: kolla-ansible-oraclelinux-source-ceph
@ -80,6 +94,13 @@
base_distro: oraclelinux base_distro: oraclelinux
install_type: source install_type: source
scenario: ceph scenario: ceph
host-vars:
primary:
ceph_osd_storetype: filestore
secondary1:
ceph_osd_storetype: bluestore
secondary2:
ceph_osd_storetype: bluestore
- job: - job:
name: kolla-ansible-bifrost-centos-source name: kolla-ansible-bifrost-centos-source