3.10. Uploading a VHD image to Azure Blob storage


By using the Microsoft Azure Blob storage, you can manage the VHD file and create a custom Azure image.

警告

The exported storage connection string does not persist after a system reboot. If any of the commands in the following steps fail, export the connection string again. See Configuring the Azure resources for a RHEL image to obtain and export a connection string.

Prerequisites

Procedure

  1. Upload the VHD file to the storage container:

    $ az storage blob upload \
        --account-name _<storage_account_name> --container-name _<container_name> \
        --type page --file _<path_to_vhd> --name _<image_name>.vhd

    Example:

    $ az storage blob upload \
    --account-name azrhelclistact --container-name azrhelclistcont \
    --type page --file ~/Downloads/rhel-image-10.vhd --name rhel-image-10.vhd
    
    Percent complete: 100.0%
  2. List the storage containers:

    1. To display in the tabular format, enter:

      $ az storage container list --output table
    2. To display in the YAML format, enter:

      $ az storage container list --output yaml
  3. Use the URL for the uploaded VHD file from the 1st step:

    $ az storage blob url -c <container_name> -n _<image_name>.vhd _<url_of_vhd_file>_

    Example:

    $ az storage blob url -c azrhelclistcont -n rhel-image-10.vhd "https://azrhelclistact.blob.core.windows.net/azrhelclistcont/rhel-image-10.vhd"
  4. Create the Azure custom image:

    $ az image create -n _<image_name> -g _<resource_group> -l _<azure_region> --source _<URL> --os-type linux
    注意

    The default hypervisor generation of the VM is V1. You can optionally specify a V2 hypervisor generation by including the option --hyper-v-generation V2. Generation 2 VMs use a UEFI-based boot architecture. For details, see Support for generation 2 VMs on Azure. The command may return the error "Only blobs formatted as VHDs can be imported." This error may mean that the image was not aligned to the nearest 1 MB boundary before it was converted to VHD.

    Example:

    $ az image create -n rhel10 -g azrhelclirsgrp2 -l southcentralus --source https://azrhelclistact.blob.core.windows.net/azrhelclistcont/rhel-image-10.vhd --os-type linux
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部