summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasyl Saienko <vsaienko@mirantis.com>2017-03-13 15:41:09 +0200
committerVasyl Saienko <vsaienko@mirantis.com>2017-04-01 01:16:17 +0300
commitee596db56ed0ac99a8edfce9155a0552d57d757f (patch)
tree70180993d719d180bead860e5971ba7639604d28
parent9b13f574eaac8d06cf0ec96651108edb49a7caa8 (diff)
Add Ironic multitenancy support
This patch removes hardcoded type for 'baremetal' Neutron network. Update ironic conductor config with new config option: * enabled_network_interfaces - list of enabled network interfaces on Ironic conductor * cleaning_network_name - name of Neutron network to be used during node cleaning * provisioning_network_name - name of Neutron network to be used during node provisioning Add openrc generation task for nodes with ironic role, needed as it is required for translation from name to uuid. Change-Id: I63da8332cade0e76bdd687f0522bbc4c3006a68f Related-Bug: #1588380
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+2: Denis Egorenko <degorenko@mirantis.com> Code-Review+2: Stanislaw Bogatkin <sbogatkin@mirantis.com> Workflow+1: Denis Egorenko <degorenko@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 05 Apr 2017 08:29:54 +0000 Reviewed-on: https://review.openstack.org/444909 Project: openstack/fuel-library Branch: refs/heads/master
-rw-r--r--deployment/puppet/openstack_tasks/examples/keystone/tasks.yaml2
-rw-r--r--deployment/puppet/openstack_tasks/examples/roles/tasks.yaml6
-rw-r--r--deployment/puppet/openstack_tasks/manifests/openstack_network/networks.pp10
-rw-r--r--deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp13
-rw-r--r--deployment/puppet/osnailyfacter/modular/ssl/tasks.yaml6
-rw-r--r--tests/noop/spec/hosts/openstack-network/networks_spec.rb11
-rw-r--r--tests/noop/spec/hosts/roles/ironic-conductor_spec.rb12
7 files changed, 46 insertions, 14 deletions
diff --git a/deployment/puppet/openstack_tasks/examples/keystone/tasks.yaml b/deployment/puppet/openstack_tasks/examples/keystone/tasks.yaml
index c45535e..9a8bedc 100644
--- a/deployment/puppet/openstack_tasks/examples/keystone/tasks.yaml
+++ b/deployment/puppet/openstack_tasks/examples/keystone/tasks.yaml
@@ -37,7 +37,7 @@
37- id: keystone-openrc-generate 37- id: keystone-openrc-generate
38 type: puppet 38 type: puppet
39 version: 2.2.0 39 version: 2.2.0
40 tags: [primary-controller, controller, primary-neutron, neutron] 40 tags: [primary-controller, controller, primary-neutron, neutron, ironic]
41 requires: [openrc-delete, primary-keystone, keystone] 41 requires: [openrc-delete, primary-keystone, keystone]
42 cross-depends: 42 cross-depends:
43 - name: openrc-delete 43 - name: openrc-delete
diff --git a/deployment/puppet/openstack_tasks/examples/roles/tasks.yaml b/deployment/puppet/openstack_tasks/examples/roles/tasks.yaml
index 4d80f09..71729f0 100644
--- a/deployment/puppet/openstack_tasks/examples/roles/tasks.yaml
+++ b/deployment/puppet/openstack_tasks/examples/roles/tasks.yaml
@@ -148,10 +148,10 @@
148 148
149- id: ironic-conductor 149- id: ironic-conductor
150 type: puppet 150 type: puppet
151 version: 2.1.0 151 version: 2.2.0
152 groups: [ironic] 152 groups: [ironic]
153 required_for: [deploy_end] 153 required_for: [deploy_end]
154 requires: [hosts, firewall] 154 requires: [hosts, firewall, keystone-openrc-generate]
155 condition: 155 condition:
156 yaql_exp: > 156 yaql_exp: >
157 $.ironic.enabled and changedAny($.network_scheme, $.ironic, 157 $.ironic.enabled and changedAny($.network_scheme, $.ironic,
@@ -167,6 +167,8 @@
167 - name: ironic-api 167 - name: ironic-api
168 - name: ironic-db 168 - name: ironic-db
169 - name: /^(primary-)?rabbitmq$/ 169 - name: /^(primary-)?rabbitmq$/
170 - name: openstack-network-networks
171 role: ["/^(primary-)?neutron$/"]
170 parameters: 172 parameters:
171 puppet_manifest: /etc/puppet/modules/openstack_tasks/examples/roles/ironic-conductor.pp 173 puppet_manifest: /etc/puppet/modules/openstack_tasks/examples/roles/ironic-conductor.pp
172 puppet_modules: /etc/puppet/modules 174 puppet_modules: /etc/puppet/modules
diff --git a/deployment/puppet/openstack_tasks/manifests/openstack_network/networks.pp b/deployment/puppet/openstack_tasks/manifests/openstack_network/networks.pp
index d0d3467..54f6b46 100644
--- a/deployment/puppet/openstack_tasks/manifests/openstack_network/networks.pp
+++ b/deployment/puppet/openstack_tasks/manifests/openstack_network/networks.pp
@@ -88,10 +88,18 @@ class openstack_tasks::openstack_network::networks {
88 $baremetal_router_external = dig44($nets, ['baremetal', 'L2', 'router_ext']) 88 $baremetal_router_external = dig44($nets, ['baremetal', 'L2', 'router_ext'])
89 $baremetal_shared = dig44($nets, ['baremetal', 'shared'], false) 89 $baremetal_shared = dig44($nets, ['baremetal', 'shared'], false)
90 90
91 $ironic_settings_hash = hiera_hash('ironic_settings', {})
92 $ironic_provision_network = dig44($ironic_settings_hash, ['ironic_provision_network'], false)
93 if $ironic_provision_network {
94 $baremetal_provider_network_type = 'vlan'
95 } else {
96 $baremetal_provider_network_type = 'flat'
97 }
98
91 neutron_network { 'baremetal' : 99 neutron_network { 'baremetal' :
92 ensure => 'present', 100 ensure => 'present',
93 provider_physical_network => $baremetal_physnet, 101 provider_physical_network => $baremetal_physnet,
94 provider_network_type => 'flat', 102 provider_network_type => $baremetal_provider_network_type,
95 provider_segmentation_id => $baremetal_segment_id, 103 provider_segmentation_id => $baremetal_segment_id,
96 router_external => $baremetal_router_external, 104 router_external => $baremetal_router_external,
97 tenant_name => $tenant_name, 105 tenant_name => $tenant_name,
diff --git a/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp b/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp
index 348d763..81c7240 100644
--- a/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp
+++ b/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp
@@ -107,9 +107,16 @@ class openstack_tasks::roles::ironic_conductor {
107 class { '::ironic::client': } 107 class { '::ironic::client': }
108 108
109 class { '::ironic::conductor': 109 class { '::ironic::conductor':
110 api_url => "http://${baremetal_vip}:6385", 110 api_url => "http://${baremetal_vip}:6385",
111 enabled_drivers => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'], 111 enabled_drivers => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'],
112 swift_temp_url_key => $ironic_swift_tempurl_key, 112 swift_temp_url_key => $ironic_swift_tempurl_key,
113 cleaning_network_name => 'baremetal',
114 provisioning_network_name => 'baremetal',
115
116 }
117
118 class { '::ironic::drivers::interfaces':
119 enabled_network_interfaces => ['noop', 'flat', 'neutron']
113 } 120 }
114 121
115 class { '::ironic::drivers::pxe': 122 class { '::ironic::drivers::pxe':
diff --git a/deployment/puppet/osnailyfacter/modular/ssl/tasks.yaml b/deployment/puppet/osnailyfacter/modular/ssl/tasks.yaml
index 3970cb8..601181d 100644
--- a/deployment/puppet/osnailyfacter/modular/ssl/tasks.yaml
+++ b/deployment/puppet/osnailyfacter/modular/ssl/tasks.yaml
@@ -2,7 +2,7 @@
2 type: puppet 2 type: puppet
3 version: 2.2.0 3 version: 2.2.0
4 tags: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt, 4 tags: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt,
5 primary-keystone, keystone] 5 primary-keystone, keystone, ironic]
6 requires: [firewall] 6 requires: [firewall]
7 condition: 7 condition:
8 yaql_exp: > 8 yaql_exp: >
@@ -22,7 +22,7 @@
22 type: puppet 22 type: puppet
23 version: 2.2.0 23 version: 2.2.0
24 tags: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt, 24 tags: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt,
25 primary-keystone, keystone] 25 primary-keystone, keystone, ironic]
26 requires: [firewall, ssl-keys-saving] 26 requires: [firewall, ssl-keys-saving]
27 condition: 27 condition:
28 yaql_exp: &public_ssl_enabled > 28 yaql_exp: &public_ssl_enabled >
@@ -42,7 +42,7 @@
42 version: 2.1.0 42 version: 2.1.0
43 groups: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt, 43 groups: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt,
44 primary-rabbitmq, rabbitmq, primary-database, database, 44 primary-rabbitmq, rabbitmq, primary-database, database,
45 primary-keystone, keystone, primary-neutron, neutron] 45 primary-keystone, keystone, primary-neutron, neutron, ironic]
46 requires: [firewall, ssl-add-trust-chain] 46 requires: [firewall, ssl-add-trust-chain]
47 condition: 47 condition:
48 yaql_exp: *public_ssl_enabled 48 yaql_exp: *public_ssl_enabled
diff --git a/tests/noop/spec/hosts/openstack-network/networks_spec.rb b/tests/noop/spec/hosts/openstack-network/networks_spec.rb
index eee6bb3..1384882 100644
--- a/tests/noop/spec/hosts/openstack-network/networks_spec.rb
+++ b/tests/noop/spec/hosts/openstack-network/networks_spec.rb
@@ -91,11 +91,18 @@ describe manifest do
91 end 91 end
92 92
93 context 'Ironic baremetal network', :if => nets.has_key?('baremetal') do 93 context 'Ironic baremetal network', :if => nets.has_key?('baremetal') do
94 let(:baremetal_provider_network_type) do
95 if Noop.hiera_structure('ironic_settings/ironic_provision_network', false)
96 'vlan'
97 else
98 'flat'
99 end
100 end
94 it 'should create baremetal network' do 101 it 'should create baremetal network' do
95 should contain_neutron_network('baremetal').with( 102 should contain_neutron_network('baremetal').with(
96 'ensure' => 'present', 103 'ensure' => 'present',
97 'provider_physical_network' => nets['baremetal']['L2']['physnet'], 104 'provider_physical_network' => nets['baremetal']['L2']['physnet'],
98 'provider_network_type' => 'flat', 105 'provider_network_type' => baremetal_provider_network_type,
99 'provider_segmentation_id' => nets['baremetal']['L2']['segment_id'], 106 'provider_segmentation_id' => nets['baremetal']['L2']['segment_id'],
100 'router_external' => nets['baremetal']['L2']['router_ext'], 107 'router_external' => nets['baremetal']['L2']['router_ext'],
101 'shared' => nets['baremetal']['shared'], 108 'shared' => nets['baremetal']['shared'],
diff --git a/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb b/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb
index 76ff8a6..97af34a 100644
--- a/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb
+++ b/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb
@@ -38,11 +38,19 @@ describe manifest do
38 38
39 it 'should declare ironic::conductor class correctly' do 39 it 'should declare ironic::conductor class correctly' do
40 should contain_class('ironic::conductor').with( 40 should contain_class('ironic::conductor').with(
41 'api_url' => "http://#{baremetal_vip}:6385", 41 'api_url' => "http://#{baremetal_vip}:6385",
42 'enabled_drivers' => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'], 42 'enabled_drivers' => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'],
43 'cleaning_network_name' => "baremetal",
44 'provisioning_network_name' => "baremetal",
43 ) 45 )
44 end 46 end
45 47
48 it 'should declare ironic::drivers:interfaces correctly' do
49 should contain_class('ironic::drivers::interfaces').with(
50 'enabled_network_interfaces' => ['noop', 'flat', 'neutron']
51 )
52 end
53
46 it 'should configure the database connection string' do 54 it 'should configure the database connection string' do
47 if facts[:os_package_type] == 'debian' 55 if facts[:os_package_type] == 'debian'
48 extra_params = '?charset=utf8&read_timeout=60' 56 extra_params = '?charset=utf8&read_timeout=60'