Browse Source

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
Vasyl Saienko 2 years ago
parent
commit
ee596db56e

+ 1
- 1
deployment/puppet/openstack_tasks/examples/keystone/tasks.yaml View File

@@ -37,7 +37,7 @@
37 37
 - id: keystone-openrc-generate
38 38
   type: puppet
39 39
   version: 2.2.0
40
-  tags: [primary-controller, controller, primary-neutron, neutron]
40
+  tags: [primary-controller, controller, primary-neutron, neutron, ironic]
41 41
   requires: [openrc-delete, primary-keystone, keystone]
42 42
   cross-depends:
43 43
     - name: openrc-delete

+ 4
- 2
deployment/puppet/openstack_tasks/examples/roles/tasks.yaml View File

@@ -148,10 +148,10 @@
148 148
 
149 149
 - id: ironic-conductor
150 150
   type: puppet
151
-  version: 2.1.0
151
+  version: 2.2.0
152 152
   groups: [ironic]
153 153
   required_for: [deploy_end]
154
-  requires: [hosts, firewall]
154
+  requires: [hosts, firewall, keystone-openrc-generate]
155 155
   condition:
156 156
     yaql_exp: >
157 157
       $.ironic.enabled and changedAny($.network_scheme, $.ironic,
@@ -167,6 +167,8 @@
167 167
     - name: ironic-api
168 168
     - name: ironic-db
169 169
     - name: /^(primary-)?rabbitmq$/
170
+    - name: openstack-network-networks
171
+      role: ["/^(primary-)?neutron$/"]
170 172
   parameters:
171 173
     puppet_manifest: /etc/puppet/modules/openstack_tasks/examples/roles/ironic-conductor.pp
172 174
     puppet_modules: /etc/puppet/modules

+ 9
- 1
deployment/puppet/openstack_tasks/manifests/openstack_network/networks.pp View File

@@ -88,10 +88,18 @@ class openstack_tasks::openstack_network::networks {
88 88
     $baremetal_router_external = dig44($nets, ['baremetal', 'L2', 'router_ext'])
89 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 99
     neutron_network { 'baremetal' :
92 100
       ensure                    => 'present',
93 101
       provider_physical_network => $baremetal_physnet,
94
-      provider_network_type     => 'flat',
102
+      provider_network_type     => $baremetal_provider_network_type,
95 103
       provider_segmentation_id  => $baremetal_segment_id,
96 104
       router_external           => $baremetal_router_external,
97 105
       tenant_name               => $tenant_name,

+ 10
- 3
deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp View File

@@ -107,9 +107,16 @@ class openstack_tasks::roles::ironic_conductor {
107 107
   class { '::ironic::client': }
108 108
 
109 109
   class { '::ironic::conductor':
110
-    api_url            => "http://${baremetal_vip}:6385",
111
-    enabled_drivers    => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'],
112
-    swift_temp_url_key => $ironic_swift_tempurl_key,
110
+    api_url                   => "http://${baremetal_vip}:6385",
111
+    enabled_drivers           => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'],
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 122
   class { '::ironic::drivers::pxe':

+ 3
- 3
deployment/puppet/osnailyfacter/modular/ssl/tasks.yaml View File

@@ -2,7 +2,7 @@
2 2
   type: puppet
3 3
   version: 2.2.0
4 4
   tags: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt,
5
-         primary-keystone, keystone]
5
+         primary-keystone, keystone, ironic]
6 6
   requires: [firewall]
7 7
   condition:
8 8
     yaql_exp: >
@@ -22,7 +22,7 @@
22 22
   type: puppet
23 23
   version: 2.2.0
24 24
   tags: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt,
25
-         primary-keystone, keystone]
25
+         primary-keystone, keystone, ironic]
26 26
   requires: [firewall, ssl-keys-saving]
27 27
   condition:
28 28
     yaql_exp: &public_ssl_enabled >
@@ -42,7 +42,7 @@
42 42
   version: 2.1.0
43 43
   groups: [primary-controller, controller, compute, cinder, primary-mongo, mongo, ceph-osd, virt,
44 44
            primary-rabbitmq, rabbitmq, primary-database, database,
45
-           primary-keystone, keystone, primary-neutron, neutron]
45
+           primary-keystone, keystone, primary-neutron, neutron, ironic]
46 46
   requires: [firewall, ssl-add-trust-chain]
47 47
   condition:
48 48
     yaql_exp: *public_ssl_enabled

+ 9
- 2
tests/noop/spec/hosts/openstack-network/networks_spec.rb View File

@@ -91,11 +91,18 @@ describe manifest do
91 91
         end
92 92
 
93 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 101
           it 'should create baremetal network' do
95
-            should contain_neutron_network('baremetal').with(
102
+          should contain_neutron_network('baremetal').with(
96 103
               'ensure'                    => 'present',
97 104
               'provider_physical_network' => nets['baremetal']['L2']['physnet'],
98
-              'provider_network_type'     => 'flat',
105
+              'provider_network_type'     => baremetal_provider_network_type,
99 106
               'provider_segmentation_id'  => nets['baremetal']['L2']['segment_id'],
100 107
               'router_external'           => nets['baremetal']['L2']['router_ext'],
101 108
               'shared'                    => nets['baremetal']['shared'],

+ 10
- 2
tests/noop/spec/hosts/roles/ironic-conductor_spec.rb View File

@@ -38,11 +38,19 @@ describe manifest do
38 38
 
39 39
       it 'should declare ironic::conductor class correctly' do
40 40
         should contain_class('ironic::conductor').with(
41
-          'api_url'         => "http://#{baremetal_vip}:6385",
42
-          'enabled_drivers' => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'],
41
+          'api_url'                   => "http://#{baremetal_vip}:6385",
42
+          'enabled_drivers'           => ['fuel_ssh', 'fuel_ipmitool', 'fake', 'fuel_libvirt'],
43
+          'cleaning_network_name'     => "baremetal",
44
+          'provisioning_network_name' => "baremetal",
43 45
         )
44 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 54
       it 'should configure the database connection string' do
47 55
         if facts[:os_package_type] == 'debian'
48 56
           extra_params = '?charset=utf8&read_timeout=60'

Loading…
Cancel
Save