6.2. 使用 CLI 在 Azure 上部署实例


您可以从 Azure web 控制台或 CLI 使用新的 RHEL AI Azure 镜像启动实例。您可以使用您要启动实例的部署方法。以下流程演示了如何使用 CLI 使用自定义 Azure 镜像启动 Azure 实例

如果您选择将 CLI 用作部署选项,您必须创建几个配置,如"先决条件"所示。

先决条件

  • 您创建了 RHEL AI Azure 镜像。如需更多信息,请参阅"将 RHEL AI 镜像转换为 Azure 镜像"。
  • 您在特定机器上安装了 Azure CLI,请参阅在 Linux 上安装 Azure CLI

流程

  1. 运行以下命令登录到您的 Azure 帐户:

    $ az login
    Copy to Clipboard Toggle word wrap
  2. 您需要选择要用于部署的实例配置集。运行以下命令列出所需区域中的所有配置集:

    $ az vm list-sizes --location <region> --output table
    Copy to Clipboard Toggle word wrap

    记录您首选的实例配置文件,您将需要它用于您的实例部署。

  3. 现在,您可以开始创建 Azure 实例。在创建实例时填充环境变量。

    name=my-rhelai-instance
    az_location=eastus
    az_resource_group=my_resource_group
    az_admin_username=azureuser
    az_vm_size=Standard_ND96isr_H100_v5
    az_image=my-custom-rhelai-image
    sshpubkey=$HOME/.ssh/id_rsa.pub
    disk_size=1024
    Copy to Clipboard Toggle word wrap
  4. 您可以运行以下命令来启动实例:

    $ az vm create \
        --resource-group $az_resource_group \
        --name ${name} \
        --image ${az_image} \
        --size ${az_vm_size} \
        --location ${az_location} \
        --admin-username ${az_admin_username} \
        --ssh-key-values @$sshpubkey \
        --authentication-type ssh \
        --nic-delete-option Delete \
        --accelerated-networking true \
        --os-disk-size-gb 1024 \
        --os-disk-name ${name}-${az_location}
    Copy to Clipboard Toggle word wrap

验证

  • 要验证您的 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:
                     /home/<user>/.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