diff --git a/doc/source/deploy/install-guide.rst b/doc/source/deploy/install-guide.rst index 327e228aed..fef3981479 100644 --- a/doc/source/deploy/install-guide.rst +++ b/doc/source/deploy/install-guide.rst @@ -802,9 +802,6 @@ on the Bare Metal Service node(s) where ``ironic-conductor`` is running. [pxe] - # Ironic compute node's http root path. (string value) - http_root=/httpboot - # Ironic compute node's tftp root path. (string value) tftp_root=/tftpboot @@ -812,6 +809,10 @@ on the Bare Metal Service node(s) where ``ironic-conductor`` is running. # value) tftp_server=192.168.0.2 + [deploy] + # Ironic compute node's http root path. (string value) + http_root=/httpboot + # Ironic compute node's HTTP server URL. Example: # http://192.1.2.3:8080 (string value) http_url=http://192.168.0.2:8080 diff --git a/etc/ironic/ironic.conf.sample b/etc/ironic/ironic.conf.sample index fb9b4dd631..584cad3b95 100644 --- a/etc/ironic/ironic.conf.sample +++ b/etc/ironic/ironic.conf.sample @@ -1,5 +1,106 @@ [DEFAULT] +# +# Options defined in oslo.service.service +# + +# Enable eventlet backdoor. Acceptable values are 0, , +# and :, where 0 results in listening on a random +# tcp port number; results in listening on the +# specified port number (and not enabling backdoor if that +# port is in use); and : results in listening on +# the smallest unused port number within the specified range +# of port numbers. The chosen port is displayed in the +# service's log file. (string value) +#backdoor_port= + +# Enables or disables logging values of all registered options +# when starting a service (at DEBUG level). (boolean value) +#log_options=true + + +# +# Options defined in oslo.service.periodic_task +# + +# Some periodic tasks can be run in a separate process. Should +# we run them here? (boolean value) +#run_external_periodic_tasks=true + + +# +# Options defined in oslo.messaging +# + +# Size of RPC connection pool. (integer value) +#rpc_conn_pool_size=30 + +# ZeroMQ bind address. Should be a wildcard (*), an ethernet +# interface, or IP. The "host" option should point or resolve +# to this address. (string value) +#rpc_zmq_bind_address=* + +# MatchMaker driver. (string value) +#rpc_zmq_matchmaker=local + +# ZeroMQ receiver listening port. (integer value) +#rpc_zmq_port=9501 + +# Number of ZeroMQ contexts, defaults to 1. (integer value) +#rpc_zmq_contexts=1 + +# Maximum number of ingress messages to locally buffer per +# topic. Default is unlimited. (integer value) +#rpc_zmq_topic_backlog= + +# Directory for holding IPC sockets. (string value) +#rpc_zmq_ipc_dir=/var/run/openstack + +# Name of this node. Must be a valid hostname, FQDN, or IP +# address. Must match "host" option, if running Nova. (string +# value) +#rpc_zmq_host=ironic + +# Seconds to wait before a cast expires (TTL). Only supported +# by impl_zmq. (integer value) +#rpc_cast_timeout=30 + +# Heartbeat frequency. (integer value) +#matchmaker_heartbeat_freq=300 + +# Heartbeat time-to-live. (integer value) +#matchmaker_heartbeat_ttl=600 + +# Size of RPC thread pool. (integer value) +#rpc_thread_pool_size=64 + +# The Drivers(s) to handle sending notifications. Possible +# values are messaging, messagingv2, routing, log, test, noop +# (multi valued) +#notification_driver= + +# AMQP topic used for OpenStack notifications. (list value) +# Deprecated group/name - [rpc_notifier2]/topics +#notification_topics=notifications + +# Seconds to wait for a response from a call. (integer value) +#rpc_response_timeout=60 + +# A URL representing the messaging driver to use and its full +# configuration. If not set, we fall back to the rpc_backend +# option and driver specific configuration. (string value) +#transport_url= + +# The messaging driver to use, defaults to rabbit. Other +# drivers include qpid and zmq. (string value) +#rpc_backend=rabbit + +# The default exchange under which topics are scoped. May be +# overridden by an exchange name specified in the +# transport_url option. (string value) +#control_exchange=openstack + + # # Options defined in oslo.log # @@ -41,14 +142,13 @@ #log_dir= # Use syslog for logging. Existing syslog format is DEPRECATED -# during I, and will change in J to honor RFC5424. (boolean -# value) +# and will be changed later to honor RFC5424. (boolean value) #use_syslog=false # (Optional) Enables or disables syslog rfc5424 format for # logging. If enabled, prefixes the MSG part of the syslog # message with APP-NAME (RFC5424). The format without the APP- -# NAME is deprecated in K, and will be removed in L, along +# NAME is deprecated in K, and will be removed in M, along # with this option. (boolean value) #use_syslog_rfc_format=true @@ -72,7 +172,7 @@ # Prefix each line of exception output with this format. # (string value) -#logging_exception_prefix=%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s +#logging_exception_prefix=%(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s # List of logger=LEVEL pairs. (list value) #default_log_levels=amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN @@ -81,10 +181,6 @@ # value) #publish_errors=false -# Enables or disables fatal status of deprecations. (boolean -# value) -#fatal_deprecations=false - # The format for an instance that is passed with the log # message. (string value) #instance_format="[instance: %(uuid)s] " @@ -93,103 +189,9 @@ # message. (string value) #instance_uuid_format="[instance: %(uuid)s] " - -# -# Options defined in oslo.messaging -# - -# ZeroMQ bind address. Should be a wildcard (*), an ethernet -# interface, or IP. The "host" option should point or resolve -# to this address. (string value) -#rpc_zmq_bind_address=* - -# MatchMaker driver. (string value) -#rpc_zmq_matchmaker=local - -# ZeroMQ receiver listening port. (integer value) -#rpc_zmq_port=9501 - -# Number of ZeroMQ contexts, defaults to 1. (integer value) -#rpc_zmq_contexts=1 - -# Maximum number of ingress messages to locally buffer per -# topic. Default is unlimited. (integer value) -#rpc_zmq_topic_backlog= - -# Directory for holding IPC sockets. (string value) -#rpc_zmq_ipc_dir=/var/run/openstack - -# Name of this node. Must be a valid hostname, FQDN, or IP -# address. Must match "host" option, if running Nova. (string +# Enables or disables fatal status of deprecations. (boolean # value) -#rpc_zmq_host=ironic - -# Seconds to wait before a cast expires (TTL). Only supported -# by impl_zmq. (integer value) -#rpc_cast_timeout=30 - -# Heartbeat frequency. (integer value) -#matchmaker_heartbeat_freq=300 - -# Heartbeat time-to-live. (integer value) -#matchmaker_heartbeat_ttl=600 - -# Size of RPC thread pool. (integer value) -#rpc_thread_pool_size=64 - -# The Drivers(s) to handle sending notifications. Possible -# values are messaging, messagingv2, routing,log, test, noop -# (multi valued) -#notification_driver= - -# AMQP topic used for OpenStack notifications. (list value) -# Deprecated group/name - [rpc_notifier2]/topics -#notification_topics=notifications - -# Seconds to wait for a response from a call. (integer value) -#rpc_response_timeout=60 - -# A URL representing the messaging driver to use and its full -# configuration. If not set, we fall back to the rpc_backend -# option and driver specific configuration. (string value) -#transport_url= - -# The messaging driver to use, defaults to rabbit. Other -# drivers include qpid and zmq. (string value) -#rpc_backend=rabbit - -# The default exchange under which topics are scoped. May be -# overridden by an exchange name specified in the -# transport_url option. (string value) -#control_exchange=openstack - - -# -# Options defined in oslo.service.service -# - -# Enable eventlet backdoor. Acceptable values are 0, , -# and :, where 0 results in listening on a random -# tcp port number; results in listening on the -# specified port number (and not enabling backdoor if that -# port is in use); and : results in listening on -# the smallest unused port number within the specified range -# of port numbers. The chosen port is displayed in the -# service's log file. (string value) -#backdoor_port= - -# Enables or disables logging values of all registered options -# when starting a service (at DEBUG level). (boolean value) -#log_options=true - - -# -# Options defined in oslo.service.periodic_task -# - -# Some periodic tasks can be run in a separate process. Should -# we run them here? (boolean value) -#run_external_periodic_tasks=true +#fatal_deprecations=false # @@ -313,7 +315,7 @@ # Seconds between running periodic tasks. (integer value) #periodic_interval=60 -# Name of this node. This can be an opaque identifier. It is +# Name of this node. This can be an opaque identifier. It is # not necessarily a hostname, FQDN, or IP address. However, # the node name must be valid within an AMQP key, and if using # ZeroMQ, a valid hostname, FQDN, or IP address. (string @@ -329,9 +331,9 @@ # commands as root. (string value) #rootwrap_config=/etc/ironic/rootwrap.conf -# Explicitly specify the temporary working directory. (string -# value) -#tempdir= +# Temporary working directory, default is Python temp dir. +# (string value) +#tempdir=/tmp # @@ -343,15 +345,6 @@ #parallel_image_downloads=false -# -# Options defined in ironic.openstack.common.versionutils -# - -# Enables or disables fatal status of deprecations. (boolean -# value) -#fatal_deprecations=false - - [agent] # @@ -733,6 +726,13 @@ # sleeping 1 second between attempts. (integer value) #iscsi_verify_attempts=3 +# ironic-conductor node's HTTP server URL. Example: +# http://192.1.2.3:8080 (string value) +#http_url= + +# ironic-conductor node's HTTP root path. (string value) +#http_root=/httpboot + [dhcp] @@ -918,7 +918,7 @@ #clean_priority_reset_bios_to_default=10 # Priority for reset_secure_boot_keys clean step. This step -# will reset the secure boot keys to manufacturing defaults. +# will reset the secure boot keys to manufacturing defaults. # (integer value) #clean_priority_reset_secure_boot_keys_to_default=20 @@ -1364,8 +1364,17 @@ # Auto-delete queues in AMQP. (boolean value) #amqp_auto_delete=false -# Size of RPC connection pool. (integer value) -#rpc_conn_pool_size=30 +# Send a single AMQP reply to call message. The current +# behaviour since oslo-incubator is to send two AMQP replies - +# first one with the payload, a second one to ensure the other +# have finish to send the payload. We are going to remove it +# in the N release, but we must keep backward compatible at +# the same time. This option provides such compatibility - it +# defaults to False in Liberty and can be turned on for early +# adopters with a new installations or for testing. Please +# note, that this option will be removed in M release. +# (boolean value) +#send_single_reply=false # Qpid broker hostname. (string value) #qpid_hostname=ironic @@ -1423,8 +1432,17 @@ # Auto-delete queues in AMQP. (boolean value) #amqp_auto_delete=false -# Size of RPC connection pool. (integer value) -#rpc_conn_pool_size=30 +# Send a single AMQP reply to call message. The current +# behaviour since oslo-incubator is to send two AMQP replies - +# first one with the payload, a second one to ensure the other +# have finish to send the payload. We are going to remove it +# in the N release, but we must keep backward compatible at +# the same time. This option provides such compatibility - it +# defaults to False in Liberty and can be turned on for early +# adopters with a new installations or for testing. Please +# note, that this option will be removed in M release. +# (boolean value) +#send_single_reply=false # SSL version to use (valid only if SSL enabled). Valid values # are TLSv1 and SSLv23. SSLv2, SSLv3, TLSv1_1, and TLSv1_2 may @@ -1445,6 +1463,11 @@ # consumer cancel notification. (floating point value) #kombu_reconnect_delay=1.0 +# How long to wait before considering a reconnect attempt to +# have failed. This value should not be longer than +# rpc_response_timeout. (integer value) +#kombu_reconnect_timeout=60 + # The RabbitMQ broker address where a single node is used. # (string value) #rabbit_host=ironic @@ -1490,7 +1513,7 @@ # Number of seconds after which the Rabbit broker is # considered down if heartbeat's keep-alive fails (0 disable -# the heartbeat). (integer value) +# the heartbeat). EXPERIMENTAL (integer value) #heartbeat_timeout_threshold=60 # How often times during the heartbeat_timeout_threshold we @@ -1588,13 +1611,6 @@ # Bootfile DHCP parameter for UEFI boot mode. (string value) #uefi_pxe_bootfile_name=elilo.efi -# ironic-conductor node's HTTP server URL. Example: -# http://192.1.2.3:8080 (string value) -#http_url= - -# ironic-conductor node's HTTP root path. (string value) -#http_root=/httpboot - # Enable iPXE boot. (boolean value) #ipxe_enabled=false diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index 458547890d..1f42c97666 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -38,7 +38,7 @@ PXE_CFG_DIR_NAME = 'pxelinux.cfg' def get_root_dir(): """Returns the directory where the config files and images will live.""" if CONF.pxe.ipxe_enabled: - return CONF.pxe.http_root + return CONF.deploy.http_root else: return CONF.pxe.tftp_root @@ -251,7 +251,7 @@ def dhcp_options_for_instance(task): dhcp_opts = [] if CONF.pxe.ipxe_enabled: script_name = os.path.basename(CONF.pxe.ipxe_boot_script) - ipxe_script_url = '/'.join([CONF.pxe.http_url, script_name]) + ipxe_script_url = '/'.join([CONF.deploy.http_url, script_name]) dhcp_provider_name = dhcp_factory.CONF.dhcp.dhcp_provider # if the request comes from dumb firmware send them the iPXE # boot image. diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index e579f7687f..a86bb86f69 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -63,8 +63,15 @@ deploy_opts = [ default=3, help=_('Maximum attempts to verify an iSCSI connection is ' 'active, sleeping 1 second between attempts.')), + cfg.StrOpt('http_url', + help='ironic-conductor node\'s HTTP server URL. ' + 'Example: http://192.1.2.3:8080', + deprecated_group='pxe'), + cfg.StrOpt('http_root', + default='/httpboot', + help='ironic-conductor node\'s HTTP root path.', + deprecated_group='pxe'), ] - CONF = cfg.CONF CONF.register_opts(deploy_opts, group='deploy') diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index cde9783787..05c9aa711d 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -75,12 +75,6 @@ pxe_opts = [ cfg.StrOpt('uefi_pxe_bootfile_name', default='elilo.efi', help=_('Bootfile DHCP parameter for UEFI boot mode.')), - cfg.StrOpt('http_url', - help=_('ironic-conductor node\'s HTTP server URL. ' - 'Example: http://192.1.2.3:8080')), - cfg.StrOpt('http_root', - default='/httpboot', - help=_('ironic-conductor node\'s HTTP root path.')), cfg.BoolOpt('ipxe_enabled', default=False, help=_('Enable iPXE boot.')), @@ -168,13 +162,15 @@ def _build_pxe_config_options(node, pxe_info, ctx): ramdisk = 'no_ramdisk' if CONF.pxe.ipxe_enabled: - deploy_kernel = '/'.join([CONF.pxe.http_url, node.uuid, + deploy_kernel = '/'.join([CONF.deploy.http_url, node.uuid, 'deploy_kernel']) - deploy_ramdisk = '/'.join([CONF.pxe.http_url, node.uuid, + deploy_ramdisk = '/'.join([CONF.deploy.http_url, node.uuid, 'deploy_ramdisk']) if not is_whole_disk_image: - kernel = '/'.join([CONF.pxe.http_url, node.uuid, 'kernel']) - ramdisk = '/'.join([CONF.pxe.http_url, node.uuid, 'ramdisk']) + kernel = '/'.join([CONF.deploy.http_url, node.uuid, + 'kernel']) + ramdisk = '/'.join([CONF.deploy.http_url, node.uuid, + 'ramdisk']) else: deploy_kernel = pxe_info['deploy_kernel'][1] deploy_ramdisk = pxe_info['deploy_ramdisk'][1] @@ -329,7 +325,8 @@ class PXEDeploy(base.DeployInterface): boot_mode = deploy_utils.get_boot_mode_for_deploy(task.node) if CONF.pxe.ipxe_enabled: - if not CONF.pxe.http_url or not CONF.pxe.http_root: + if (not CONF.deploy.http_url or + not CONF.deploy.http_root): raise exception.MissingParameterValue(_( "iPXE boot is enabled but no HTTP URL or HTTP " "root was specified.")) @@ -417,7 +414,7 @@ class PXEDeploy(base.DeployInterface): if CONF.pxe.ipxe_enabled: # Copy the iPXE boot script to HTTP root directory bootfile_path = os.path.join( - CONF.pxe.http_root, + CONF.deploy.http_root, os.path.basename(CONF.pxe.ipxe_boot_script)) shutil.copyfile(CONF.pxe.ipxe_boot_script, bootfile_path) pxe_info = _get_image_info(node, task.context) diff --git a/ironic/tests/drivers/test_pxe.py b/ironic/tests/drivers/test_pxe.py index b6cfbb199a..73ebaeec74 100644 --- a/ironic/tests/drivers/test_pxe.py +++ b/ironic/tests/drivers/test_pxe.py @@ -217,7 +217,7 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): if ipxe_enabled: http_url = 'http://192.1.2.3:1234' self.config(ipxe_enabled=True, group='pxe') - self.config(http_url=http_url, group='pxe') + self.config(http_url=http_url, group='deploy') deploy_kernel = os.path.join(http_url, self.node.uuid, 'deploy_kernel') @@ -225,7 +225,7 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): 'deploy_ramdisk') kernel = os.path.join(http_url, self.node.uuid, 'kernel') ramdisk = os.path.join(http_url, self.node.uuid, 'ramdisk') - root_dir = CONF.pxe.http_root + root_dir = CONF.deploy.http_root else: deploy_kernel = os.path.join(CONF.pxe.tftp_root, self.node.uuid, 'deploy_kernel') @@ -317,13 +317,13 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): if ipxe_enabled: http_url = 'http://192.1.2.3:1234' self.config(ipxe_enabled=True, group='pxe') - self.config(http_url=http_url, group='pxe') + self.config(http_url=http_url, group='deploy') deploy_kernel = os.path.join(http_url, self.node.uuid, 'deploy_kernel') deploy_ramdisk = os.path.join(http_url, self.node.uuid, 'deploy_ramdisk') - root_dir = CONF.pxe.http_root + root_dir = CONF.deploy.http_root else: deploy_kernel = os.path.join(CONF.pxe.tftp_root, self.node.uuid, 'deploy_kernel') @@ -399,7 +399,8 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): mock_ensure_tree): self.config(ipxe_enabled=True, group='pxe') fake_pxe_info = {'foo': 'bar'} - expected_path = os.path.join(CONF.pxe.http_root, self.node.uuid) + expected_path = os.path.join(CONF.deploy.http_root, + self.node.uuid) pxe._cache_ramdisk_kernel(self.context, self.node, fake_pxe_info) mock_ensure_tree.assert_called_with(expected_path) @@ -570,7 +571,7 @@ class PXEDriverTestCase(db_base.DbTestCase): mock_glance.return_value = {'properties': {'kernel_id': 'fake-kernel', 'ramdisk_id': 'fake-initr'}} self.config(ipxe_enabled=True, group='pxe') - self.config(http_url='dummy_url', group='pxe') + self.config(http_url='dummy_url', group='deploy') with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: task.node.properties = properties diff --git a/ironic/tests/test_pxe_utils.py b/ironic/tests/test_pxe_utils.py index 8e746ac20f..85bb01421d 100644 --- a/ironic/tests/test_pxe_utils.py +++ b/ironic/tests/test_pxe_utils.py @@ -106,7 +106,7 @@ class TestPXEUtils(db_base.DbTestCase): pxe_config_template='ironic/drivers/modules/ipxe_config.template', group='pxe' ) - self.config(http_url='http://1.2.3.4:1234', group='pxe') + self.config(http_url='http://1.2.3.4:1234', group='deploy') rendered_template = pxe_utils._build_pxe_config( self.ipxe_options, CONF.pxe.pxe_config_template) @@ -250,7 +250,7 @@ class TestPXEUtils(db_base.DbTestCase): def test__get_pxe_mac_path_ipxe(self): self.config(ipxe_enabled=True, group='pxe') - self.config(http_root='/httpboot', group='pxe') + self.config(http_root='/httpboot', group='deploy') mac = '00:11:22:33:AA:BB:CC' self.assertEqual('/httpboot/pxelinux.cfg/00-11-22-33-aa-bb-cc', pxe_utils._get_pxe_mac_path(mac)) @@ -269,7 +269,7 @@ class TestPXEUtils(db_base.DbTestCase): def test_get_root_dir_ipxe(self): expected_dir = '/httpboot' self.config(ipxe_enabled=True, group='pxe') - self.config(http_root=expected_dir, group='pxe') + self.config(http_root=expected_dir, group='deploy') self.assertEqual(expected_dir, pxe_utils.get_root_dir()) def test_get_pxe_config_file_path(self): @@ -317,7 +317,7 @@ class TestPXEUtils(db_base.DbTestCase): def test_get_deploy_kr_info_ipxe(self): expected_dir = '/http' self.config(ipxe_enabled=True, group='pxe') - self.config(http_root=expected_dir, group='pxe') + self.config(http_root=expected_dir, group='deploy') self._test_get_deploy_kr_info(expected_dir) def test_get_deploy_kr_info_bad_driver_info(self): @@ -333,7 +333,7 @@ class TestPXEUtils(db_base.DbTestCase): self.config(tftp_server='192.0.2.1', group='pxe') self.config(pxe_bootfile_name='fake-bootfile', group='pxe') self.config(ipxe_enabled=True, group='pxe') - self.config(http_url='http://192.0.3.2:1234', group='pxe') + self.config(http_url='http://192.0.3.2:1234', group='deploy') self.config(ipxe_boot_script='/test/boot.ipxe', group='pxe') self.config(dhcp_provider='isc', group='dhcp')