首页 > 解决方案 > 在 Azure 中将自定义图像从一个区域复制到另一个区域时出错

问题描述

我正在将 a Custom Imagefrom norteuroperegion 复制到in eastusAzure因此我可以根据复制的. 我正在使用以下命令:Virtual MachineseastusCustom ImageAzure CLI

az image copy `
--source-object-name "playground-windows-vm-image-1" `
--source-resource-group 'playground-demo-rg' `
--target-location 'eastus' `
--target-resource-group 'layground-demo-rg2' `
--cleanup

Azure CLI复制命令引发错误并给我以下错误消息:

在此处输入图像描述

我正在使用Azure CLI并且主要做了以下步骤:

  1. Resource Group用名字创建了一个新playground-demo-rg2eastus
  2. 安装Image Copy Extension以便从复制northeuropeeastus
  3. 将现有的Custom Image(playground-windows-vm-image-1)from复制Source Resource Group(playground-demo-rg)Target Resource Group(playground-demo-rg2)

我已经上传了PS在执行时抛出上述错误的完整脚本:

https://github.com/jagjitsingh700/AzureVirtualMachines/blob/master/CopyingCustomImageToRegion.ps1

标签: azurevirtual-machineazure-cli

解决方案


这是一个已知问题,我也面临这个错误。一个新的开放问题是 Github here

作为一种解决方法,您可以使用Azure 中的共享图像库。使用共享图像库,您可以将图像共享给组织内的不同用户、服务主体或 AD 组。共享图像可以复制到多个区域,以便更快地扩展您的部署。

使用 Powershell 复制托管图像。此外,您可以参考此博客将 Azure VM 从区域 A 复制到区域 B。


推荐阅读