Add support for configuring additional architectures
In this case an additional architecture is any architecture that is NOT the same as the one running the install. Blueprint: multiarch-support Change-Id: I23f438cb41ebc454d4a4351901a86452e2b0d482
This commit is contained in:
parent
28fd522886
commit
82c2fead13
|
@ -605,6 +605,15 @@ ironic::drivers::agent::deploy_logs_local_path: '/var/log/ironic/deploy/'
|
|||
# Ironic power and management drivers tuning
|
||||
ironic::drivers::ilo::default_boot_mode: 'bios'
|
||||
|
||||
# Customisations for ppc64le
|
||||
{{#ENABLE_ARCHITECTURE_PPC64LE}}
|
||||
ironic::pxe::enable_ppc64le: true
|
||||
ironic::inspector::enable_ppc64le: true
|
||||
ironic::conductor::power_state_change_timeout: 60
|
||||
ironic::drivers::ipmi::command_retry_timeout: 120
|
||||
ironic::drivers::ipmi::min_command_interval: 15
|
||||
{{/ENABLE_ARCHITECTURE_PPC64LE}}
|
||||
|
||||
# Rabbit
|
||||
rabbit_cookie: {{UNDERCLOUD_RABBIT_COOKIE}}
|
||||
rabbitmq::delete_guest_user: false
|
||||
|
|
|
@ -193,3 +193,20 @@ class TestValidator(base.BaseTestCase):
|
|||
ifaces_mock.return_value = ['eth0', 'eth1']
|
||||
self.conf.config(local_interface='em2', net_config_override='foo')
|
||||
undercloud._validate_network()
|
||||
|
||||
def test_validate_additional_architectures_ok(self):
|
||||
self.conf.config(additional_architectures=['ppc64le'],
|
||||
ipxe_enabled=False)
|
||||
undercloud._validate_architecure_options()
|
||||
|
||||
def test_validate_additional_architectures_bad_arch(self):
|
||||
self.conf.config(additional_architectures=['ppc64le', 'INVALID'],
|
||||
ipxe_enabled=False)
|
||||
self.assertRaises(validator.FailedValidation,
|
||||
undercloud._validate_architecure_options)
|
||||
|
||||
def test_validate_additional_architectures_ipxe_fail(self):
|
||||
self.conf.config(additional_architectures=['ppc64le'],
|
||||
ipxe_enabled=True)
|
||||
self.assertRaises(validator.FailedValidation,
|
||||
undercloud._validate_architecure_options)
|
||||
|
|
|
@ -375,6 +375,11 @@ _opts = [
|
|||
help=('An optional docker \'registry-mirror\' that will be'
|
||||
'configured in /etc/docker/daemon.json.')
|
||||
),
|
||||
cfg.ListOpt('additional_architectures',
|
||||
default=[],
|
||||
help=('List of additional architectures enabled in your cloud '
|
||||
'environment. The list of supported values is: %s'
|
||||
% ' '.join(validator.SUPPORTED_ARCHITECTURES))),
|
||||
]
|
||||
|
||||
# Passwords, tokens, hashes
|
||||
|
@ -762,6 +767,16 @@ def _validate_passwords_file():
|
|||
raise validator.FailedValidation(message)
|
||||
|
||||
|
||||
def _validate_architecure_options():
|
||||
def error_handler(message):
|
||||
LOG.error('Undercloud configuration validation failed: %s', message)
|
||||
raise validator.FailedValidation(message)
|
||||
|
||||
params = {opt.name: CONF[opt.name] for opt in _opts}
|
||||
validator._validate_additional_architectures(params, error_handler)
|
||||
validator._validate_ppc64le_exclusive_opts(params, error_handler)
|
||||
|
||||
|
||||
def _validate_configuration():
|
||||
try:
|
||||
_check_hostname()
|
||||
|
@ -770,6 +785,7 @@ def _validate_configuration():
|
|||
_validate_network()
|
||||
_validate_no_ip_change()
|
||||
_validate_passwords_file()
|
||||
_validate_architecure_options()
|
||||
except RuntimeError as e:
|
||||
LOG.error('An error occurred during configuration validation, '
|
||||
'please check your host configuration and try again. '
|
||||
|
@ -1064,7 +1080,8 @@ class InstackEnvironment(dict):
|
|||
'ENABLED_BOOT_INTERFACES', 'ENABLED_POWER_INTERFACES',
|
||||
'ENABLED_RAID_INTERFACES', 'ENABLED_VENDOR_INTERFACES',
|
||||
'ENABLED_MANAGEMENT_INTERFACES', 'SYSCTL_SETTINGS',
|
||||
'LOCAL_IP_WRAPPED'}
|
||||
'LOCAL_IP_WRAPPED', 'ENABLE_ARCHITECTURE_PPC64LE',
|
||||
}
|
||||
"""The variables we calculate in _generate_environment call."""
|
||||
|
||||
PUPPET_KEYS = DYNAMIC_KEYS | {opt.name.upper() for _, group in list_opts()
|
||||
|
@ -1223,10 +1240,16 @@ def _generate_environment(instack_root):
|
|||
else:
|
||||
raise RuntimeError('%s is not supported' % distro)
|
||||
|
||||
if CONF['additional_architectures']:
|
||||
for arch in CONF['additional_architectures']:
|
||||
env_name = ('enable_architecture_%s' % arch).upper()
|
||||
instack_env[env_name] = six.text_type(True)
|
||||
|
||||
# Convert conf opts to env values
|
||||
for opt in _opts:
|
||||
env_name = opt.name.upper()
|
||||
instack_env[env_name] = six.text_type(CONF[opt.name])
|
||||
|
||||
# Opts that needs extra processing
|
||||
if CONF.inspection_runbench and not CONF.inspection_extras:
|
||||
raise RuntimeError('inspection_extras must be enabled for '
|
||||
|
|
|
@ -16,6 +16,9 @@ import netaddr
|
|||
import netifaces
|
||||
|
||||
|
||||
SUPPORTED_ARCHITECTURES = ['ppc64le']
|
||||
|
||||
|
||||
class FailedValidation(Exception):
|
||||
pass
|
||||
|
||||
|
@ -39,6 +42,21 @@ def validate_config(params, error_callback):
|
|||
_validate_interface_exists(local_params, error_callback)
|
||||
|
||||
|
||||
def _validate_ppc64le_exclusive_opts(params, error_callback):
|
||||
if 'ppc64le' in params['additional_architectures']:
|
||||
if 'ipxe_enabled' in params and params['ipxe_enabled']:
|
||||
error_callback('Currently iPXE boot isn\'t supported with '
|
||||
'ppc64le systems but is enabled')
|
||||
|
||||
|
||||
def _validate_additional_architectures(params, error_callback):
|
||||
for arch in params['additional_architectures']:
|
||||
if arch not in SUPPORTED_ARCHITECTURES:
|
||||
error_callback('%s "%s" must be a supported architecture: %s' %
|
||||
('additional_architectures', arch,
|
||||
' '.join(SUPPORTED_ARCHITECTURES)))
|
||||
|
||||
|
||||
def _validate_ips(params, error_callback):
|
||||
def is_ip(value, param_name):
|
||||
try:
|
||||
|
|
|
@ -215,6 +215,10 @@
|
|||
# /etc/docker/daemon.json. (string value)
|
||||
#docker_registry_mirror =
|
||||
|
||||
# List of additional architectures enabled in your cloud environment.
|
||||
# The list of supported values is: ppc64le (list value)
|
||||
#additional_architectures =
|
||||
|
||||
|
||||
[auth]
|
||||
|
||||
|
|
Loading…
Reference in New Issue