From 0215d3cd76d866b51dbd0fddb10f8fe2ad188e7a Mon Sep 17 00:00:00 2001 From: Nisha Agarwal Date: Sat, 1 Oct 2022 23:59:48 +0000 Subject: [PATCH] Fixes anaconda deploy for PXE boot Fixes the anaconda deploy(URL based) and adds anaconda_boot entry to pxe_grub_config.template so that ProLiants can be also deployed in PXE mode. Story: 2010347 Task: 46490 Change-Id: I4b9e3a2060d9d73de5cab31cc08d3a764dc56e90 --- doc/source/admin/drivers/ilo.rst | 8 ++++++++ ironic/common/pxe_utils.py | 3 +++ ironic/drivers/modules/pxe_grub_config.template | 5 +++++ ironic/tests/unit/drivers/pxe_grub_config.template | 4 ++++ releasenotes/notes/fix_anaconda_pxe-6c75d42872424fec.yaml | 6 ++++++ 5 files changed, 26 insertions(+) create mode 100644 releasenotes/notes/fix_anaconda_pxe-6c75d42872424fec.yaml diff --git a/doc/source/admin/drivers/ilo.rst b/doc/source/admin/drivers/ilo.rst index 65ff4f6dac..b6825fc403 100644 --- a/doc/source/admin/drivers/ilo.rst +++ b/doc/source/admin/drivers/ilo.rst @@ -2211,6 +2211,14 @@ Events subscription is supported by ``ilo`` and ``ilo5`` hardware types with ``ilo`` vendor interface for Gen10 and Gen10 Plus servers. See :ref:`node-vendor-passthru-methods` for more information. +Anaconda based deployment +^^^^^^^^^^^^^^^^^^^^^^^^^ +Deployment with ``anaconda`` deploy interface is supported by ``ilo`` and +``ilo5`` hardware type and works with ``ilo-pxe`` and ``ilo-ipxe`` +boot interfaces. See :doc:`/admin/anaconda-deploy-interface` for +more information. + + .. _`ssacli documentation`: https://support.hpe.com/hpsc/doc/public/display?docId=c03909334 .. _`proliant-tools`: https://docs.openstack.org/diskimage-builder/latest/elements/proliant-tools/README.html .. _`HPE iLO4 User Guide`: https://h20566.www2.hpe.com/hpsc/doc/public/display?docId=c03334051 diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index 489f527377..371a1b5d52 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -265,6 +265,9 @@ def get_file_path_from_label(node_uuid, root_dir, label): :param root_dir: Directory in which the image must be placed :param label: Name of the image """ + if label in ['ks_template', 'ks_cfg', 'stage2']: + path = os.path.join(CONF.deploy.http_root, node_uuid) + ensure_tree(path) if label == 'ks_template': return os.path.join(CONF.deploy.http_root, node_uuid, 'ks.cfg.template') diff --git a/ironic/drivers/modules/pxe_grub_config.template b/ironic/drivers/modules/pxe_grub_config.template index d8fc48673e..3bcdf55d65 100644 --- a/ironic/drivers/modules/pxe_grub_config.template +++ b/ironic/drivers/modules/pxe_grub_config.template @@ -15,3 +15,8 @@ menuentry "boot_ramdisk" { menuentry "boot_whole_disk" { linuxefi chain.c32 mbr:{{ DISK_IDENTIFIER }} } + +menuentry "boot_anaconda" { + linuxefi {{ pxe_options.aki_path }} text {{ pxe_options.pxe_append_params|default("", true) }} inst.ks={{ pxe_options.ks_cfg_url }} {% if pxe_options.repo_url %}inst.repo={{ pxe_options.repo_url }}{% else %}inst.stage2={{ pxe_options.stage2_url }}{% endif %} + initrdefi {{ pxe_options.ari_path }} +} diff --git a/ironic/tests/unit/drivers/pxe_grub_config.template b/ironic/tests/unit/drivers/pxe_grub_config.template index c4410b4897..95716cb16e 100644 --- a/ironic/tests/unit/drivers/pxe_grub_config.template +++ b/ironic/tests/unit/drivers/pxe_grub_config.template @@ -16,3 +16,7 @@ menuentry "boot_whole_disk" { linuxefi chain.c32 mbr:(( DISK_IDENTIFIER )) } +menuentry "boot_anaconda" { + linuxefi /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/kernel text test_param inst.ks=http://fake/ks.cfg inst.stage2=http://fake/stage2 + initrdefi /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/ramdisk +} diff --git a/releasenotes/notes/fix_anaconda_pxe-6c75d42872424fec.yaml b/releasenotes/notes/fix_anaconda_pxe-6c75d42872424fec.yaml new file mode 100644 index 0000000000..ecdc3468cf --- /dev/null +++ b/releasenotes/notes/fix_anaconda_pxe-6c75d42872424fec.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes URL based anaconda deploy to work in pxe boot. It also enables + grub based pxe anaconda deploy which is required for ``ilo`` hardware + type.