Skip to main content
Cloud Volumes ONTAP
所有云提供商
  • Amazon Web Services
  • Google Cloud
  • Microsoft Azure
  • 所有云提供商
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

从Azure Marketplace导出映像

贡献者

将该vHD映像发布到Azure云后、NetApp将不再管理该映像。而是将发布的映像放置在Azure Marketplace上。在Azure Marketplace上暂存并发布映像时、Azure会更改到VHD的前导1 MB和结尾512 B。要验证该VHD文件的签名、需要首先从Azure Marketplace导出由Azure修改的VHD映像。

您需要的内容

您必须在系统上安装所需的程序。

步骤
  1. 使用version_readme文件的内容将ONTAP版本映射到Azure Marketplace映像版本。

    对于version_readme文件中列出的每个版本映射、ONTAP版本以"budname"表示、Azure Marketplace映像版本以"version"表示。

    例如、在以下version_readme文件中、ONTAP版本"9.15.0P1"映射到Azure Marketplace映像版本"9150.01000024.65090105"。此Azure Marketplace映像版本稍后用于设置映像URN。

    [
        {
            "buildname": "9.15.0P1",
            "publisher": "netapp",
            "version": "9150.01000024.05090105"
        }
    ]
  2. 确定要创建VM的区域名称。

    在设置商城图片的URN时、此区域名称用作"locName"变量的值。

    1. 要接收可用区域的列表、请输入 az account list-locations -o table 命令:

      在下表中、区域名称称为"名称"字段。

    $ az account list-locations -o table
    DisplayName               Name                 RegionalDisplayName
    ------------------------  -------------------  -------------------------------------
    East US                   eastus               (US) East US
    East US 2                 eastus2              (US) East US 2
    South Central US          southcentralus       (US) South Central US
    ...
  3. 查看下表中相应虚拟机部署类型的SKU名称。

    在设置商城图片的URN时、SKU名称将用作"skuName"变量的值。

    例如、单节点部署应使用"ONTAP _Cloud BYOL" SKU名称。

    虚拟机部署类型 SKU名称

    单个节点

    ONTAP云BYOL

    高可用性

    ONTAP云BYOL_ha

  4. 映射ONTAP版本和Azure Marketplace映像后、通过Azure Cloud Shell或Azure命令行界面从Azure Marketplace导出VHD文件。

通过Azure门户上的Azure Cloud Shell导出VHD文件

  1. 从Azure Cloud Shell中、将市场映像导出到vhd (image2、例如9150.01000024.65090105.vhd)、然后下载到本地计算机(例如Linux计算机或Windows PC)。

    单击以显示
    #Azure Cloud Shell on Azure portal to get VHD image from Azure Marketplace
    a) Set the URN and other parameters of the marketplace image. URN is with format "<publisher>:<offer>:<sku>:<version>". Optionally, a user can list NetApp marketplace images to confirm the proper image version.
    PS /home/user1> $urn="netapp:netapp-ontap-cloud:ontap_cloud_byol:9150.01000024.05090105"
    PS /home/user1> $locName="eastus2"
    PS /home/user1> $pubName="netapp"
    PS /home/user1> $offerName="netapp-ontap-cloud"
    PS /home/user1> $skuName="ontap_cloud_byol"
    PS /home/user1> Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Sku $skuName |select version
    ...
    141.20231128
    9.141.20240131
    9.150.20240213
    9150.01000024.05090105
    ...
    
    b) Create a new managed disk from the Marketplace image with the matching image version
    PS /home/user1> $diskName = “9150.01000024.05090105-managed-disk"
    PS /home/user1> $diskRG = “fnf1”
    PS /home/user1> az disk create -g $diskRG -n $diskName --image-reference $urn
    PS /home/user1> $sas = az disk grant-access --duration-in-seconds 3600 --access-level Read --name $diskName --resource-group $diskRG
    PS /home/user1> $diskAccessSAS = ($sas | ConvertFrom-Json)[0].accessSas
    
    c) Export a VHD from the managed disk to Azure Storage
    Create a container with proper access level. As an example, a container named 'vm-images' with 'Container' access level is used here.
    Get storage account access key, on Azure portal, 'Storage Accounts'/'examplesaname'/'Access Key'/'key1'/'key'/'show'/<copy>.
    PS /home/user1> $storageAccountName = “examplesaname”
    PS /home/user1> $containerName = “vm-images”
    PS /home/user1> $storageAccountKey = "<replace with the above access key>"
    PS /home/user1> $destBlobName = “9150.01000024.05090105.vhd”
    PS /home/user1> $destContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
    PS /home/user1> Start-AzureStorageBlobCopy -AbsoluteUri $diskAccessSAS -DestContainer $containerName -DestContext $destContext -DestBlob $destBlobName
    PS /home/user1> Get-AzureStorageBlobCopyState –Container $containerName –Context $destContext -Blob $destBlobName
    
    d) Download the generated image to your server, e.g., a Linux machine.
    Use "wget <URL of file examplesaname/Containers/vm-images/9150.01000024.05090105.vhd>".
    The URL is organized in a formatted way. For automation tasks, the following example could be used to derive the URL string. Otherwise, Azure CLI 'az' command could be issued to get the URL, which is not covered in this guide. URL Example:
    https://examplesaname.blob.core.windows.net/vm-images/9150.01000024.05090105.vhd
    
    e) Clean up the managed disk
    PS /home/user1> Revoke-AzDiskAccess -ResourceGroupName $diskRG -DiskName $diskName
    PS /home/user1> Remove-AzDisk -ResourceGroupName $diskRG -DiskName $diskName

