第 2 章 在裸机上安装 RHEL AI


要在裸机上安装 Red Hat Enterprise Linux AI,您可以使用以下步骤中提供的各种方法引导和部署机器并开始与 Red Hat Enterprise Linux AI 交互。

2.1. 在裸机上部署 RHEL AI

您可以使用以下方法使用 RHEL AI ISO 镜像部署 Red Hat Enterprise Linux AI:

  • Kickstart
  • RHEL 图形用户界面(GUI)

此镜像可在各种硬件加速器中启动。有关支持的硬件的更多信息,请参阅"入门"中的"Red Hat Enterprise Linux AI 硬件要求"。

重要

Red Hat Enterprise Linux AI 需要 RHEL AI 数据的额外存储以及镜像模式 Red Hat Enterprise Linux 的更新。InstructLab 数据的默认位置位于 home/<user> 目录中。/home 目录中数据存储的最小建议为 1 TB。在更新过程中,bootc 命令需要额外的空间来存储临时数据。/ 路径的最小存储建议是 120 GB。在对磁盘方案进行分区时,您需要考虑机器的存储。

流程

  • 交互式 GUI

    您可以使用交互式 Red Hat Enterprise Linux 图形安装程序和 RHEL AI ISO 镜像在您的机器上部署 RHEL AI。有关使用 GUI 使用 ISO 文件引导 RHEL 的详情,请查看 从安装介质中主动安装 RHEL

  • 带有嵌入式容器镜像的 Kickstart

    1. 您可以使用自己的 Kickstart 文件自定义 RHEL AI 安装。

      1. 使用您的首选参数创建自己的 Kickstart 文件。有关创建 Kickstart 文件的详情,请参考 RHEL 文档中的 创建 Kickstart 文件

        RHEL AI 的 Kickstart 文件示例,称为 rhelai-bootc.ks

        # use the embedded container image
        ostreecontainer --url=/run/install/repo/container --transport=oci --no-signature-verification
        
        # switch bootc to point to Red Hat container image for upgrades
        %post
        bootc switch --mutate-in-place --transport registry registry.redhat.io/rhelai1/bootc-nvidia-rhel9:1.5
        touch /etc/cloud/cloud-init.disabled
        %end
        
        ## user customizations follow
        
        # customize this for your target system network environment
        network --bootproto=dhcp --device=link --activate
        
        # customize this for your target system desired disk partitioning
        clearpart --all --initlabel --disklabel=gpt
        reqpart --add-boot
        part / --grow --fstype xfs
        
        # services can also be customized via Kickstart
        firewall --disabled
        services --enabled=sshd
        
        # optionally add a user
        user --name=cloud-user --groups=wheel --plaintext --password <password>
        sshkey --username cloud-user "ssh-ed25519 AAAAC3Nza....."
        
        # if desired, inject an SSH key for root
        rootpw --iscrypted locked
        sshkey --username root "ssh-ed25519 AAAAC3Nza..."
        reboot
        Copy to Clipboard Toggle word wrap

        示例 Kickstart 使用 ISO 文件中的内嵌容器镜像,由 ostreecontainer 命令表示,以及-- url=/run/install/repo/container 参数。bootc switch 参数指向 Red Hat registry 以便将来的更新,然后您可以添加自己的自定义。

      2. 您需要将 Kickstart 嵌入到 RHEL AI ISO 中,以便您的计算机可以重启和部署 RHEL AI。在以下示例中,rhelai-bootc.ks 是您要嵌入到引导 ISO 的 Kickstart 文件的名称。mkksiso 工具可在 lorax rpm 软件包中找到。

        $ mkksiso rhelai-bootc.ks <downloaded-iso-image> rhelai-bootc-ks.iso
        Copy to Clipboard Toggle word wrap

        其中

        <downloaded-iso-image>
        指定您从 RHEL AI 下载页面 下载的 ISO 镜像。
      3. 然后,您可以使用这个引导 ISO 启动机器,安装会自动启动。安装完成后,主机会重启,您可以使用 Kickstart 文件中使用的凭证登录到新系统。

        重要

        请注意,在您的 ISO 中具有自定义 Kickstart 将自动开始安装,以及磁盘分区,而不会提示用户。根据配置,本地存储可能会被完全擦除或覆盖。

  • 使用自定义容器镜像的 Kickstart

    您可以使用您首选的参数自定义 Kickstart 文件,以便在您的机器上引导 Red Hat Enterprise Linux AI

    1. 使用您的首选参数创建自己的 Kickstart 文件。有关创建 Kickstart 文件的更多信息,请参阅 RHEL 文档中的 创建 Kickstart 文件

      RHEL AI 的 Kickstart 文件示例,称为 rhelai-bootc.ks

      # customize this for your target system network environment
      network --bootproto=dhcp --device=link --activate
      
      # customize this for your target system desired disk partitioning
      clearpart --all --initlabel --disklabel=gpt
      reqpart --add-boot
      part / --grow --fstype xfs
      
      # customize this to include your own bootc container
      ostreecontainer --url quay.io/<your-user-name>/nvidia-bootc:latest
      
      # services can also be customized via Kickstart
      firewall --disabled
      services --enabled=sshd
      
      # optionally add a user
      user --name=cloud-user --groups=wheel --plaintext --password <password>
      sshkey --username cloud-user "ssh-ed25519 AAAAC3Nza....."
      
      # if desired, inject an SSH key for root
      rootpw --iscrypted locked
      sshkey --username root "ssh-ed25519 AAAAC3Nza..."
      reboot
      Copy to Clipboard Toggle word wrap

    2. 您需要将 Kickstart 嵌入到 RHEL AI ISO 中,以便您的计算机可以重启和部署 RHEL AI。在以下示例中,rhelai-bootc.ks 是您要嵌入到引导 ISO 的 Kickstart 文件的名称。mkksiso 工具可在 lorax rpm 软件包中找到。

      $ mkksiso rhelai-bootc.ks <downloaded-iso-image> rhelai-bootc-ks.iso
      Copy to Clipboard Toggle word wrap

      其中

      <downloaded-iso-image>
      指定您从 RHEL AI 下载页面 下载的 ISO 镜像。
    3. 然后,您可以使用这个引导 ISO 启动机器,安装会自动启动。安装完成后,主机会重启,您可以使用 Kickstart 文件中使用的凭证登录到新系统。

      重要

      请注意,在您的 ISO 中具有自定义 Kickstart 将自动开始安装,以及磁盘分区,而不会提示用户。根据配置,本地存储可能会被完全擦除或覆盖。

