From d5e9dc64fc216cf1748f5c0dfccb9a922976005a Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Wed, 27 May 2015 12:17:21 +0100 Subject: [PATCH] Remove deprecated pxe_deploy_{kernel, ramdisk} In the last cycle we have renamed some parameters to make it more consistent across different drivers. This patch is removing the deprecated pxe_deploy_{kernel, ramdisk} parameters from the code and updating the documentation accordingly. Depends-On: I3dcf8df130efc0c2ea35695018bedba31bf0570c Change-Id: I07eb7ad28929b651cf04ef3955903e4f4ecf9900 --- doc/source/deploy/install-guide.rst | 36 +++++++++++++++++--------- doc/source/drivers/ilo.rst | 8 +++--- doc/source/drivers/seamicro.rst | 6 ++--- ironic/drivers/modules/pxe.py | 27 +------------------ ironic/tests/conductor/test_manager.py | 14 +++------- ironic/tests/drivers/test_pxe.py | 11 -------- 6 files changed, 36 insertions(+), 66 deletions(-) diff --git a/doc/source/deploy/install-guide.rst b/doc/source/deploy/install-guide.rst index b3f0aa7fcd..d76f316039 100644 --- a/doc/source/deploy/install-guide.rst +++ b/doc/source/deploy/install-guide.rst @@ -633,7 +633,7 @@ mapped to the bare metal server through the hardware specifications. "baremetal:deploy_kernel_id"=$DEPLOY_VMLINUZ_UUID \ "baremetal:deploy_ramdisk_id"=$DEPLOY_INITRD_UUID - - **Juno** and higher versions of Ironic:: + - **Juno** version of Ironic:: nova flavor-key my-baremetal-flavor set cpu_arch=$ARCH @@ -642,7 +642,19 @@ mapped to the bare metal server through the hardware specifications. ironic node-update $NODE_UUID add \ driver_info/pxe_deploy_kernel=$DEPLOY_VMLINUZ_UUID \ - driver_info/pxe_deploy_ramdisk=$DEPLOY_INITRD_UUID \ + driver_info/pxe_deploy_ramdisk=$DEPLOY_INITRD_UUID + + - **Kilo** and higher versions of Ironic:: + + nova flavor-key my-baremetal-flavor set cpu_arch=$ARCH + + Associate the deploy ramdisk and deploy kernel images each of your + node's driver_info:: + + ironic node-update $NODE_UUID add \ + driver_info/deploy_kernel=$DEPLOY_VMLINUZ_UUID \ + driver_info/deploy_ramdisk=$DEPLOY_INITRD_UUID + Setup the drivers for Bare Metal Service ======================================== @@ -1090,8 +1102,8 @@ if desired. | ipmi_password | password. Optional. | | ipmi_username | username; default is NULL user. Optional. | | ... | ... | - | pxe_deploy_kernel | UUID (from Glance) of the deployment kernel. Required. | - | pxe_deploy_ramdisk | UUID (from Glance) of the ramdisk that is mounted at boot time. Required. | + | deploy_kernel | UUID (from Glance) of the deployment kernel. Required. | + | deploy_ramdisk | UUID (from Glance) of the ramdisk that is mounted at boot time. Required. | +----------------------+-------------------------------------------------------------------------------------------------------------+ ironic node-update $NODE_UUID add \ @@ -1123,13 +1135,13 @@ if desired. ironic node-update $NODE_UUID add \ properties/capabilities=key1:val1,key2:val2 -#. As mentioned in the `Flavor Creation`_ section, if using the Juno or later +#. As mentioned in the `Flavor Creation`_ section, if using the Kilo or later release of Ironic, you should specify a deploy kernel and ramdisk which correspond to the Node's driver, eg:: ironic node-update $NODE_UUID add \ - driver_info/pxe_deploy_kernel=$DEPLOY_VMLINUZ_UUID \ - driver_info/pxe_deploy_ramdisk=$DEPLOY_INITRD_UUID \ + driver_info/deploy_kernel=$DEPLOY_VMLINUZ_UUID \ + driver_info/deploy_ramdisk=$DEPLOY_INITRD_UUID \ #. You must also inform Ironic of the Network Interface Cards which are part of the Node by creating a Port with each NIC's MAC address. These MAC @@ -1402,15 +1414,15 @@ Steps to start a deployment are pretty similar to those when using Nova: ironic node-create -d pxe_ipmitool -i ipmi_address=ipmi.server.net \ -i ipmi_username=user -i ipmi_password=pass \ - -i pxe_deploy_kernel=file:///images/deploy.vmlinuz \ - -i pxe_deploy_ramdisk=http://my.server.net/images/deploy.ramdisk + -i deploy_kernel=file:///images/deploy.vmlinuz \ + -i deploy_ramdisk=http://my.server.net/images/deploy.ramdisk +--------------+--------------------------------------------------------------------------+ | Property | Value | +--------------+--------------------------------------------------------------------------+ | uuid | be94df40-b80a-4f63-b92b-e9368ee8d14c | - | driver_info | {u'pxe_deploy_ramdisk': u'http://my.server.net/images/deploy.ramdisk', | - | | u'pxe_deploy_kernel': u'file:///images/deploy.vmlinuz', u'ipmi_address': | + | driver_info | {u'deploy_ramdisk': u'http://my.server.net/images/deploy.ramdisk', | + | | u'deploy_kernel': u'file:///images/deploy.vmlinuz', u'ipmi_address': | | | u'ipmi.server.net', u'ipmi_username': u'user', u'ipmi_password': | | | u'******'} | | extra | {} | @@ -1419,7 +1431,7 @@ Steps to start a deployment are pretty similar to those when using Nova: | properties | {} | +--------------+--------------------------------------------------------------------------+ - Note that here pxe_deploy_kernel and pxe_deploy_ramdisk contain links to + Note that here deploy_kernel and deploy_ramdisk contain links to images instead of Glance UUIDs. #. As in case of Nova, you can also provide ``capabilities`` to node diff --git a/doc/source/drivers/ilo.rst b/doc/source/drivers/ilo.rst index 9dba29f8ac..510bca8314 100644 --- a/doc/source/drivers/ilo.rst +++ b/doc/source/drivers/ilo.rst @@ -535,8 +535,8 @@ Nodes configured for iLO driver should have the ``driver`` property set to - ``ilo_address``: IP address or hostname of the iLO. - ``ilo_username``: Username for the iLO with administrator privileges. - ``ilo_password``: Password for the above iLO user. -- ``pxe_deploy_kernel``: The Glance UUID of the deployment kernel. -- ``pxe_deploy_ramdisk``: The Glance UUID of the deployment ramdisk. +- ``deploy_kernel``: The Glance UUID of the deployment kernel. +- ``deploy_ramdisk``: The Glance UUID of the deployment ramdisk. - ``client_port``: (optional) Port to be used for iLO operations if you are using a custom port on the iLO. Default port used is 443. - ``client_timeout``: (optional) Timeout for iLO operations. Default timeout @@ -547,7 +547,7 @@ Nodes configured for iLO driver should have the ``driver`` property set to For example, you could run a similar command like below to enroll the Proliant node:: - ironic node-create -d pxe_ilo ilo_address= -i ilo_username= -i ilo_password= -i pxe_deploy_kernel= pxe_deploy_ramdisk= + ironic node-create -d pxe_ilo ilo_address= -i ilo_username= -i ilo_password= -i deploy_kernel= deploy_ramdisk= Boot modes ~~~~~~~~~~ @@ -732,7 +732,7 @@ The following iLO drivers support hardware inspection: * ``agent_ilo`` .. note:: - + * The RAID needs to be pre-configured prior to inspection otherwise proliantutils returns 0 for disk size. * The iLO firmware version needs to be 2.10 or above for nic_capacity to be diff --git a/doc/source/drivers/seamicro.rst b/doc/source/drivers/seamicro.rst index a7e643eb88..4ea7cdf71d 100644 --- a/doc/source/drivers/seamicro.rst +++ b/doc/source/drivers/seamicro.rst @@ -84,8 +84,8 @@ Nodes configured for SeaMicro driver should have the ``driver`` property set to - ``seamicro_server_id``: SeaMicro Server ID. Expected format is / - ``seamicro_username``: SeaMicro Username with administrator privileges. - ``seamicro_password``: Password for the above SeaMicro user. -- ``pxe_deploy_kernel``: The Glance UUID of the deployment kernel. -- ``pxe_deploy_ramdisk``: The Glance UUID of the deployment ramdisk. +- ``deploy_kernel``: The Glance UUID of the deployment kernel. +- ``deploy_ramdisk``: The Glance UUID of the deployment ramdisk. - ``seamicro_api_version``: (optional) SeaMicro API Version defaults to "2". - ``seamicro_terminal_port``: (optional) Node's UDP port for console access. Any unused port on the Ironic conductor node may be used. @@ -99,7 +99,7 @@ boot an instance on it: Create Node:: - ironic node-create -d pxe_seamicro -i seamicro_api_endpoint=https:/// -i seamicro_server_id= -i seamicro_username= -i seamicro_password= -i seamicro_api_version= -i seamicro_terminal_port= -i pxe_deploy_kernel= -i pxe_deploy_ramdisk= -p cpus= -p memory_mb= -p local_gb= -p cpu_arch= + ironic node-create -d pxe_seamicro -i seamicro_api_endpoint=https:/// -i seamicro_server_id= -i seamicro_username= -i seamicro_password= -i seamicro_api_version= -i seamicro_terminal_port= -i deploy_kernel= -i deploy_ramdisk= -p cpus= -p memory_mb= -p local_gb= -p cpu_arch= Associate port with the node created:: diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index 8fc24e5559..07ccf2fe67 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -106,12 +106,6 @@ REQUIRED_PROPERTIES = { "Required."), 'deploy_ramdisk': _("UUID (from Glance) of the ramdisk that is " "mounted at boot time. Required."), - 'pxe_deploy_kernel': _("DEPRECATED: Use deploy_kernel instead. UUID " - "(from Glance) of the deployment kernel. " - "Required."), - 'pxe_deploy_ramdisk': _("DEPRECATED: Use deploy_ramdisk instead. UUID " - "(from Glance) of the ramdisk that is " - "mounted at boot time. Required."), } COMMON_PROPERTIES = REQUIRED_PROPERTIES @@ -128,29 +122,10 @@ def _parse_driver_info(node): :raises: MissingParameterValue """ info = node.driver_info - d_info = {} - - # NOTE(lucasagomes): For backwards compatibility let's keep accepting - # pxe_deploy_{kernel, ramdisk}, should be removed in Liberty. - deprecated_msg = _LW('The "%(old_param)s" parameter is deprecated. ' - 'Please update the node %(node)s to use ' - '"%(new_param)s" instead.') - - for parameter in ('deploy_kernel', 'deploy_ramdisk'): - value = info.get(parameter) - if not value: - old_parameter = 'pxe_' + parameter - value = info.get(old_parameter) - if value: - LOG.warning(deprecated_msg, {'old_param': old_parameter, - 'new_param': parameter, - 'node': node.uuid}) - d_info[parameter] = value - + d_info = {k: info.get(k) for k in ('deploy_kernel', 'deploy_ramdisk')} error_msg = _("Cannot validate PXE bootloader. Some parameters were" " missing in node's driver_info") deploy_utils.check_for_missing_params(d_info, error_msg) - return d_info diff --git a/ironic/tests/conductor/test_manager.py b/ironic/tests/conductor/test_manager.py index 381079385e..81f6789385 100644 --- a/ironic/tests/conductor/test_manager.py +++ b/ironic/tests/conductor/test_manager.py @@ -3311,8 +3311,7 @@ class ManagerTestProperties(tests_db_base.DbTestCase): self._check_driver_properties("fake_ssh", expected) def test_driver_properties_fake_pxe(self): - expected = ['pxe_deploy_kernel', 'pxe_deploy_ramdisk', - 'deploy_kernel', 'deploy_ramdisk'] + expected = ['deploy_kernel', 'deploy_ramdisk'] self._check_driver_properties("fake_pxe", expected) def test_driver_properties_fake_seamicro(self): @@ -3332,37 +3331,32 @@ class ManagerTestProperties(tests_db_base.DbTestCase): 'ipmi_username', 'ipmi_bridging', 'ipmi_transit_channel', 'ipmi_transit_address', 'ipmi_target_channel', 'ipmi_target_address', 'ipmi_local_address', - 'pxe_deploy_kernel', 'pxe_deploy_ramdisk', 'deploy_kernel', 'deploy_ramdisk', ] self._check_driver_properties("pxe_ipmitool", expected) def test_driver_properties_pxe_ipminative(self): expected = ['ipmi_address', 'ipmi_password', 'ipmi_username', - 'pxe_deploy_kernel', 'pxe_deploy_ramdisk', 'deploy_kernel', 'deploy_ramdisk', 'ipmi_terminal_port'] self._check_driver_properties("pxe_ipminative", expected) def test_driver_properties_pxe_ssh(self): - expected = ['pxe_deploy_kernel', 'pxe_deploy_ramdisk', - 'deploy_kernel', 'deploy_ramdisk', + expected = ['deploy_kernel', 'deploy_ramdisk', 'ssh_address', 'ssh_username', 'ssh_virt_type', 'ssh_key_contents', 'ssh_key_filename', 'ssh_password', 'ssh_port'] self._check_driver_properties("pxe_ssh", expected) def test_driver_properties_pxe_seamicro(self): - expected = ['pxe_deploy_kernel', 'pxe_deploy_ramdisk', - 'deploy_kernel', 'deploy_ramdisk', + expected = ['deploy_kernel', 'deploy_ramdisk', 'seamicro_api_endpoint', 'seamicro_password', 'seamicro_server_id', 'seamicro_username', 'seamicro_api_version', 'seamicro_terminal_port'] self._check_driver_properties("pxe_seamicro", expected) def test_driver_properties_pxe_snmp(self): - expected = ['pxe_deploy_kernel', 'pxe_deploy_ramdisk', - 'deploy_kernel', 'deploy_ramdisk', + expected = ['deploy_kernel', 'deploy_ramdisk', 'snmp_driver', 'snmp_address', 'snmp_port', 'snmp_version', 'snmp_community', 'snmp_security', 'snmp_outlet'] self._check_driver_properties("pxe_snmp", expected) diff --git a/ironic/tests/drivers/test_pxe.py b/ironic/tests/drivers/test_pxe.py index 65a303be36..7b769a3efe 100644 --- a/ironic/tests/drivers/test_pxe.py +++ b/ironic/tests/drivers/test_pxe.py @@ -99,17 +99,6 @@ class PXEValidateParametersTestCase(db_base.DbTestCase): self.assertIsNotNone(info.get('deploy_ramdisk')) self.assertIsNotNone(info.get('deploy_kernel')) - def test__parse_driver_info_backwards_compat(self): - old_drv_info = {} - old_drv_info['pxe_deploy_kernel'] = DRV_INFO_DICT['deploy_kernel'] - old_drv_info['pxe_deploy_ramdisk'] = DRV_INFO_DICT['deploy_ramdisk'] - node = obj_utils.create_test_node(self.context, - driver='fake_pxe', - driver_info=old_drv_info) - info = pxe._parse_driver_info(node) - self.assertIsNotNone(info.get('deploy_ramdisk')) - self.assertIsNotNone(info.get('deploy_kernel')) - class PXEPrivateMethodsTestCase(db_base.DbTestCase):