From a867719e5db2ca9c42465c8a8689a143f30fc708 Mon Sep 17 00:00:00 2001 From: Eugene Kirpichov Date: Wed, 22 Aug 2012 16:50:33 -0700 Subject: [PATCH 01/12] API bind address customizable --- manifests/api.pp | 10 +++++++++- spec/classes/nova_api_spec.rb | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 8401b596..8498dce1 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -7,7 +7,8 @@ $auth_protocol = 'http', $admin_tenant_name = 'services', $admin_user = 'nova', - $admin_password = 'passw0rd' + $admin_password = 'passw0rd', + $api_bind_address = '0.0.0.0', ) { include nova::params @@ -33,6 +34,13 @@ nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; } + nova_config { + 'ec2_listen': value => $api_bind_address; + 'osapi_compute_listen': value => $api_bind_address; + 'metadata_listen': value => $api_bind_address; + 'osapi_volume_listen': value => $api_bind_address; + } + file { '/etc/nova/api-paste.ini': content => template('nova/api-paste.ini.erb'), require => Class['nova'], diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index e10e6b14..4873ea14 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -44,7 +44,7 @@ )} end describe 'with defaults' do - it 'should use default params for api-paste.init' do + it 'should use default params for api-paste.ini' do verify_contents(subject, '/etc/nova/api-paste.ini', [ '[filter:authtoken]', @@ -55,10 +55,14 @@ 'auth_uri = http://127.0.0.1:35357/v2.0', 'admin_tenant_name = services', 'admin_user = nova', - 'admin_password = passw0rd' + 'admin_password = passw0rd', ] ) end + it { should contain_nova_config('ec2_listen').with('value' => '0.0.0.0') } + it { should contain_nova_config('osapi_compute_listen').with('value' => '0.0.0.0') } + it { should contain_nova_config('metadata_listen').with('value' => '0.0.0.0') } + it { should contain_nova_config('osapi_volume_listen').with('value' => '0.0.0.0') } end describe 'with params' do let :params do @@ -69,10 +73,11 @@ :auth_protocol => 'https', :admin_tenant_name => 'service2', :admin_user => 'nova2', - :admin_password => 'passw0rd2' + :admin_password => 'passw0rd2', + :api_bind_address => '192.168.56.210', } end - it 'should use default params for api-paste.init' do + it 'should use default params for api-paste.ini' do verify_contents(subject, '/etc/nova/api-paste.ini', [ '[filter:authtoken]', @@ -83,10 +88,14 @@ 'auth_uri = https://10.0.0.1:1234/v2.0', 'admin_tenant_name = service2', 'admin_user = nova2', - 'admin_password = passw0rd2' + 'admin_password = passw0rd2', ] ) end + it { should contain_nova_config('ec2_listen').with('value' => '192.168.56.210') } + it { should contain_nova_config('osapi_compute_listen').with('value' => '192.168.56.210') } + it { should contain_nova_config('metadata_listen').with('value' => '192.168.56.210') } + it { should contain_nova_config('osapi_volume_listen').with('value' => '192.168.56.210') } end end describe 'on rhel' do From 9844ebbdcf64f21b188ef60ec93d10e3a64a00fa Mon Sep 17 00:00:00 2001 From: Joe Topjian Date: Tue, 11 Sep 2012 18:59:29 -0600 Subject: [PATCH 02/12] Added migration support to Nova --- manifests/compute/libvirt.pp | 13 +++++++-- manifests/migration/libvirt.pp | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 manifests/migration/libvirt.pp diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 0cb6bad6..9b9e70e3 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -1,6 +1,7 @@ class nova::compute::libvirt ( - $libvirt_type = 'kvm', - $vncserver_listen = '127.0.0.1' + $libvirt_type = 'kvm', + $vncserver_listen = '127.0.0.1', + $migration_support = false ) { include nova::params @@ -26,6 +27,14 @@ require => Package['libvirt'], } + if $migration_support { + if $vncserver_listen != '0.0.0.0' { + fail("For migration support to work, you MUST set vncserver_listen to '0.0.0.0'") + } else { + class { 'nova::migration::libvirt': } + } + } + nova_config { 'libvirt_type': value => $libvirt_type } nova_config { 'connection_type': value => 'libvirt' } nova_config { 'vncserver_listen': value => $vncserver_listen } diff --git a/manifests/migration/libvirt.pp b/manifests/migration/libvirt.pp new file mode 100644 index 00000000..97c56acc --- /dev/null +++ b/manifests/migration/libvirt.pp @@ -0,0 +1,51 @@ +class nova::migration::libvirt { + + define replace($file, $orig, $new) { + exec { "Replace ${orig} with ${new} in ${file}": + path => ['/bin', '/usr/bin'], + command => "perl -p -i -e 's/^${orig}\$/${new}/g' ${file}", + unless => "grep -q '^${new}$' ${file}", + notify => Service['libvirt'], + } + } + + case $::lsbdistid { + 'Ubuntu': { + # Ubuntu-specific, not Debian, due to upstart + + file_line { '/etc/libvirt/libvirtd.conf listen_tls': + path => '/etc/libvirt/libvirtd.conf', + line => 'listen_tls = 0', + match => 'listen_tls =', + notify => Service['libvirt'], + } + + file_line { '/etc/libvirt/libvirtd.conf listen_tcp': + path => '/etc/libvirt/libvirtd.conf', + line => 'listen_tcp = 1', + match => 'listen_tcp =', + notify => Service['libvirt'], + } + + file_line { '/etc/libvirt/libvirtd.conf auth_tcp': + path => '/etc/libvirt/libvirtd.conf', + line => 'auth_tcp = "none"', + match => 'auth_tcp =', + notify => Service['libvirt'], + } + + file_line { '/etc/init/libvirt-bin.conf libvirtd opts': + path => '/etc/init/libvirt-bin.conf', + line => 'env libvirtd_opts="-d -l"', + match => 'env libvirtd_opts=', + } + + file_line { '/etc/default/libvirt-bin libvirtd opts': + path => '/etc/default/libvirt-bin', + line => 'libvirtd_opts="-d -l"', + match => 'libvirtd_opts=', + } + + } + } +} From 4d8ddb83e6475bfa274c8fb5618d099e091a7641 Mon Sep 17 00:00:00 2001 From: Andy Edmonds Date: Sat, 6 Oct 2012 00:51:54 +0300 Subject: [PATCH 03/12] Enables the occi api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This modification enables the [OCCI](http://www.occi-wg.org)  [implementation](http://github.com/tmetsch/occi-os) for OpenStack. For usage [see the OpenStack wiki](http://wiki.openstack.org/occi). --- manifests/api.pp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/manifests/api.pp b/manifests/api.pp index 8498dce1..7d03df89 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -9,6 +9,7 @@ $admin_user = 'nova', $admin_password = 'passw0rd', $api_bind_address = '0.0.0.0', + $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata', ) { include nova::params @@ -32,6 +33,33 @@ service_name => $::nova::params::api_service_name, } + if 'occiapi' in $enabled_apis { + + ensure_resource( + 'package', 'python-pip', + { + 'ensure' => 'latest' + } + ) + + package { 'pyssf': + provider => pip, + ensure => latest, + require => Package['python-pip'] + } + + ensure_resource( + 'package', 'openstackocci', + { + 'provider' => 'pip', + 'ensure' => 'latest', + 'require' => 'Package[python-pip]' + } + ) + } + + nova_config { 'enabled_apis': value => $enabled_apis; } + nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; } nova_config { From b03719b97d1ccc1f3692bf19bf28510494fd7233 Mon Sep 17 00:00:00 2001 From: Andy Edmonds Date: Sat, 6 Oct 2012 00:54:49 +0300 Subject: [PATCH 04/12] Sets the configuration of the occi api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conditionally sets the configuration of the OCCI api should  `$enable_occi` be set to true in manifests/api.pp --- templates/api-paste.ini.erb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/templates/api-paste.ini.erb b/templates/api-paste.ini.erb index b94a3567..089b826f 100644 --- a/templates/api-paste.ini.erb +++ b/templates/api-paste.ini.erb @@ -134,6 +134,26 @@ pipeline = faultwrap osvolumeversionapp [app:osvolumeversionapp] paste.app_factory = nova.api.openstack.volume.versions:Versions.factory +<% if @enabled_apis.include? "occiapi" %> + +######## +# OCCI # +######## + +[composite:occiapi] +use = egg:Paste#urlmap +/: occiapppipe + +[pipeline:occiapppipe] +pipeline = authtoken keystonecontext occiapp +# with request body size limiting and rate limiting +# pipeline = sizelimit authtoken keystonecontext ratelimit occiapp + +[app:occiapp] +use = egg:openstackocci#occi_app + +<% end %> + ########## # Shared # ########## From 5f9ecbe53b255a6e3b07c0a95685fd868a7f43eb Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:08:08 -0700 Subject: [PATCH 05/12] Remove trailing comma Fix 2.6.x support --- manifests/api.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/api.pp b/manifests/api.pp index 7d03df89..53fa6b68 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -9,7 +9,7 @@ $admin_user = 'nova', $admin_password = 'passw0rd', $api_bind_address = '0.0.0.0', - $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata', + $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata' ) { include nova::params From ce7a7650ae65c6c7493d0170a0ee9b3bfe2a6a96 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:13:12 -0700 Subject: [PATCH 06/12] Revert "Remove trailing comma" This reverts commit 5f9ecbe53b255a6e3b07c0a95685fd868a7f43eb. --- manifests/api.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/api.pp b/manifests/api.pp index 53fa6b68..7d03df89 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -9,7 +9,7 @@ $admin_user = 'nova', $admin_password = 'passw0rd', $api_bind_address = '0.0.0.0', - $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata' + $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata', ) { include nova::params From 3568b698d4ced773d50fbedd3f9f802ced2484db Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:13:37 -0700 Subject: [PATCH 07/12] Revert "Merge pull request #151 from dizz/patch-1" This reverts commit c694267b381cfd76025a23f778bcdb0adf0f5278, reversing changes made to 05cf9128256948fa3de13f5a908503e9940fa7de. --- manifests/api.pp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 7d03df89..8498dce1 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -9,7 +9,6 @@ $admin_user = 'nova', $admin_password = 'passw0rd', $api_bind_address = '0.0.0.0', - $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata', ) { include nova::params @@ -33,33 +32,6 @@ service_name => $::nova::params::api_service_name, } - if 'occiapi' in $enabled_apis { - - ensure_resource( - 'package', 'python-pip', - { - 'ensure' => 'latest' - } - ) - - package { 'pyssf': - provider => pip, - ensure => latest, - require => Package['python-pip'] - } - - ensure_resource( - 'package', 'openstackocci', - { - 'provider' => 'pip', - 'ensure' => 'latest', - 'require' => 'Package[python-pip]' - } - ) - } - - nova_config { 'enabled_apis': value => $enabled_apis; } - nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; } nova_config { From 9c78fd79b4d581cd6e497a1593b5bfec3535fe25 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:22:47 -0700 Subject: [PATCH 08/12] Remove trailing comma from class parameter To fix 2.6.x support --- manifests/api.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/api.pp b/manifests/api.pp index 8498dce1..64482578 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -8,7 +8,7 @@ $admin_tenant_name = 'services', $admin_user = 'nova', $admin_password = 'passw0rd', - $api_bind_address = '0.0.0.0', + $api_bind_address = '0.0.0.0' ) { include nova::params From f0c31f99b71798bc6719880b0bc27e2f4502c921 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:27:28 -0700 Subject: [PATCH 09/12] Revert "Merge pull request #152 from dizz/patch-2" This reverts commit 05cf9128256948fa3de13f5a908503e9940fa7de, reversing changes made to d154dc1162bb5deb2066128f9a0fd0d9428adc12. --- templates/api-paste.ini.erb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/templates/api-paste.ini.erb b/templates/api-paste.ini.erb index 089b826f..b94a3567 100644 --- a/templates/api-paste.ini.erb +++ b/templates/api-paste.ini.erb @@ -134,26 +134,6 @@ pipeline = faultwrap osvolumeversionapp [app:osvolumeversionapp] paste.app_factory = nova.api.openstack.volume.versions:Versions.factory -<% if @enabled_apis.include? "occiapi" %> - -######## -# OCCI # -######## - -[composite:occiapi] -use = egg:Paste#urlmap -/: occiapppipe - -[pipeline:occiapppipe] -pipeline = authtoken keystonecontext occiapp -# with request body size limiting and rate limiting -# pipeline = sizelimit authtoken keystonecontext ratelimit occiapp - -[app:occiapp] -use = egg:openstackocci#occi_app - -<% end %> - ########## # Shared # ########## From 9f6055902e78fde216c36f770503b3fe68ec2d78 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:10:31 -0700 Subject: [PATCH 10/12] 0.2.0 release --- CHANGELOG | 9 +++++++++ Modulefile | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8035b107..9b4081c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +* 2012-10-08 0.2.2 +- various improvements for testing +- Adds support for system usage data notifications via rabbitmq driver +- Parameterize the nova db charset +- Add dhcp_domain to vlan manifest and flatdhcp +- Adds basic quantum support +- support Redhat +- make bind address customizable +- Enable occi api * 2012-06-12 0.1.1 - Fix dependency for automatic forge installation diff --git a/Modulefile b/Modulefile index f1012a67..0f2fd4d3 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ name 'puppetlabs-nova' -version '0.1.1' +version '0.2.0' source 'https://github.com/puppetlabs/puppetlabs-nova' author 'Puppet Labs' license 'Apache License 2.0' @@ -8,10 +8,10 @@ description 'Puppet module to install and configure the OpenStack Nova compute s project_page 'https://github.com/puppetlabs/puppetlabs-nova' ## Add dependencies, if any: -dependency 'puppetlabs/apt', '>= 0.0.3' -dependency 'puppetlabs/glance', '>= 0.1.0' -dependency 'puppetlabs/keystone', '>= 0.1.0' -dependency 'puppetlabs/mysql', '>= 0.3.0' -dependency 'puppetlabs/rabbitmq', '>= 2.0.0' -dependency 'puppetlabs/stdlib', '>= 2.3.0' +dependency 'puppetlabs/apt', '>= 0.0.4' +dependency 'puppetlabs/glance', '>= 0.2.0' +dependency 'puppetlabs/keystone', '>= 0.2.0' +dependency 'puppetlabs/mysql', '>= 0.5.0' +dependency 'puppetlabs/rabbitmq', '>= 2.0.2' +dependency 'puppetlabs/stdlib', '>= 2.4.0' dependency 'duritong/sysctl', '>= 0.0.1' From 09c297c54d2e3f848a4d4afc0c2645b16a5f7f82 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 8 Oct 2012 14:30:40 -0700 Subject: [PATCH 11/12] Remove occi mention from changelog I had to revert it :( --- CHANGELOG | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9b4081c6..ce6675c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,6 @@ - Adds basic quantum support - support Redhat - make bind address customizable -- Enable occi api * 2012-06-12 0.1.1 - Fix dependency for automatic forge installation From deb3f0f11e42f4c98915474f34c52112986aaa5e Mon Sep 17 00:00:00 2001 From: Andy Edmonds Date: Sun, 14 Oct 2012 20:39:26 +0200 Subject: [PATCH 12/12] Adds the ability to set enabled APIs This modification both allows setting what API to enable and enables the [OCCI](http://www.occi-wg.org) [implementation](http://github.com/tmetsch/occi-os) for OpenStack. For usage [see the OpenStack wiki](http://wiki.openstack.org/occi). --- manifests/api.pp | 25 ++++++++++++++++++++++++- templates/api-paste.ini.erb | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/manifests/api.pp b/manifests/api.pp index 64482578..05b42d80 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -8,7 +8,8 @@ $admin_tenant_name = 'services', $admin_user = 'nova', $admin_password = 'passw0rd', - $api_bind_address = '0.0.0.0' + $api_bind_address = '0.0.0.0', + $enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata' ) { include nova::params @@ -32,6 +33,28 @@ service_name => $::nova::params::api_service_name, } + if 'occiapi' in $enabled_apis { + if !defined(Package['python-pip']) { + package {'python-pip': + ensure => latest, + } + } + if !defined(Package['pyssf']){ + package {'pyssf': + provider => pip, + ensure => latest, + require => Package['python-pip'] + } + } + package { 'openstackocci' : + provider => 'pip', + ensure => latest, + require => Package['python-pip'], + } + } + + nova_config { 'enabled_apis': value => $enabled_apis; } + nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; } nova_config { diff --git a/templates/api-paste.ini.erb b/templates/api-paste.ini.erb index b94a3567..089b826f 100644 --- a/templates/api-paste.ini.erb +++ b/templates/api-paste.ini.erb @@ -134,6 +134,26 @@ pipeline = faultwrap osvolumeversionapp [app:osvolumeversionapp] paste.app_factory = nova.api.openstack.volume.versions:Versions.factory +<% if @enabled_apis.include? "occiapi" %> + +######## +# OCCI # +######## + +[composite:occiapi] +use = egg:Paste#urlmap +/: occiapppipe + +[pipeline:occiapppipe] +pipeline = authtoken keystonecontext occiapp +# with request body size limiting and rate limiting +# pipeline = sizelimit authtoken keystonecontext ratelimit occiapp + +[app:occiapp] +use = egg:openstackocci#occi_app + +<% end %> + ########## # Shared # ##########