diff --git a/elements/puppet-stack-config/install.d/02-puppet-stack-config b/elements/puppet-stack-config/install.d/02-puppet-stack-config index b3a2c78b2..b6a89c6ec 100755 --- a/elements/puppet-stack-config/install.d/02-puppet-stack-config +++ b/elements/puppet-stack-config/install.d/02-puppet-stack-config @@ -55,6 +55,8 @@ context = { 'UNDERCLOUD_DEBUG': os.environ.get('UNDERCLOUD_DEBUG', 'true'), 'INSPECTION_IPRANGE': os.environ.get('INSPECTION_IPRANGE', '192.0.2.100,192.0.2.120'), 'INSPECTION_INTERFACE': os.environ.get('INSPECTION_INTERFACE', 'br-ctlplane'), + 'INSPECTION_COLLECTORS': os.environ.get('INSPECTION_COLLECTORS', 'default,logs'), + 'INSPECTION_KERNEL_ARGS': os.environ.get('INSPECTION_KERNEL_ARGS', ''), 'ENABLE_TEMPEST': os.environ.get('ENABLE_TEMPEST', 'true'), 'IPXE_DEPLOY': os.environ.get('IPXE_DEPLOY', 'true'), 'UNDERCLOUD_ADMIN_VIP': os.environ.get('UNDERCLOUD_ADMIN_VIP', ''), diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template index a3e7e3506..5da6f6c95 100644 --- a/elements/puppet-stack-config/puppet-stack-config.yaml.template +++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template @@ -316,7 +316,9 @@ ironic::inspector::swift_auth_url: "http://{{LOCAL_IP}}:5000/v2.0" ironic::inspector::dnsmasq_local_ip: {{LOCAL_IP}} ironic::inspector::dnsmasq_ip_range: {{INSPECTION_IPRANGE}} ironic::inspector::dnsmasq_interface: {{INSPECTION_INTERFACE}} -ironic::inspector::ramdisk_collectors: 'default,logs' +ironic::inspector::ramdisk_collectors: {{INSPECTION_COLLECTORS}} +ironic::inspector::additional_processing_hooks: 'extra_hardware' +ironic::inspector::ramdisk_kernel_args: {{INSPECTION_KERNEL_ARGS}} # Rabbit rabbit_cookie: {{UNDERCLOUD_RABBIT_COOKIE}} diff --git a/instack_undercloud/tests/test_undercloud.py b/instack_undercloud/tests/test_undercloud.py index b15fffd05..5bf5ddc42 100644 --- a/instack_undercloud/tests/test_undercloud.py +++ b/instack_undercloud/tests/test_undercloud.py @@ -216,7 +216,8 @@ class TestGenerateEnvironment(BaseTestCase): def test_opts_in_env(self): env = undercloud._generate_environment('.') # Just spot check, we don't want to replicate the entire opt list here - self.assertEqual(env['INSPECTION_RUNBENCH'], '0') + self.assertEqual(env['INSPECTION_COLLECTORS'], + 'default,logs') self.assertEqual('192.0.2.1/24', env['PUBLIC_INTERFACE_IP']) self.assertEqual('192.0.2.1', env['LOCAL_IP']) diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py index 14a3b28aa..19c0e8bfb 100644 --- a/instack_undercloud/undercloud.py +++ b/instack_undercloud/undercloud.py @@ -162,10 +162,17 @@ _opts = [ 'range defined by dhcp_start and dhcp_end, but should ' 'be in the same network.') ), + cfg.BoolOpt('inspection_extras', + default=False, + help=('Whether to enable extra hardware collection during ' + 'the inspection process. Requires python-hardware or ' + 'python-hardware-detect package on the introspection ' + 'image.')), cfg.BoolOpt('inspection_runbench', default=False, deprecated_name='discovery_runbench', - help='Whether to run benchmarks when inspecting nodes.' + help=('Whether to run benchmarks when inspecting nodes. ' + 'Requires inspection_extras set to True.') ), cfg.BoolOpt('undercloud_debug', default=True, @@ -640,9 +647,18 @@ def _generate_environment(instack_root): else: instack_env[env_name] = six.text_type(CONF[opt.name]) # Opts that needs extra processing - if instack_env.get('INSPECTION_RUNBENCH') not in ['0', '1']: - instack_env['INSPECTION_RUNBENCH'] = ('1' if CONF.inspection_runbench - else '0') + if CONF.inspection_runbench and not CONF.inspection_extras: + raise RuntimeError('inspection_extras must be enabled for ' + 'inspection_runbench to work') + if CONF.inspection_extras: + instack_env['INSPECTION_COLLECTORS'] = 'default,extra-hardware,logs' + else: + instack_env['INSPECTION_COLLECTORS'] = 'default,logs' + + if CONF.inspection_runbench: + instack_env['INSPECTION_KERNEL_ARGS'] = ( + 'ipa-inspection-benchmarks=cpu,mem,disk') + instack_env['PUBLIC_INTERFACE_IP'] = instack_env['LOCAL_IP'] instack_env['LOCAL_IP'] = instack_env['LOCAL_IP'].split('/')[0] if instack_env['UNDERCLOUD_SERVICE_CERTIFICATE']: diff --git a/undercloud.conf.sample b/undercloud.conf.sample index 4835d2a8c..a3c46d380 100644 --- a/undercloud.conf.sample +++ b/undercloud.conf.sample @@ -68,7 +68,13 @@ # Deprecated group/name - [DEFAULT]/discovery_iprange #inspection_iprange = 192.0.2.100,192.0.2.120 -# Whether to run benchmarks when inspecting nodes. (boolean value) +# Whether to enable extra hardware collection during the inspection +# process. Requires python-hardware or python-hardware-detect package +# on the introspection image. (boolean value) +#inspection_extras = false + +# Whether to run benchmarks when inspecting nodes. Requires +# inspection_extras set to True. (boolean value) # Deprecated group/name - [DEFAULT]/discovery_runbench #inspection_runbench = false