通过Azure命令行界面从本地Linux计算机导出VHD文件

  1. 从本地Linux计算机通过Azure命令行界面将市场映像导出到vhd。

    单击以显示
    #Azure CLI on local Linux machine to get VHD image from Azure Marketplace
    a) Login Azure CLI and list marketplace images
    % az login --use-device-code
    To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXXX to authenticate.
    
    % az vm image list --all --publisher netapp --offer netapp-ontap-cloud --sku ontap_cloud_byol
    ...
    {
    "architecture": "x64",
    "offer": "netapp-ontap-cloud",
    "publisher": "netapp",
    "sku": "ontap_cloud_byol",
    "urn": "netapp:netapp-ontap-cloud:ontap_cloud_byol:9150.01000024.05090105",
    "version": "9150.01000024.05090105"
    },
    ...
    
    b) Create a new managed disk from the Marketplace image with the matching image version
    % export urn="netapp:netapp-ontap-cloud:ontap_cloud_byol:9150.01000024.05090105"
    % export diskName="9150.01000024.05090105-managed-disk"
    % export diskRG="new_rg_your_rg"
    % az disk create -g $diskRG -n $diskName --image-reference $urn
    % az disk grant-access --duration-in-seconds 3600 --access-level Read --name $diskName --resource-group $diskRG
    {
      "accessSas": "https://md-xxxxxx.blob.core.windows.net/xxxxxxx/abcd?sv=2018-03-28&sr=b&si=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxx&sigxxxxxxxxxxxxxxxxxxxxxxxx"
    }
    
    % export diskAccessSAS="https://md-xxxxxx.blob.core.windows.net/xxxxxxx/abcd?sv=2018-03-28&sr=b&si=xxxxxxxx-xxxx-xx-xx-xx&sigxxxxxxxxxxxxxxxxxxxxxxxx"
    #To automate the process, the SAS needs to be extracted from the standard output. This is not included in this guide.
    
    c) export vhd from managed disk
    Create a container with proper access level. As an example, a container named 'vm-images' with 'Container' access level is used here.
    Get storage account access key, on Azure portal, 'Storage Accounts'/'examplesaname'/'Access Key'/'key1'/'key'/'show'/<copy>. There should be az command that can achieve the same, but this is not included in this guide.
    % export storageAccountName="examplesaname"
    % export containerName="vm-images"
    % export storageAccountKey="xxxxxxxxxx"
    % export destBlobName="9150.01000024.05090105.vhd"
    
    % az storage blob copy start --source-uri $diskAccessSAS --destination-container $containerName --account-name $storageAccountName --account-key $storageAccountKey --destination-blob $destBlobName
    
    {
      "client_request_id": "xxxx-xxxx-xxxx-xxxx-xxxx",
      "copy_id": "xxxx-xxxx-xxxx-xxxx-xxxx",
      "copy_status": "pending",
      "date": "2022-11-02T22:02:38+00:00",
      "etag": "\"0xXXXXXXXXXXXXXXXXX\"",
      "last_modified": "2022-11-02T22:02:39+00:00",
      "request_id": "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
      "version": "2020-06-12",
      "version_id": null
    }
    
    #to check the status of the blob copying
    % az storage blob show --name $destBlobName --container-name $containerName --account-name $storageAccountName
    
    ....
        "copy": {
          "completionTime": null,
          "destinationSnapshot": null,
          "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
          "incrementalCopy": null,
          "progress": "10737418752/10737418752",
          "source": "https://md-xxxxxx.blob.core.windows.net/xxxxx/abcd?sv=2018-03-28&sr=b&si=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "status": "success",
          "statusDescription": null
        },
    ....
    
    d) Download the generated image to your server, e.g., a Linux machine.
    Use "wget <URL of file examplesaname/Containers/vm-images/9150.01000024.05090105.vhd>".
    The URL is organized in a formatted way. For automation tasks, the following example could be used to derive the URL string. Otherwise, Azure CLI 'az' command could be issued to get the URL, which is not covered in this guide. URL Example:
    https://examplesaname.blob.core.windows.net/vm-images/9150.01000024.05090105.vhd
    
    e) Clean up the managed disk
    az disk revoke-access --name $diskName --resource-group $diskRG
    az disk delete --name $diskName --resource-group $diskRG --yes