diff --git a/deployment/puppet/openstack/manifests/compute.pp b/deployment/puppet/openstack/manifests/compute.pp index 8f96462967..a1ebddc445 100644 --- a/deployment/puppet/openstack/manifests/compute.pp +++ b/deployment/puppet/openstack/manifests/compute.pp @@ -78,6 +78,8 @@ class openstack::compute ( $glance_api_servers = undef, # Virtualization $libvirt_type = 'kvm', + # FIXME(bogdando) remove after fixed upstream https://review.openstack.org/131710 + $host_uuid = undef, # VNC $vnc_enabled = true, $vncproxy_host = undef, @@ -229,8 +231,6 @@ class openstack::compute ( notify => Service['libvirt'], } - $host_uuid=generate('/bin/sh', '-c', "uuidgen") - augeas { 'libvirt-conf-uuid': context => '/files/etc/libvirt/libvirtd.conf', changes => [ diff --git a/deployment/puppet/openstack/spec/classes/openstack_compute_spec.rb b/deployment/puppet/openstack/spec/classes/openstack_compute_spec.rb index ee8692a7ad..ae36d7a776 100644 --- a/deployment/puppet/openstack/spec/classes/openstack_compute_spec.rb +++ b/deployment/puppet/openstack/spec/classes/openstack_compute_spec.rb @@ -15,6 +15,7 @@ describe 'openstack::compute' do :rabbit_ha_queues => false, :glance_api_servers => 'undef', :libvirt_type => 'kvm', + :host_uuid => nil, :vnc_enabled => true, :vncproxy_host => false, :vncserver_listen => '0.0.0.0', @@ -142,6 +143,10 @@ describe 'openstack::compute' do :compute_driver => p[:compute_driver], :libvirt_service_name => 'libvirtd' ) + should contain_augeas('libvirt-conf-uuid').with( + :context => '/files/etc/libvirt/libvirtd.conf', + :changes => "set host_uuid #{p[:host_uuid]}" + ).that_notifies('Service[libvirt]') if facts[:osfamily] == 'RedHat' should contain_file_line('no_qemu_selinux') elsif facts[:osfamily] == 'Debian' diff --git a/deployment/puppet/osnailyfacter/modular/roles/compute.pp b/deployment/puppet/osnailyfacter/modular/roles/compute.pp index 7e939d1017..db52e24de8 100644 --- a/deployment/puppet/osnailyfacter/modular/roles/compute.pp +++ b/deployment/puppet/osnailyfacter/modular/roles/compute.pp @@ -233,6 +233,8 @@ class { 'openstack::compute': private_interface => $use_neutron ? { true=>false, default=>hiera('private_int', undef)}, internal_address => get_network_role_property('nova/api', 'ipaddr'), libvirt_type => hiera('libvirt_type', undef), + # FIXME(bogdando) remove after fixed upstream https://review.openstack.org/131710 + host_uuid => hiera('host_uuid', generate('/bin/sh', '-c', 'uuidgen')), fixed_range => $use_neutron ? { true=>false, default=>hiera('fixed_network_range', undef)}, network_manager => hiera('network_manager', undef), network_config => hiera('network_config', {}), diff --git a/tests/noop/astute.yaml/neut_vlan.ceph.compute-ephemeral-ceph.yaml b/tests/noop/astute.yaml/neut_vlan.ceph.compute-ephemeral-ceph.yaml index 6f14453dad..ae1fa26baa 100644 --- a/tests/noop/astute.yaml/neut_vlan.ceph.compute-ephemeral-ceph.yaml +++ b/tests/noop/astute.yaml/neut_vlan.ceph.compute-ephemeral-ceph.yaml @@ -119,6 +119,7 @@ syslog: weight: 50 label: Syslog libvirt_type: qemu +host_uuid: '00000000-0000-0000-0000-000000000000' puppet: modules: rsync://10.122.10.2:/puppet/2015.1.0-8.0/modules/ manifests: rsync://10.122.10.2:/puppet/2015.1.0-8.0/manifests/ diff --git a/tests/noop/astute.yaml/neut_vlan.compute.nossl.yaml b/tests/noop/astute.yaml/neut_vlan.compute.nossl.yaml index 4813c5514f..0a160c3e9b 100644 --- a/tests/noop/astute.yaml/neut_vlan.compute.nossl.yaml +++ b/tests/noop/astute.yaml/neut_vlan.compute.nossl.yaml @@ -119,6 +119,7 @@ syslog: weight: 50 label: Syslog libvirt_type: qemu +host_uuid: '00000000-0000-0000-0000-000000000000' puppet: modules: rsync://10.122.5.2:/puppet/2015.1.0-8.0/modules/ manifests: rsync://10.122.5.2:/puppet/2015.1.0-8.0/manifests/ diff --git a/tests/noop/astute.yaml/neut_vlan.compute.ssl.yaml b/tests/noop/astute.yaml/neut_vlan.compute.ssl.yaml index a0d3be0aa1..19ed192714 100644 --- a/tests/noop/astute.yaml/neut_vlan.compute.ssl.yaml +++ b/tests/noop/astute.yaml/neut_vlan.compute.ssl.yaml @@ -119,6 +119,7 @@ syslog: weight: 50 label: Syslog libvirt_type: qemu +host_uuid: '00000000-0000-0000-0000-000000000000' puppet: modules: rsync://10.122.5.2:/puppet/2015.1.0-8.0/modules/ manifests: rsync://10.122.5.2:/puppet/2015.1.0-8.0/manifests/ diff --git a/tests/noop/astute.yaml/neut_vlan_l3ha.ceph.ceil-compute.yaml b/tests/noop/astute.yaml/neut_vlan_l3ha.ceph.ceil-compute.yaml index e31cb7fcfb..28e8509906 100644 --- a/tests/noop/astute.yaml/neut_vlan_l3ha.ceph.ceil-compute.yaml +++ b/tests/noop/astute.yaml/neut_vlan_l3ha.ceph.ceil-compute.yaml @@ -91,6 +91,7 @@ keystone: db_password: e4Op1FQB last_controller: node-125 libvirt_type: qemu +host_uuid: '00000000-0000-0000-0000-000000000000' management_network_range: 192.168.0.0/24 management_vip: 192.168.0.6 management_vrouter_vip: 192.168.0.7 diff --git a/tests/noop/astute.yaml/neut_vxlan_dvr.murano.sahara-compute.yaml b/tests/noop/astute.yaml/neut_vxlan_dvr.murano.sahara-compute.yaml index 70b82a9845..0de3b961af 100644 --- a/tests/noop/astute.yaml/neut_vxlan_dvr.murano.sahara-compute.yaml +++ b/tests/noop/astute.yaml/neut_vxlan_dvr.murano.sahara-compute.yaml @@ -91,6 +91,7 @@ keystone: db_password: 32TWl29R last_controller: node-131 libvirt_type: qemu +host_uuid: '00000000-0000-0000-0000-000000000000' management_network_range: 192.168.0.0/24 management_vip: 192.168.0.6 management_vrouter_vip: 192.168.0.7 diff --git a/tests/noop/astute.yaml/novanet-compute.yaml b/tests/noop/astute.yaml/novanet-compute.yaml index 06521be007..73cbdc9c77 100644 --- a/tests/noop/astute.yaml/novanet-compute.yaml +++ b/tests/noop/astute.yaml/novanet-compute.yaml @@ -97,6 +97,7 @@ keystone: db_password: MnrQiwLn last_controller: node-137 libvirt_type: qemu +host_uuid: '00000000-0000-0000-0000-000000000000' management_network_range: 192.168.0.0/24 management_vip: 192.168.0.5 management_vrouter_vip: 192.168.0.6 diff --git a/tests/noop/spec/hosts/openstack-compute/openstack-compute_spec.rb b/tests/noop/spec/hosts/openstack-compute/openstack-compute_spec.rb index 5ac6ea679a..4b311c5c81 100644 --- a/tests/noop/spec/hosts/openstack-compute/openstack-compute_spec.rb +++ b/tests/noop/spec/hosts/openstack-compute/openstack-compute_spec.rb @@ -5,15 +5,15 @@ manifest = 'roles/compute.pp' describe manifest do shared_examples 'catalog' do - storage_hash = Noop.hiera_structure 'storage' - ironic_enabled = Noop.hiera_structure 'ironic/enabled' + storage_hash = Noop.hiera_structure 'storage' + ironic_enabled = Noop.hiera_structure 'ironic/enabled' - if ironic_enabled - compute_driver = 'ironic.IronicDriver' - else - compute_driver = 'libvirt.LibvirtDriver' - end - it 'should declare class nova::compute with install_bridge_utils set to false' do + if ironic_enabled + compute_driver = 'ironic.IronicDriver' + else + compute_driver = 'libvirt.LibvirtDriver' + end + it 'should declare class nova::compute with install_bridge_utils set to false' do should contain_class('nova::compute').with( 'install_bridge_utils' => false, ) diff --git a/tests/noop/spec/hosts/roles/compute_spec.rb b/tests/noop/spec/hosts/roles/compute_spec.rb index 9756cffab8..053ef41e3d 100644 --- a/tests/noop/spec/hosts/roles/compute_spec.rb +++ b/tests/noop/spec/hosts/roles/compute_spec.rb @@ -5,6 +5,8 @@ manifest = 'roles/compute.pp' describe manifest do shared_examples 'catalog' do + host_uuid = Noop.hiera 'host_uuid' + # Libvirtd.conf it 'should configure listen_tls, listen_tcp and auth_tcp in libvirtd.conf' do should contain_augeas('libvirt-conf').with( @@ -17,6 +19,13 @@ describe manifest do ) end + it 'should configure libvirt host_uuid' do + should contain_augeas('libvirt-conf-uuid').with( + :context => '/files/etc/libvirt/libvirtd.conf', + :changes => "set host_uuid #{host_uuid}" + ).that_notifies('Service[libvirt]') + end + # libvirt/qemu with(out) selinux/apparmor it 'libvirt/qemu config should have proper security_driver and apparmor configuration' do if facts[:osfamily] == 'RedHat'