验证

  • 要验证您的 Red Hat Enterprise Linux AI 工具是否已正确安装,您需要运行 ilab 命令:

    $ ilab
    Copy to Clipboard Toggle word wrap

    输出示例

    $ ilab
    Usage: ilab [OPTIONS] COMMAND [ARGS]...
    
      CLI for interacting with InstructLab.
    
      If this is your first time running ilab, it's best to start with `ilab
      config init` to create the environment.
    
    Options:
      --config PATH  Path to a configuration file.  [default:
                     /Users/kellybrown/.config/instructlab/config.yaml]
      -v, --verbose  Enable debug logging (repeat for even more verbosity)
      --version      Show the version and exit.
      --help         Show this message and exit.
    
    Commands:
      config    Command Group for Interacting with the Config of InstructLab.
      data      Command Group for Interacting with the Data generated by...
      model     Command Group for Interacting with the Models in InstructLab.
      system    Command group for all system-related command calls
      taxonomy  Command Group for Interacting with the Taxonomy of InstructLab.
    
    Aliases:
      chat      model chat
      generate  data generate
      serve     model serve
      train     model train
    Copy to Clipboard Toggle word wrap

更新 Red Hat Enterprise Linux AI

要更新到 RHEL AI 的最新 z-stream 版本,请按照 更新 Red Hat Enterprise Linux AI 文档中的步骤 操作。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat