Add cinder-lvm CI job

Tests Cinder with an LVM/iSCSI backend, including attaching a volume to
an instance.

Change-Id: I6963b5e81d7ac88dd1bdfb94b62d9d63028b9786
This commit is contained in:
Mark Goddard 2019-01-17 12:24:01 +00:00
parent 1c22da32ff
commit c41c9a0ce0
7 changed files with 52 additions and 5 deletions

View File

@ -4,10 +4,13 @@
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 }}"
tasks:
- name: Prepare ceph disks for bluestore and filestore OSD
script: "{{ kolla_ansible_full_src_dir }}/tests/setup_ceph_disks.sh {{ hostvars[inventory_hostname]['ceph_osd_storetype'] }}"
when: scenario == "ceph"
- name: Prepare disks for Ceph or LVM
script: "{{ kolla_ansible_full_src_dir }}/tests/setup_disks.sh {{ disk_type }}"
when: scenario in ["ceph", "cinder-lvm"]
become: true
vars:
disk_type: "{{ ceph_storetype if scenario == 'ceph' else 'cinder-lvm' }}"
ceph_storetype: "{{ hostvars[inventory_hostname].get('ceph_osd_storetype') }}"
- hosts: primary
vars:

View File

@ -1,6 +1,14 @@
mkdir -p /opt/data/kolla
if [ $1 = 'filestore' ]; then
if [ $1 = 'cinder-lvm' ]; then
# cinder-volumes volume group
free_device=$(losetup -f)
fallocate -l 5G /var/lib/cinder_data.img
losetup $free_device /var/lib/cinder_data.img
pvcreate $free_device
vgcreate cinder-volumes $free_device
elif [ $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)

View File

@ -36,6 +36,12 @@ ceph_pool_pgp_num: 8
glance_enable_rolling_upgrade: "yes"
{% endif %}
{% if scenario == "cinder-lvm" %}
enable_cinder: "yes"
enable_cinder_backend_lvm: "yes"
glance_api_hosts: ["{{ inventory_hostname }}"]
{% endif %}
{% if scenario == "zun" %}
enable_zun: "yes"
enable_kuryr: "yes"

View File

@ -24,7 +24,7 @@ function test_openstack_logged {
fi
echo "SUCCESS: Server creation"
if echo $ACTION | grep -q "ceph"; then
if [[ $ACTION = "ceph" ]] || [[ $ACTION == "cinder-lvm" ]]; then
echo "TESTING: Cinder volume attachment"
openstack volume create --size 2 test_volume
openstack server add volume kolla_boot_test test_volume --device /dev/vdb

View File

@ -44,6 +44,10 @@ EOF
GATE_IMAGES+=",ceph,cinder"
fi
if [[ $ACTION == "cinder-lvm" ]]; then
GATE_IMAGES+=",cinder,iscsid,tgtd"
fi
if [[ $ACTION == "zun" ]]; then
GATE_IMAGES+=",zun,kuryr,etcd"
fi

View File

@ -102,6 +102,26 @@
secondary2:
ceph_osd_storetype: bluestore
- job:
name: kolla-ansible-ubuntu-source-cinder-lvm
parent: kolla-ansible-base
nodeset: kolla-ansible-xenial-multi
voting: false
vars:
base_distro: ubuntu
install_type: source
scenario: cinder-lvm
- job:
name: kolla-ansible-centos-source-cinder-lvm
parent: kolla-ansible-base
nodeset: kolla-ansible-centos-multi
voting: false
vars:
base_distro: centos
install_type: source
scenario: cinder-lvm
- job:
name: kolla-ansible-bifrost-centos-source
parent: kolla-ansible-bifrost-base

View File

@ -18,6 +18,10 @@
- kolla-ansible-ubuntu-source-ceph
- kolla-ansible-centos-source-ceph
- kolla-ansible-oraclelinux-source-ceph
- kolla-ansible-ubuntu-source-cinder-lvm:
files: ^ansible\/roles\/(cinder|iscsi)\/.*
- kolla-ansible-centos-source-cinder-lvm:
files: ^ansible\/roles\/(cinder|iscsi)\/.*
- kolla-ansible-bifrost-centos-source:
files: ^ansible\/roles\/bifrost\/.*
- kolla-ansible-ubuntu-source-zun:
@ -33,3 +37,5 @@
- kolla-ansible-bifrost-centos-source
- kolla-ansible-ubuntu-source-zun
- kolla-ansible-centos-source-scenario-nfv
- kolla-ansible-ubuntu-source-cinder-lvm
- kolla-ansible-centos-source-cinder-lvm