From e861ca14b195fac3c27bbf3d75cbe97f627b24c7 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami <kajinamit@oss.nttdata.com> Date: Wed, 22 Nov 2023 11:16:30 +0900 Subject: [PATCH] Enable libvirt-guests The feature can be easily tested in CI. Depends-on: https://review.opendev.org/c/openstack/puppet-nova/+/901605 Change-Id: Ib47a11415d04df47dc3085a93475a5293ba7de5e --- copy_logs.sh | 22 +++++++++++++++++----- fixtures/scenario005.pp | 5 +++-- manifests/nova.pp | 25 ++++++++++++++++++------- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/copy_logs.sh b/copy_logs.sh index f0affea7b..648f0e2d2 100755 --- a/copy_logs.sh +++ b/copy_logs.sh @@ -67,6 +67,12 @@ cp ${WORKSPACE}/puppet*.log $LOG_DIR # Archive the project config & logs mkdir $LOG_DIR/etc/ +if uses_debs; then + mkdir -p $LOG_DIR/etc/default +elif is_fedora; then + mkdir -p $LOG_DIR/etc/sysconfig +fi + for p in $PROJECTS; do if [ -d /etc/$p ]; then sudo cp -r /etc/$p $LOG_DIR/etc/ @@ -97,7 +103,6 @@ fi # network interfaces if [ -d /etc/sysconfig/network-scripts ]; then - mkdir -p $LOG_DIR/etc/sysconfig sudo cp -r /etc/sysconfig/network-scripts $LOG_DIR/etc/sysconfig/ fi @@ -127,7 +132,7 @@ if uses_debs; then if [ -d /var/log/mysql ] ; then sudo cp -r /var/log/mysql $LOG_DIR/ fi -else +elif is_fedora; then if [ -f /etc/my.cnf ] ; then sudo cp /etc/my.cnf $LOG_DIR/etc/ fi @@ -194,6 +199,15 @@ fi if [ -d /etc/libvirt ]; then sudo cp -r /etc/libvirt $LOG_DIR/etc/ fi +if uses_debs ; then + if [ -f /etc/default/libvirt-guests ]; then + sudo cp -r /etc/default/libvirt-guests $LOG_DIR/etc/default + fi +elif is_fedora; then + if [ -f /etc/sysconfig/libvirt-guests ]; then + sudo cp -r /etc/sysconfig/libvirt-guests $LOG_DIR/etc/sysconfig + fi +fi # openvswitch if [ -d /etc/openvswitch ] ; then @@ -215,14 +229,12 @@ fi if uses_debs ; then for f in ovn-central ovn-host ; do if [ -f /etc/default/$f ]; then - mkdir -p $LOG_DIR/etc/default sudo cp /etc/default/$f $LOG_DIR/etc/default/ fi done elif is_fedora; then for f in ovn-northd ovn-controller ; do if [ -f /etc/sysconfig/$f ]; then - mkdir -p $LOG_DIR/etc/sysconfig sudo cp /etc/sysconfig/$f $LOG_DIR/etc/sysconfig/ fi done @@ -242,7 +254,7 @@ if uses_debs; then sudo cp ${apache_conf}/${d}/* $LOG_DIR${apache_conf}/${d}/ fi done -else +elif is_fedora; then apache_conf=/etc/httpd apache_logs=/var/log/httpd for d in conf conf.d conf.modules.d ; do diff --git a/fixtures/scenario005.pp b/fixtures/scenario005.pp index 8ba98e912..c66f4b5d2 100644 --- a/fixtures/scenario005.pp +++ b/fixtures/scenario005.pp @@ -57,8 +57,9 @@ class { 'openstack_integration::neutron': } include openstack_integration::placement class { 'openstack_integration::nova': - cinder_enabled => true, - modular_libvirt => $modular_libvirt, + cinder_enabled => true, + modular_libvirt => $modular_libvirt, + libvirt_guests_enabled => true, } class { 'openstack_integration::octavia': provider_driver => 'ovn' diff --git a/manifests/nova.pp b/manifests/nova.pp index 305830f73..a9458bffe 100644 --- a/manifests/nova.pp +++ b/manifests/nova.pp @@ -31,14 +31,19 @@ # (optional) Boolean to configure or not cinder options. # Defaults to false. # +# [*libvirt_guests_enabled*] +# (optional) Boolean to configure or not libvirt-guests +# Defaults to false. +# class openstack_integration::nova ( - $libvirt_rbd = false, - $libvirt_virt_type = 'qemu', - $libvirt_cpu_mode = 'none', - $modular_libvirt = false, - $volume_encryption = false, - $notification_topics = $facts['os_service_default'], - $cinder_enabled = false, + $libvirt_rbd = false, + $libvirt_virt_type = 'qemu', + $libvirt_cpu_mode = 'none', + $modular_libvirt = false, + $volume_encryption = false, + $notification_topics = $facts['os_service_default'], + $cinder_enabled = false, + $libvirt_guests_enabled = false, ) { include openstack_integration::config @@ -280,6 +285,12 @@ class openstack_integration::nova ( auth_type => 'password', } } + if $libvirt_guests_enabled { + class { 'nova::compute::libvirt_guests': + enabled => true, + manage_service => true, + } + } Keystone_endpoint <||> -> Service['nova-compute'] Keystone_service <||> -> Service['nova-compute']