UEFI iSCSI 启动,适用于 iLO 驱动程序

https://bugs.launchpad.net/ironic/+bug/1526861

HPE ProLiant 服务器(Gen9 及更高版本)通过其固件支持 UEFI iSCSI 启动。 拟议的功能是在 UEFI 模式下,为 Ironic iLO 驱动程序添加对基于此固件的从 iSCSI Cinder 卷启动的支持。

问题描述

目前,Ironic 具有从 Cinder 卷启动的能力。 此外,此支持是通过使用像 iPXE 这样的启动加载程序从 iSCSI 卷启动实现的。 它没有提供任何利用某些服务器固有支持使用其固件功能从 iSCSI 卷启动的功能的方法。 可以通过固件以编程方式配置硬件以从 iSCSI 卷启动。

提议的变更

此更改基于 从卷启动 - 参考驱动程序 规范中提出的参考驱动程序实现指南,以支持从托管和/或远程控制的存储设备启动 ironic 节点。 此更改为 iLO 驱动程序管理接口提出了两种新方法;即 set_iscsi_boot_targetclear_iscsi_boot_target,它们将促进使用 iLO 接口为支持 UEFI iSCSI 启动的 HPE Proliant 服务器设置和清除 iSCSI 目标信息。

ilo 硬件类型中,prepare_instance() 启动接口方法将检查实例请求的启动模式是否为“UEFI”以及给定的卷是否可启动。 如果是,它将在 iLO 中设置 iSCSI 目标并将启动设备设置为 iSCSI 目标。

如果实例请求的启动模式为“BIOS”,则对于两个启动接口(ilo-pxeilo-virtual-media)的行为如下

  • ilo-pxe:它将回退到 iPXE 以启动卷。

  • ilo-virtual-media:它将抛出以下错误

    虚拟 媒体 无法 bios 模式下 启动 卷。

    带有其伪代码的 ilo-pxe 启动接口的函数定义如下

    class IloPXEBoot(pxe.PXEBoot):
    
      def prepare_instance(self, task):
        """Prepares the boot of instance.
    
        :param task: a task from TaskManager.
        :returns: None
        :raises: IloOperationError, if some operation on iLO failed.
        """
        if deploy_utils.is_iscsi_boot(task) and boot_mode == 'uefi':
          #Call the management interface
          task.driver.management.set_iscsi_boot_target(task)
          #Set boot device to 'ISCSIBOOT'
          deploy_utils.try_set_boot_device(task, boot_devices.ISCSIBOOT)
    
        else:
          #Let iPXE handle this
          super(IloPXEBoot, self).prepare_instance(task)
    
      def clean_up_instance(self, task):
        """Cleans up the boot of instance.
    
        :param task: a task from TaskManager.
        :returns: None
        :raises: IloOperationError, if some operation on iLO failed.
        """
        if deploy_utils.is_iscsi_boot(task) and boot_mode == 'uefi':
          #Call the management interface
          task.driver.management.clear_iscsi_boot_target(task)
    
        else:
          #Let iPXE handle this
          super(IloPXEBoot, self).clean_up_instance(task)
    

    带有其伪代码的 ilo-virtual-media 启动接口的函数定义如下

    class IloVirtualMediaBoot(base.BootInterface):
    
      def prepare_instance(self, task):
        """Prepares the boot of instance.
    
        :param task: a task from TaskManager.
        :returns: None
        :raises: IloOperationError, if some operation on iLO failed.
        """
        if deploy_utils.is_iscsi_boot(task) and boot_mode == 'uefi':
          #Call the management interface
          task.driver.management.set_iscsi_boot_target(task)
          #Set boot device to 'ISCSIBOOT'
          deploy_utils.try_set_boot_device(task, boot_devices.ISCSIBOOT)
          return
    
        elif deploy_utils.is_iscsi_boot(task) and boot_mode == 'bios':
          #Throw the error in bios boot mode
          msg = 'virtual media can not boot volume in bios mode.'
          raise exception.InstanceDeployFailure(msg)
    
        else:
          #Default code
    
      def clean_up_instance(self, task):
        """Cleans up the boot of instance.
    
        :param task: a task from TaskManager.
        :returns: None
        :raises: IloOperationError, if some operation on iLO failed.
        """
        if deploy_utils.is_iscsi_boot(task) and boot_mode == 'uefi':
          #Call the management interface
          task.driver.management.clear_iscsi_boot_target(task)
        else:
          #Fall to virtual media cleanup
    

将在 ilo 驱动程序管理接口 ilo.management.IloManangement 中添加两种新方法:* set_iscsi_boot_target() - 将 iSCSI 目标信息设置到 iLO * clear_iscsi_boot_target() - 从 iLO 清除 iSCSI 目标信息

将发布支持上述方法的新版本的 proliantutils 库。

带有其伪代码的函数定义如下

class IloManagement(base.ManagementInterface):

  def set_iscsi_boot_target(self, task):
    """Set iscsi boot volume target info from the node.

    :param task: a task from TaskManager.
    """
    #Proliants call to set iscsi target info

  def clear_iscsi_boot_target(self, task):
    """Clear iscsi boot volume target info from the node.

    :param task: a task from TaskManager.
    """
    #Library call to clear iscsi target info

备选方案

无。

数据模型影响

无。

状态机影响

无。

REST API 影响

无。

客户端 (CLI) 影响

无。

RPC API 影响

无。

驱动程序 API 影响

无。

Nova 驱动程序影响

无。

安全影响

无。

Ramdisk 影响

无。

其他最终用户影响

无。

可扩展性影响

无。

性能影响

无。

其他部署者影响

部署者将能够使用此更改配置支持 UEFI iSCSI 启动的服务器。 工作流程如下

  • 操作员使用适当的硬件类型和启动接口配置节点,并在 node.properties['capabilities'] 中添加功能 iscsi_boot=true(或者它可以由检查填充,但填充方式不属于此规范的范围)。

  • 操作员创建一个具有 Compute 功能 iscsi_boot=true 的 flavor,以请求从 Cinder 卷启动的裸机实例。

  • 租户创建一个 Cinder 卷。

  • 租户请求使用上述 flavor 启动一个 Cinder 卷的裸机实例。

  • 具有“ilo-virtual-media”作为启动接口且具有“iscsi_boot=true”功能的节点也应配置为仅具有“boot_mode”功能设置为“uefi”。

  • Nova Ironic virt 驱动程序将有关 iSCSI 卷的信息传递给 Ironic。 有关更多信息,请参阅 ironic 规范 为 Ironic 节点添加卷连接信息

开发人员影响

无。

实现

负责人

主要负责人

kesper

其他贡献者

deray stendulker

工作项

  • 需要在 ilo-pxeilo-virtual-media 启动接口中添加更改。

  • 需要在 ilo 管理接口中实现 set_iscsi_boot_targetclear_iscsi_boot_target

依赖项

无。

测试

此功能将使用 HPE iLO 第三方 CI 进行测试。

升级和向后兼容性

无。

文档影响

iLO 驱动程序文档将更新此功能。

参考资料