diff --git a/README.md b/README.md index 9619d8929..7c08f0e80 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ scenario](#all-in-one). | ssl | yes | yes | yes | yes | yes | yes | no | | ipv6 | centos9 | centos9 | centos9 | centos9 | centos9 | centos9 | no | | keystone | X | X | X | X | X | X | X | -| glance | | rbd | swift | file | swift+rgw | file | file | +| glance | | rbd | swift | file | swift+rgw | cinder | file | | nova | | rbd | X | X | rbd | X | X | | placement | | X | X | X | X | X | X | | neutron | | ovs | ovs | ovn | ovs | ovn | ovs | -| cinder | | rbd | iscsi | | | | iscsi | +| cinder | | rbd | iscsi | | | iscsi | iscsi | | ceilometer | | X | X | | | | | | aodh | | X | X | | | | | | designate | | | | bind | | | | diff --git a/fixtures/scenario001.pp b/fixtures/scenario001.pp index f0dd94cea..0f478760d 100644 --- a/fixtures/scenario001.pp +++ b/fixtures/scenario001.pp @@ -88,17 +88,22 @@ include openstack_integration::ceph class { 'openstack_integration::heat': notification_topics => $notification_topics, } -include openstack_integration::provision +class { 'openstack_integration::provision': + # NOTE(tkajinam): Use raw format to use rbd image cloning when creating + # a volume from an image. + image_format => 'raw', +} include openstack_integration::redis class { 'openstack_integration::gnocchi': integration_enable => true, } class { 'openstack_integration::tempest': - cinder => true, - gnocchi => true, - ceilometer => true, - aodh => true, - heat => true, - vitrage => $enable_vitrage, + cinder => true, + gnocchi => true, + ceilometer => true, + aodh => true, + heat => true, + vitrage => $enable_vitrage, + image_format => 'raw', } diff --git a/fixtures/scenario005.pp b/fixtures/scenario005.pp index a77fe8249..453f1e9d6 100644 --- a/fixtures/scenario005.pp +++ b/fixtures/scenario005.pp @@ -46,7 +46,10 @@ include openstack_integration::rabbitmq include openstack_integration::mysql include openstack_integration::ovn include openstack_integration::keystone -include openstack_integration::glance +include openstack_integration::cinder +class { 'openstack_integration::glance': + backend => 'cinder', +} class { 'openstack_integration::neutron': driver => 'ovn', } @@ -57,9 +60,15 @@ class { 'openstack_integration::octavia': provider_driver => 'ovn' } -include openstack_integration::provision +class { 'openstack_integration::provision': + # NOTE(tkajinam): Use raw format to use volume cloning when creating a volume + # from an image. + image_format => 'raw', +} class { 'openstack_integration::tempest': + cinder => true, octavia => true, neutron_driver => 'ovn', + image_format => 'raw', } diff --git a/manifests/glance.pp b/manifests/glance.pp index e73ee60cc..72d09a671 100644 --- a/manifests/glance.pp +++ b/manifests/glance.pp @@ -2,7 +2,7 @@ # # [*backend*] # (optional) Glance backend to use. -# Can be 'file', 'swift' or 'rbd'. +# Can be 'file', 'swift', 'rbd' or 'cinder'. # Defaults to 'file'. # class openstack_integration::glance ( @@ -71,6 +71,15 @@ class openstack_integration::glance ( } $default_backend = 'swift1' } + 'cinder': { + glance::backend::multistore::cinder { 'cinder1': + cinder_store_auth_address => "${::openstack_integration::config::keystone_auth_uri}/v3", + cinder_store_project_name => 'services', + cinder_store_user_name => 'glance', + cinder_store_password => 'a_big_secret', + } + $default_backend = 'cinder1' + } default: { fail("Unsupported backend (${backend})") } diff --git a/manifests/provision.pp b/manifests/provision.pp index cb24075bc..f0d68d511 100644 --- a/manifests/provision.pp +++ b/manifests/provision.pp @@ -13,10 +13,15 @@ # (optional) Define if Nova Resources needs to be created. # Default to true. # +# [*image_format*] +# (optional) Format of glance images to be created. +# Defaults to 'qcow2' +# class openstack_integration::provision ( - $glance = true, - $nova = true, - $neutron = true, + $glance = true, + $nova = true, + $neutron = true, + $image_format = 'qcow2', ){ include openstack_integration::config @@ -79,19 +84,21 @@ class openstack_integration::provision ( } if $glance { + $image_path = "/tmp/openstack/image/cirros-0.5.1-x86_64-disk-${image_format}.img" + glance_image { 'cirros': ensure => present, container_format => 'bare', - disk_format => 'qcow2', + disk_format => $image_format, is_public => 'yes', - source => '/tmp/openstack/image/cirros-0.5.1-x86_64-disk.img' + source => $image_path, } glance_image { 'cirros_alt': ensure => present, container_format => 'bare', - disk_format => 'qcow2', + disk_format => $image_format, is_public => 'yes', - source => '/tmp/openstack/image/cirros-0.5.1-x86_64-disk.img' + source => $image_path, } Keystone_user_role['admin@openstack'] -> Glance_image<||> } diff --git a/manifests/tempest.pp b/manifests/tempest.pp index d376ed9a9..35579f574 100644 --- a/manifests/tempest.pp +++ b/manifests/tempest.pp @@ -130,6 +130,11 @@ # The list is known to work with the repo; this reflects extensions enabled # in neutron gate, for the most part (minus features not configured like # trunk, dns-integration, qos, or port_security support) +# +# [*image_format*] +# (optional) Format of glance images to be created. +# Defaults to 'qcow2' +# class openstack_integration::tempest ( $aodh = false, $bgpvpn = false, @@ -163,6 +168,7 @@ class openstack_integration::tempest ( $configure_networks = true, $neutron_driver = 'openvswitch', $neutron_api_extensions = undef, + $image_format = 'qcow2', ) { include openstack_integration::config @@ -303,7 +309,8 @@ class openstack_integration::tempest ( image_alt_ssh_user => 'cirros', # TODO(emilien) optimization by 1/ using Hiera to configure Glance image source # and 2/ if running in the gate, use /home/jenkins/cache/files/ cirros image. - img_file => '/tmp/openstack/image/cirros-0.5.1-x86_64-disk.img', + img_file => "/tmp/openstack/image/cirros-0.5.1-x86_64-disk-${image_format}.img", + img_disk_format => $image_format, compute_build_interval => 10, ca_certificates_file => $::openstack_integration::params::ca_bundle_cert_path, manage_tests_packages => true, diff --git a/playbooks/prepare-node-integration.yaml b/playbooks/prepare-node-integration.yaml index 0dde9c7e4..ec41c2a31 100644 --- a/playbooks/prepare-node-integration.yaml +++ b/playbooks/prepare-node-integration.yaml @@ -1,5 +1,19 @@ - hosts: all tasks: + - name: Install the qemu-img command (CentOS/RHEL) + dnf: + name: qemu-img + become: true + when: + - ansible_os_family == 'RedHat' + + - name: Install the qemu-img command (Ubuntu/Debian) + apt: + name: qemu-utils + become: true + when: + - ansible_os_family == 'Debian' + - shell: cmd: | set -e diff --git a/run_tests.sh b/run_tests.sh index a6c3a8798..3e3822c16 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -133,6 +133,9 @@ if [ -f ~/cache/files/cirros-0.5.1-x86_64-disk.img ]; then else wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img -P $IMG_DIR fi +ln -s $IMG_DIR/cirros-0.5.1-x86_64-disk.img $IMG_DIR/cirros-0.5.1-x86_64-disk-qcow2.img +# NOTE(tkajinam): Prepare raw format image +qemu-img convert -f qcow2 -O raw $IMG_DIR/cirros-0.5.1-x86_64-disk.img $IMG_DIR/cirros-0.5.1-x86_64-disk-raw.img install_puppet PUPPET_FULL_PATH=$(which puppet)