排查 Azure 中共享映像库的问题Troubleshoot shared image galleries in Azure

如果在对共享映像库、映像定义和映像版本执行任何操作时遇到问题,请在调试模式下再次运行失败的命令。If you have problems performing any operations on shared image galleries, image definitions, and image versions, run the failing command again in debug mode. 可以通过传递 --debug 开关(在使用 Azure CLI 时)和 -Debug 开关(在使用 PowerShell 时)来激活调试模式。You activate debug mode by passing the --debug switch with the Azure CLI and the -Debug switch with PowerShell. 在找到错误后,按照本文来解决错误。After you've located the error, follow this article to troubleshoot it.

消息:库名称无效。允许的字符是英文字母数字字符,允许中间包含下划线和句点,一共可包含最多 80 个字符。不允许使用所有其他特殊字符,包括短划线。Message: Gallery name is invalid. Allowed characters are English alphanumeric characters, with underscores, and periods allowed in the middle, up to 80 characters total. All other special characters, including dashes, are disallowed.
原因:库的名称不符合命名要求。Cause: The name for the gallery does not meet the naming requirements.
解决方法:选择一个满足以下条件的名称:Workaround: Choose a name that meets the following conditions:

  • 字符数上限为 80 个字符Has an 80-character limit
  • 只包含英文字母、数字、下划线和句点Contains only English letters, numbers, underscores, and periods
  • 以英文字母或数字开头和结尾Starts and ends with English letters or numbers

消息:根据实体名称的验证规则,实体名称“galleryName”无效: ^[^_\W][\w-._]{0,79}(?<![-.])$。Message: The entity name 'galleryName' is invalid according to its validation rule: ^[^_\W][\w-._]{0,79}(?<![-.])$.
原因:库名称不符合命名要求。Cause: The gallery name does not meet the naming requirements.
解决方法:为库选择一个满足以下条件的名称:Workaround: Choose a name for the gallery that meets the following conditions:

  • 字符数上限为 80 个字符Has an 80-character limit
  • 只包含英文字母、数字、下划线和句点Contains only English letters, numbers, underscores, and periods
  • 以英文字母或数字开头和结尾Starts and ends with English letters or numbers

消息:提供的资源名称 <galleryName> 具有以下无效的尾随字符: <character>。名称不能以下列字符结尾: <character>Message: The provided resource name <galleryName> has these invalid trailing characters: <character>. The name can not end with characters: <character>
原因:库的名称以句点或下划线结尾。Cause: The name for the gallery ends with a period or underscore.
解决方法:为库选择一个满足以下条件的名称:Workaround: Choose a name for the gallery that meets the following conditions:

  • 字符数上限为 80 个字符Has an 80-character limit
  • 只包含英文字母、数字、下划线和句点Contains only English letters, numbers, underscores, and periods
  • 以英文字母或数字开头和结尾Starts and ends with English letters or numbers

消息:提供的位置 <region> 不可用于资源类型“Microsoft.Compute/galleries”。此资源类型的可用区域列表为 …Message: The provided location <region> is not available for resource type 'Microsoft.Compute/galleries'. List of available regions for the resource type is …
原因:为库指定的区域不正确或要求提交访问请求。Cause: The region specified for the gallery is incorrect or requires an access request.
解决方法:检查区域名称是否正确。Workaround: Check that the region name is correct. 如果区域名称正确,请提交针对该区域的访问请求If the region name is correct, submit an access request for the region.

消息:无法删除此资源,除非先删除嵌套的资源。Message: Can not delete resource before nested resources are deleted.
原因:你试图删除至少包含一个现有映像定义的库。Cause: You've tried to delete a gallery that contains at least one existing image definition. 库必须为空才能删除。A gallery must be empty before it can be deleted.
解决方法:删除库中的所有映像定义,然后继续删除库。Workaround: Delete all image definitions inside the gallery and then proceed to delete the gallery. 如果映像定义包含映像版本,则必须先删除映像版本,然后才能删除映像定义。If the image definition contains image versions, you must delete the image versions before you delete the image definitions.

消息:库名称“<galleryName>”在订阅“”中不唯一。请选择其他库名称。Message: The gallery name '<galleryName>' is not unique within the subscription ''. Please pick another gallery name.
原因:你有一个具有同一名称的现有库,并且试图使用同一名称创建另一个库。Cause: You have an existing gallery with the same name and have tried to create another gallery with the same name.
解决方法:为库选择一个不同的名称。Workaround: Choose a different name for the gallery.

消息:资源 <galleryName> 已存在于资源组 <resourceGroup> 中的位置 <region_1>。不能在位置 <region_2> 中创建具有同一名称的资源。请选择一个新的资源名称。Message: The resource <galleryName> already exists in location <region_1> in resource group <resourceGroup>. A resource with the same name cannot be created in location <region_2>. Please select a new resource name.
原因:你有一个具有同一名称的现有库,并且试图使用同一名称创建另一个库。Cause: You have an existing gallery with the same name and have tried to create another gallery with the same name.
解决方法:为库选择一个不同的名称。Workaround: Choose a different name for the gallery.

创建或修改映像定义Creating or modifying image definitions

消息:不允许更改属性“galleryImage.properties.<property>”。Message: Changing property 'galleryImage.properties.<property>' is not allowed.
原因:你试图更改 OS 类型、OS 状态、Hyper-V 代系、产品/服务、发布者或 SKU。Cause: You tried to change the OS type, OS state, Hyper-V generation, offer, publisher, or SKU. 不允许更改这些属性中的任何一个。Changing any of these properties is not permitted.
解决方法:改为创建新的映像定义。Workaround: Create a new image definition instead.

消息:资源 <galleryName/imageDefinitionName> 已存在于资源组 <resourceGroup> 中的位置 <region_1>。不能在位置 <region_2> 中创建具有同一名称的资源。请选择一个新的资源名称。Message: The resource <galleryName/imageDefinitionName> already exists in location <region_1> in resource group <resourceGroup>. A resource with the same name cannot be created in location <region_2>. Please select a new resource name.
原因:同一个库和资源组中存在具有相同名称的现有映像定义。Cause: You have an existing image definition in the same gallery and resource group with the same name. 你试图在同一库中(但在不同的区域中)创建具有相同名称的另一个映像定义。You've tried to create another image definition with the same name and in the same gallery but in a different region.
解决方法:为映像定义使用一个不同的名称,或将映像定义放在另一个库或资源组中。Workaround: Use a different name for the image definition, or put the image definition in a different gallery or resource group.

消息:提供的资源名称 <galleryName>/<imageDefinitionName> 具有以下无效的尾随字符: <character>。名称不能以下列字符结尾: <character>Message: The provided resource name <galleryName>/<imageDefinitionName> has these invalid trailing characters: <character>. The name can not end with characters: <character>
原因:<imageDefinitionName> 名称以句点或下划线结尾。Cause: The <imageDefinitionName> name ends with a period or underscore.
解决方法:为映像定义选择一个满足以下条件的名称:Workaround: Choose a name for the image definition that meets the following conditions:

  • 字符数上限为 80 个字符Has an 80-character limit
  • 只包含英文字母、数字、下划线、连字符和句点Contains only English letters, numbers, underscores, hyphens, and periods
  • 以英文字母或数字开头和结尾。Starts and ends with English letters or numbers.

消息:根据实体名称的验证规则,实体名称 <imageDefinitionName> 无效: ^[^_\W][\w-._]{0,79}(?<![-.])$"。Message: The entity name <imageDefinitionName> is invalid according to its validation rule: ^[^_\W][\w-._]{0,79}(?<![-.])$"
原因:<imageDefinitionName> 名称以句点或下划线结尾。Cause: The <imageDefinitionName> name ends with a period or underscore.
解决方法:为映像定义选择一个满足以下条件的名称:Workaround: Choose a name for the image definition that meets the following conditions:

  • 字符数上限为 80 个字符Has an 80-character limit
  • 只包含英文字母、数字、下划线、连字符和句点Contains only English letters, numbers, underscores, hyphens, and periods
  • 以英文字母或数字开头和结尾Starts and ends with English letters or numbers

消息:资产名称 galleryImage.properties.identifier.<property> 无效。它不能为空。允许使用的字符为大写或小写字母、数字、连字符(-)、句点(.)、下划线 (_)。名称不能以句点(.)结尾。名称的长度不能超过 <number> 个字符。Message: Asset name galleryImage.properties.identifier.<property> is not valid. It cannot be empty. Allowed characters are uppercase or lowercase letters, digits, hyphen(-), period (.), underscore (_). Names are not allowed to end with period(.). The length of the name cannot exceed <number> characters.
原因:发布者、产品/服务或 SKU 值不符合命名要求。Cause: The publisher, offer, or SKU value does not meet the naming requirements.
解决方法:选择一个满足以下条件的值:Workaround: Choose a value that meets the following conditions:

  • 对于发布者,字符数上限为 128 个字符;对于产品/服务和 SKU,字符数上限为 64 个字符Has a 128-character limit for publisher or 64-character limit for offer and SKU
  • 只包含英文字母、数字、连字符、下划线和句点Contains only English letters, numbers, hyphens, underscores, and periods
  • 不得以句点结尾Does not end with a period

消息:无法对嵌套的资源执行所请求的操作。找不到父资源 <galleryName>。Message: Can not perform requested operation on nested resource. Parent resource <galleryName> not found.
原因:当前订阅和资源组中没有名为 <galleryName> 的库。Cause: There is no gallery with the name <galleryName> in the current subscription and resource group.
解决方法:检查库、订阅和资源组的名称是否正确。Workaround: Check that the names of the gallery, subscription, and resource group are correct. 如果不正确,请创建名为 <galleryName> 的新库。Otherwise, create a new gallery named <galleryName>.

消息:提供的位置 <region> 不可用于资源类型“Microsoft.Compute/galleries”。此资源类型的可用区域列表为 …Message: The provided location <region> is not available for resource type 'Microsoft.Compute/galleries'. List of available regions for the resource type is …
原因:<region> 名称不正确或要求提交访问请求。Cause: The <region> name is incorrect or requires an access request.
解决方法:检查区域名称拼写是否正确。Workaround: Check that the region name is spelled correctly. 你可以运行此命令来查看你有权访问哪些区域。You can run this command to see what regions you have access to. 如果该区域不在列表中,请提交访问请求If the region is not in the list, submit an access request.

消息:无法将值 <value> 串行化为类型: 'iso-8601',ISO8601Error: ISO 8601 时间指示符 'T' 缺失。无法分析日期/时间字符串 <value>Message: Unable to serialize value: <value> as type: 'iso-8601'., ISO8601Error: ISO 8601 time designator 'T' missing. Unable to parse datetime string <value>
原因:为属性提供的值未正确设置为日期格式。Cause: The value provided to the property is not properly formatted as a date.
解决方法:以 yyyy-MM-dd、yyyy-MM-dd'T'HH:mm:sszzz 或 ISO 8601 有效格式提供日期。Workaround: Provide a date in the yyyy-MM-dd, yyyy-MM-dd'T'HH:mm:sszzz, or ISO 8601 valid format.

消息:无法将字符串转换为 DateTimeOffset: <value>。路径为“properties.<property>”Message: Could not convert string to DateTimeOffset: <value>. Path 'properties.<property>'
原因:为属性提供的值未正确设置为日期格式。Cause: The value provided to the property is not properly formatted as a date.
解决方法:以 yyyy-MM-dd、yyyy-MM-dd'T'HH:mm:sszzz 或 ISO 8601 有效格式提供日期。Workaround: Provide a date in the yyyy-MM-dd, yyyy-MM-dd'T'HH:mm:sszzz, or ISO 8601 valid format.

消息:EndOfLifeDate 必须设置为将来的日期。Message: EndOfLifeDate must be set to a future date.
原因:生命周期结束日期属性的格式不正确,未设置为当天日期之后的日期。Cause: The end-of-life date property is not properly formatted as a date that's after today's date.
解决方法:以 yyyy-MM-dd、yyyy-MM-dd'T'HH:mm:sszzz 或 ISO 8601 有效格式提供日期。Workaround: Provide a date in the yyyy-MM-dd, yyyy-MM-dd'T'HH:mm:sszzz, or ISO 8601 valid format.

消息:参数 --<property>: 无效的 int 值: <value>Message: argument --<property>: invalid int value: <value>
原因:<property> 仅接受整数值,但 <value> 不是整数。Cause: <property> accepts only integer values, and <value> is not an integer.
解决方法:选择一个整数值。Workaround: Choose an integer value.

消息:<property> 的最小值不得大于 <property> 的最大值。Message: The minimum value of <property> must not be greater than the maximum value of <property>.
原因:为 <property> 提供的最小值大于为 <property> 提供的最大值。Cause: The minimum value provided for <property> is higher than the maximum value provided for <property>.
解决方法:更改值,使最小值小于或等于最大值。Workaround: Change the values so that the minimum is less than or equal to the maximum.

消息:由(发布者 <Publisher>、产品/服务 <Offer>、sku <SKU>)标识的库映像 <imageDefinitionName> 已存在。请选择一个不同的发布者、产品/服务、sku 组合。Message: Gallery image: <imageDefinitionName> identified by (publisher:<Publisher>, offer:<Offer>, sku:<SKU>) already exists. Choose a different publisher, offer, sku combination.
原因:你试图在同一个库中使用与现有映像定义相同的发布者、产品/服务和 SKU 三元组创建新的映像定义。Cause: You've tried to create a new image definition with the same publisher, offer, and SKU triplet as an existing image definition in the same gallery.
解决方法:在库中,所有映像定义必须具有发布者、产品/服务和 SKU 的唯一组合。Workaround: Within a gallery, all image definitions must have a unique combination of publisher, offer, and SKU. 请选择一个唯一组合,或者选择一个新库并再次创建映像定义。Choose a unique combination, or choose a new gallery and create the image definition again.

消息:无法删除此资源,除非先删除嵌套的资源。Message: Can not delete resource before nested resources are deleted.
原因:你试图删除包含映像版本的映像定义。Cause: You've tried to delete an image definition that contains image versions. 映像定义必须为空才能删除。An image definition must be empty before it can be deleted.
解决方法:删除映像定义中的所有映像版本,然后继续删除映像定义。Workaround: Delete all image versions inside the image definition and then proceed to delete the image definition.

消息:无法绑定参数 <property>。无法将值 <value> 转换为类型 <propertyType>。无法将标识符名称 <value> 与有效的枚举器名称匹配。请指定以下枚举器名称之一并重试:<choice_1>、<choice_2> …Message: Cannot bind parameter <property>. Cannot convert value <value> to type <propertyType>. Unable to match the identifier name <value> to a valid enumerator name. Specify one of the following enumerator names and try again: <choice_1>, <choice_2>, …
原因:该属性有一组有限的可能值,并且 <value> 不是其中的值之一。Cause: The property has a restricted list of possible values, and <value> is not one of them.
解决方法:选择可能的 <choice> 值之一。Workaround: Choose one of the possible <choice> values.

消息:无法绑定参数 <property>。无法将值 <value> 转换为 "System.DateTime" 类型Message: Cannot bind parameter <property>. Cannot convert value <value> to type "System.DateTime"
原因:为属性提供的值未正确设置为日期格式。Cause: The value provided to the property is not properly formatted as a date.
解决方法:以 yyyy-MM-dd、yyyy-MM-dd'T'HH:mm:sszzz 或 ISO 8601 有效格式提供日期。Workaround: Provide a date in the yyyy-MM-dd, yyyy-MM-dd'T'HH:mm:sszzz, or ISO 8601 valid format.

消息:无法绑定参数 <property>。无法将值 <value> 转换为 "System.Int32" 类型Message: Cannot bind parameter <property>. Cannot convert value <value> to type "System.Int32"
原因:<property> 仅接受整数值,但 <value> 不是整数。Cause: <property> accepts only integer values, and <value> is not an integer.
解决方法:选择一个整数值。Workaround: Choose an integer value.

消息:ZRS 存储帐户类型在此区域中不受支持。Message: ZRS storage account type is not supported in this region.
原因:你在尚不支持标准区域冗余存储 (ZRS) 的区域中选择了它。Cause: You've chosen standard zone-redundant storage (ZRS) in a region that does not yet support it.
解决方法:将存储帐户类型更改为 Premium_LRSStandard_LRSWorkaround: Change the storage account type to Premium_LRS or Standard_LRS.

创建或更新映像版本Creating or updating image versions

消息:提供的位置 <region> 不可用于资源类型“Microsoft.Compute/galleries”。此资源类型的可用区域列表为 …Message: The provided location <region> is not available for resource type 'Microsoft.Compute/galleries'. List of available regions for the resource type is …
原因:<region> 名称不正确或要求提交访问请求。Cause: The <region> name is incorrect or requires an access request.
解决方法:检查区域名称拼写是否正确。Workaround: Check that the region name is spelled correctly. 你可以运行此命令来查看你有权访问哪些区域。You can run this command to see what regions you have access to. 如果该区域不在列表中,请提交访问请求If the region is not in the list, submit an access request.

消息:无法对嵌套的资源执行所请求的操作。找不到父资源 <galleryName/imageDefinitionName>。Message: Can not perform requested operation on nested resource. Parent resource <galleryName/imageDefinitionName> not found.
原因:当前订阅和资源组中没有名为 <galleryName/imageDefinitionName> 的库。Cause: There is no gallery with the name <galleryName/imageDefinitionName> in the current subscription and resource group.
解决方法:检查库、订阅和资源组的名称是否正确。Workaround: Check that the names of the gallery, subscription, and resource group are correct. 如果不正确,请在指定的资源组中创建一个名为 <galleryName> 的库和/或一个名为 <imageDefinitionName> 的映像定义。Otherwise, create a new gallery with the name <galleryName> and/or an image definition named <imageDefinitionName> in the indicated resource group.

消息:无法绑定参数 <property>。无法将值 <value> 转换为 "System.DateTime" 类型Message: Cannot bind parameter <property>. Cannot convert value <value> to type "System.DateTime"
原因:为属性提供的值未正确设置为日期格式。Cause: The value provided to the property is not properly formatted as a date.
解决方法:以 yyyy-MM-dd、yyyy-MM-dd'T'HH:mm:sszzz 或 ISO 8601 有效格式提供日期。Workaround: Provide a date in the yyyy-MM-dd, yyyy-MM-dd'T'HH:mm:sszzz, or ISO 8601 valid format.

消息:无法绑定参数 <property>。无法将值 <value> 转换为 "System.Int32" 类型Message: Cannot bind parameter <property>. Cannot convert value <value> to type "System.Int32"
原因:<property> 仅接受整数值,但 <value> 不是整数。Cause: <property> accepts only integer values, and <value> is not an integer.
解决方法:选择一个整数值。Workaround: Choose an integer value.

消息:库映像版本发布配置文件区域 <publishingRegions> 必须包含映像版本的位置 <sourceRegion>Message: Gallery image version publishing profile regions <publishingRegions> must contain the location of image version <sourceRegion>
原因:源映像的位置(<sourceRegion>)必须包括在 <publishingRegions> 列表中。Cause: The location of the source image (<sourceRegion>) must be included in the <publishingRegions> list.
解决方法:将 <sourceRegion> 包括在 <publishingRegions> 列表中。Workaround: Include <sourceRegion> in the <publishingRegions> list.

消息:参数 <property> 的值 <value> 超出范围。该值必须介于 <minValue> 和 <maxValue> 之间(包括这两者)。Message: The value <value> of parameter <property> is out of range. The value must be between <minValue> and <maxValue>, inclusive.
原因:<value> 不在 <property> 的可能值范围内。Cause: <value> is outside the range of possible values for <property>.
解决方法:选择一个位于 <minValue> 到 <maxValue> 范围(包括这两者)中的值。Workaround: Choose a value that's within the range of <minValue> and <maxValue>, inclusive.

消息:找不到源 <resourceID>。请检查源是否存在,是否与正在创建的库映像版本位于同一区域中。Message: Source <resourceID> is not found. Please check source exists, and is in the same region as gallery image version being created.
原因:<resourceID> 处没有源,或者 <resourceID> 处的源与正在创建的库映像不在同一区域中。Cause: There is no source located at <resourceID>, or the source at <resourceID> is not in the same region as the gallery image being created.
解决方法:检查 <resourceID> 值是否正确,以及库映像版本的源区域是否与 <resourceID> 值的区域相同。Workaround: Check that the <resourceID> value is correct and that the source region of the gallery image version is the same as the region of the <resourceID> value.

消息:不允许更改属性“galleryImageVersion.properties.storageProfile.<diskImage>.source.id”。Message: Changing property 'galleryImageVersion.properties.storageProfile.<diskImage>.source.id' is not allowed.
原因:在创建库映像版本后,无法更改其源 ID。Cause: The source ID of a gallery image version can't be changed after creation.
解决方法:确保源 ID 与现有源 ID 相同,更改映像版本的版本号,或删除当前映像版本,然后重试。Workaround: Ensure that the source ID is the same as the existing source ID, change the version number of the image version, or delete the current image version and try again.

消息:在输入数据磁盘中检测到重复的 lun 编号。Lun 编号在每个数据磁盘中必须唯一。Message: Duplicated lun numbers have been detected in the input data disks. Lun number must be unique for each data disk.
原因:使用磁盘和/或磁盘快照列表创建映像版本时,有两个或更多磁盘或磁盘快照具有相同的 LUN。Cause: When you're creating an image version by using a list of disks and/or disk snapshots, two or more disks or disk snapshots have the same LUN.
解决方法:删除或更改任何重复的 LUN。Workaround: Remove or change any duplicate LUNs.

消息:在输入磁盘中发现重复的源 id。源 id 在每个磁盘中应当唯一。Message: Duplicated source ids are found in the input disks. Source id should be unique for each disk.
原因:使用磁盘和/或磁盘快照列表创建映像版本时,有两个或更多磁盘或磁盘快照具有相同的资源 ID。Cause: When you're creating an image version by using a list of disks and/or disk snapshots, two or more disks or disk snapshots have the same resource ID.
解决方法:删除或更改任何重复的磁盘源 ID。Workaround: Remove or change any duplicate disk source IDs.

消息:“properties.storageProfile.<diskImages>.source.id”路径上的属性 ID <resourceID> 无效。需要以“/subscriptions/”或“/providers//”开头的完全限定的资源 ID。Message: Property id <resourceID> at path 'properties.storageProfile.<diskImages>.source.id' is invalid. Expect fully qualified resource Id that start with '/subscriptions/' or '/providers//'.
原因:<resourceID> 值的格式不正确。Cause: The <resourceID> value is incorrectly formatted.
解决方法:检查资源 ID 是否正确。Workaround: Check that the resource ID is correct.

消息:源 id: <resourceID> 必须是托管映像、虚拟机或其他库映像版本Message: The source id: <resourceID> must either be a managed image, virtual machine or another gallery image version
原因:<resourceID> 值的格式不正确。Cause: The <resourceID> value is incorrectly formatted.
解决方法:如果你使用 VM、托管映像或库映像版本作为源映像,请检查 VM、托管映像或库映像版本的资源 ID 是否正确。Workaround: If you're using a VM, managed image, or gallery image version as the source image, check that the resource ID of the VM, managed image, or gallery image version is correct.

消息:源 id: <resourceID> 必须是一个托管磁盘或快照。Message: The source id: <resourceID> must be a managed disk or snapshot.
原因:<resourceID> 值的格式不正确。Cause: The <resourceID> value is incorrectly formatted.
解决方法:如果你使用磁盘和/或磁盘快照作为映像版本的源,请检查磁盘和/或磁盘快照的资源 ID 是否正确。Workaround: If you're using disks and/or disk snapshots as sources for the image version, check that the resource IDs of the disks and/or disk snapshots are correct.

消息:无法基于 <resourceID> 创建库映像版本,因为父级库映像中的 OS 状态(<OsState_1>)不是 <OsState_2>。Message: Cannot create Gallery Image Version from: <resourceID> since the OS State in the parent gallery image (<OsState_1>) is not <OsState_2>.
原因:操作系统状态(“通用”或“专用”)与映像定义中指定的操作系统状态不匹配。Cause: The operating system state (Generalized or Specialized) does not match the operating system state specified in the image definition.
解决方法:基于操作系统状态为 <OsState_1> 的某个 VM 选择一个源,或者基于 <OsState_2> 为 VM 创建一个新的映像定义。Workaround: Either choose a source based on a VM with the operating system state of <OsState_1> or create a new image definition for VMs based on <OsState_2>.

消息:id 为“<resourceID>”的资源具有与父级库映像虚拟机监控程序代系 [“<V#_2>”] 不同的虚拟机监控程序代系 [“<V#_1>”]。Message: The resource with id '<resourceID>' has a different Hypervisor generation ['<V#_1>'] than the parent gallery image Hypervisor generation ['<V#_2>']
原因:映像版本的虚拟机监控程序代系与映像定义中指定的虚拟机监控程序代系不匹配。Cause: The hypervisor generation of the image version does not match the hypervisor generation specified in the image definition. 映像定义操作系统为 <V#_1>,而映像版本操作系统为 <V#_2>。The image definition operating system is <V#_1>, and the image version operating system is <V#_2>.
解决方法:选择与映像定义具有相同的虚拟机监控程序代系的源,或创建/选择与映像版本具有相同的虚拟机监控程序代系的新映像定义。Workaround: Either choose a source with the same hypervisor generation as the image definition or create/choose a new image definition that has the same hypervisor generation as the image version.

消息:id 为 <resourceID> 的资源具有与父级库映像 OS 类型代系 [“<OsType _2>”] 不同的 OS 类型 [“<OsType_1>”]Message: The resource with id '<resourceID>' has a different OS type ['<OsType_1>'] than the parent gallery image OS type generation ['<OsType _2>']
原因:映像版本的虚拟机监控程序代系与映像定义中指定的虚拟机监控程序代系不匹配。Cause: The hypervisor generation of the image version does not match the hypervisor generation specified in the image definition. 映像定义操作系统为 <OsType_1>,而映像版本操作系统为 <OsType_2>。The image definition operating system is <OsType_1>, and the image version operating system is <OsType_2>.
解决方法:选择与映像定义具有相同的操作系统(Linux/Windows)的源,或创建/选择与映像版本具有相同的操作系统代系的新映像定义。Workaround: Either choose a source with the same operating system (Linux/Windows) as the image definition or create/choose a new image definition that has the same operating system generation as the image version.

消息:源虚拟机 <resourceID> 不能包含临时 OS 磁盘。Message: Source virtual machine <resourceID> cannot contain an ephemeral OS disk.
原因:位于 <resourceID> 处的源包含一个临时 OS 磁盘。Cause: The source at <resourceID> contains an ephemeral OS disk. 共享映像库当前不支持临时 OS 磁盘。The shared image gallery does not currently support ephemeral OS disks.
解决方法:基于不使用临时 OS 磁盘的 VM 选择一个不同的源。Workaround: Choose a different source based on a VM that does not use an ephemeral OS disk.

消息:源虚拟机 <resourceID> 不能包含 UltraSSD 帐户类型中存储的磁盘 [“<diskID>”]。Message: Source virtual machine <resourceID> cannot contain disk ['<diskID>'] stored in an UltraSSD account type.
原因:磁盘 <diskID> 是一个超级 SSD 磁盘。Cause: The disk <diskID> is an Ultra SSD disk. 共享映像库当前不支持超级 SSD 磁盘。The shared image gallery does not currently support Ultra SSD disks.
解决方法:使用只包含高级 SSD、标准 SSD 和/或标准 HDD 托管磁盘的源。Workaround: Use a source that contains only Premium SSD, Standard SSD, and/or Standard HDD managed disks.

消息:源虚拟机 <resourceID> 必须基于托管磁盘创建。Message: Source virtual machine <resourceID> must be created from Managed Disks.
原因:<resourceID> 中的虚拟机使用非托管磁盘。Cause: The virtual machine in <resourceID> uses unmanaged disks.
解决方法:使用基于只包含高级 SSD、标准 SSD 和/或标准 HDD 托管磁盘的 VM 的源。Workaround: Use a source based on a VM that contains only Premium SSD, Standard SSD, and/or Standard HDD managed disks.

消息:源“<resourceID>”上的请求太多。请减少该源上的请求数或者等待一段时间后重试。Message: Too many requests on source '<resourceID>'. Please reduce the number of requests on the source or wait some time before retrying.
原因:由于请求过多,此映像版本的源当前被限制。Cause: The source for this image version is currently being throttled because of too many requests.
解决方法:稍后再尝试创建映像版本。Workaround: Try to create the image version later.

消息:磁盘加密集“<diskEncryptionSetID>”必须与库资源位于同一订阅“<subscriptionID>”中。Message: The disk encryption set '<diskEncryptionSetID>' must be in the same subscription '<subscriptionID>' as the gallery resource.
原因:磁盘加密集只能在创建它们的同一订阅和区域中使用。Cause: Disk encryption sets can be used only in the same subscription and region in which they were created.
解决方法:在与映像版本相同的订阅和区域中创建或使用加密集。Workaround: Create or use an encryption set in the same subscription and region as the image version.

消息:加密的源“<resourceID>”位于与当前库映像版本订阅“<subscriptionID_1>”不同的订阅 ID 中。请使用未加密的源重试,或者使用源的订阅“<subcriptionID_2>”来创建库映像版本。Message: Encrypted source: '<resourceID>' is in a different subscription ID than the current gallery image version subscription '<subscriptionID_1>'. Please retry with an unencrypted source(s) or use the source's subscription '<subcriptionID_2>' to create the gallery image version.
原因:如果源映像是加密的,则共享映像库当前不支持在其他订阅中从其他源映像创建映像版本。Cause: The shared image gallery does not currently support creating image versions in another subscription from another source image if the source image is encrypted.
解决方法:使用未加密的源,或在与源相同的订阅中创建映像版本。Workaround: Use an unencrypted source or create the image version in the same subscription as the source.

消息:找不到磁盘加密集 <diskEncryptionSetID>。Message: The disk encryption set <diskEncryptionSetID> was not found.
原因:磁盘加密可能不正确。Cause: The disk encryption might be incorrect.
解决方法:检查磁盘加密集的资源 ID 是否正确。Workaround: Check that the resource ID of the disk encryption set is correct.

消息:映像版本名称无效。映像版本名称应遵循 Major(int).Minor(int).Patch(int)格式。例如: 1.0.0、2018.12.1,等等。Message: The image version name is invalid. The image version name should follow Major(int).Minor(int).Patch(int) format, for e.g: 1.0.0, 2018.12.1 etc.
原因:映像版本的有效格式是以句点分隔的三个整数。Cause: The valid format for an image version is three integers separated by a period. 映像版本名称不符合有效的格式。The image version name did not meet the valid format.
解决方法:使用遵循格式 Major(int).Minor(int).Patch(int) 的映像版本名称。Workaround: Use an image version name that follows the format Major(int).Minor(int).Patch(int). 例如:1.0.0For example: 1.0.0. 或 2018.12.1。or 2018.12.1.

消息:参数 galleryArtifactVersion.properties.publishingProfile.targetRegions.encryption.dataDiskImages.diskEncryptionSetId 的值无效Message: The value of parameter galleryArtifactVersion.properties.publishingProfile.targetRegions.encryption.dataDiskImages.diskEncryptionSetId is invalid
原因:数据磁盘映像上使用的磁盘加密集的资源 ID 使用了无效的格式。Cause: The resource ID of the disk encryption set used on a data disk image uses an invalid format.
解决方法:确保磁盘加密集的资源 ID 遵循格式 /subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/<diskEncryptionSetName>。Workaround: Ensure that the resource ID of the disk encryption set follows the format /subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/<diskEncryptionSetName>.

消息:参数 galleryArtifactVersion.properties.publishingProfile.targetRegions.encryption.osDiskImage.diskEncryptionSetId 的值无效。Message: The value of parameter galleryArtifactVersion.properties.publishingProfile.targetRegions.encryption.osDiskImage.diskEncryptionSetId is invalid.
原因:OS 磁盘映像上使用的磁盘加密集的资源 ID 使用了无效的格式。Cause: The resource ID of the disk encryption set used on the OS disk image uses an invalid format.
解决方法:确保磁盘加密集的资源 ID 遵循格式 /subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/<diskEncryptionSetName>。Workaround: Ensure that the resource ID of the disk encryption set follows the format /subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/<diskEncryptionSetName>.

消息:不能为更新库映像版本请求指定磁盘加密集位于区域 [<region>] 中的新数据磁盘映像加密 lun [<number>]。若要更新此版本,请删除新的 lun。如果需要更改数据磁盘映像加密设置,必须使用正确的设置创建一个新的库映像版本。Message: Cannot specify new data disk image encryption lun [<number>] with a disk encryption set in region [<region>] for update gallery image version request. To update this version, remove the new lun. If you need to change the data disk image encryption settings, you must create a new gallery image version with the correct settings.
原因:你向现有映像版本的数据磁盘添加了加密。Cause: You added encryption to the data disk of an existing image version. 不能向现有映像版本添加加密。You can't add encryption to an existing image version.
解决方法:创建一个新的库映像版本或删除添加的加密设置。Workaround: Create a new gallery image version or remove the added encryption settings.

消息:库项目版本源只能直接在 storageProfile 下指定或者在各个 OS 或数据磁盘中指定。能且只能提供一个源类型(用户映像、快照、磁盘、虚拟机)。Message: The gallery artifact version source can only be specified either directly under storageProfile or within individual OS or data disks. One and only one source type (user image, snapshot, disk, virtual machine) can be provided.
原因:缺少源 ID。Cause: The source ID is missing.
解决方法:确保源的源 ID 存在。Workaround: Ensure that the source ID of the source is present.

消息:找不到源: <resourceID>。请确保该源存在。Message: Source was not found: <resourceID>. Please make sure the source exists.
原因:源的资源 ID 可能不正确。Cause: The resource ID of the source might be incorrect.
解决方法:确保源的资源 ID 正确。Workaround: Ensure that the resource ID of the source is correct.

消息:目标区域“<region_1>”中的磁盘“galleryArtifactVersion.properties.publishingProfile.targetRegions.encryption.osDiskImage.diskEncryptionSetId”需要一个磁盘加密集,因为区域“<region_2>”中的相应磁盘使用了磁盘加密集“<diskEncryptionSetID>”Message: A disk encryption set is required for disk 'galleryArtifactVersion.properties.publishingProfile.targetRegions.encryption.osDiskImage.diskEncryptionSetId' in target region '<region_1>' since disk encryption set '<diskEncryptionSetID>' is used for the corresponding disk in region '<region_2>'
原因:<region_2> 中的 OS 磁盘使用了加密,但 <region_1> 中未使用。Cause: Encryption has been used on the OS disk in <region_2>, but not in <region_1>.
解决方法:如果在 OS 磁盘上使用加密,请在所有区域中使用加密。Workaround: If you're using encryption on the OS disk, use encryption in all regions.

消息:目标区域“<region_1>”中的磁盘“LUN <number>”需要一个磁盘加密集,因为区域“<region_2>”中的相应磁盘使用了磁盘加密集“<diskEncryptionSetID>”Message: A disk encryption set is required for disk 'LUN <number>' in target region '<region_1>' since disk encryption set '<diskEncryptionSetID>' is used for the corresponding disk in region '<region_2>'
原因:<region_2> 中的 LUN <number> 处的数据磁盘使用了加密,但 <region_1> 中未使用。Cause: Encryption has been used on the data disk at LUN <number> in <region_2>, but not in <region_1>.
解决方法:如果在数据磁盘上使用加密,请在所有区域中使用加密。Workaround: If you're using encryption on a data disk, use encryption in all regions.

消息:在 encryption.dataDiskImages 中指定了无效的 lun [<number>]。Lun 必须为下列值之一: [0,9]。Message: An invalid lun [<number>] was specified in encryption.dataDiskImages. The lun must be one of the following values ['0,9'].
原因:为加密指定的 LUN 与附加到 VM 的磁盘的任何 LUN 都不匹配。Cause: The LUN specified for the encryption does not match any of the LUNs for disks attached to the VM.
解决方法:将加密中的 LUN 更改为 VM 中存在的某个数据磁盘的 LUN。Workaround: Change the LUN in the encryption to the LUN of a data disk present in the VM.

消息:在目标区域“<region>”的 encryption.dataDiskImages 中指定了重复的 lun“<number>”。Message: Duplicate luns '<number>' were specified in target region '<region>' encryption.dataDiskImages.
原因:<region> 中使用的加密设置至少将某个 LUN 指定了两次。Cause: The encryption settings used in <region> specified a LUN at least twice.
解决方法:更改 <region> 中的 LUN 以确保所有 LUN 在 <region> 中都是唯一的。Workaround: Change the LUN in <region> to make sure that all the LUNs are unique in <region>.

消息:OSDiskImage 和 DataDiskImage 不能指向同一 blob <sourceID>Message: OSDiskImage and DataDiskImage cannot point to same blob <sourceID>
原因:OS 磁盘的源和至少一个数据磁盘的源不唯一。Cause: The sources for the OS disk and at least one data disk are not unique.
解决方法:更改 OS 磁盘和/或数据磁盘的源,以确保 OS 磁盘以及每个数据磁盘都是唯一的。Workaround: Change the source for the OS disk and/or data disks to ensure that the OS disk as well as each data disk is unique.

消息:目标发布区域中不允许出现重复的区域。Message: Duplicate regions are not allowed in target publishing regions.
原因:某个区域在发布区域中列出了多次。Cause: A region is listed among the publishing regions more than once.
解决方法:删除重复的区域。Workaround: Remove the duplicate region.

消息:不允许在现有映像中添加新的数据磁盘或更改数据磁盘的 LUN。Message: Adding new Data Disks or changing the LUN of a Data Disk in an existing Image is not allowed.
原因:对映像版本的更新调用中包含新的数据磁盘或用于某个磁盘的新 LUN。Cause: An update call to the image version either contains a new data disk or has a new LUN for a disk.
解决方法:使用现有映像版本的 LUN 和数据磁盘。Workaround: Use the LUNs and data disks of the existing image version.

消息:磁盘加密集 <diskEncryptionSetID> 必须与库资源位于同一订阅 <subscriptionID> 中。Message: The disk encryption set <diskEncryptionSetID> must be in the same subscription <subscriptionID> as the gallery resource.
原因:共享映像库当前不支持使用其他订阅中的磁盘加密集。Cause: The shared image gallery does not currently support using a disk encryption set in a different subscription.
解决方法:在同一订阅中创建映像版本和磁盘加密集。Workaround: Create the image version and disk encryption set in the same subscription.

消息:由于“GalleryImageVersion 源资源大小 2048 超出支持的最大大小 1024”,此区域中的复制失败。Message: Replication failed in this region due to 'The GalleryImageVersion source resource size 2048 exceeds the max size 1024 supported.'
原因:源中的某个数据磁盘大于 1TB。Cause: A data disk in the source is greater than 1TB.
解决方法:将数据磁盘的大小调整为 1 TB。Workaround: Resize the data disk to under 1 TB.

从某个映像版本创建或更新 VM 或规模集Creating or updating a VM or scale sets from an image version

消息:不存在“<imageDefinitionResourceID>”的最新映像版本Message: There is no latest image version exists for "<imageDefinitionResourceID>"
原因:用来部署虚拟机的映像定义未包含最新版本中包括的任何映像版本。Cause: The image definition you used to deploy the virtual machine does not contain any image versions that are included in latest.
解决方法:请确保至少有一个映像版本将“从最新版本中排除”设置为 False。Workaround: Ensure that there is at least one image version that has 'Exclude from latest' set to False.

消息:库映像 /subscriptions/<subscriptionID>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<galleryName>/images/<imageName>/versions/<versionNumber> 在 <region> 区域不可用。请联系映像所有者以将其复制到此区域,或者更改你请求的区域。Message: The gallery image /subscriptions/<subscriptionID>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<galleryName>/images/<imageName>/versions/<versionNumber> is not available in <region> region. Please contact image owner to replicate to this region, or change your requested region.
原因:选择用于部署的版本不存在或在指定的区域中没有副本。Cause: The version selected for deployment does not exist or does not have a replica in the indicated region.
解决方法:请确保映像资源的名称正确,并且在指定的区域中至少有一个副本。Workaround: Ensure that the name of the image resource is correct and that there is at least one replica in the indicated region.

消息:库映像 /subscriptions/<subscriptionID>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<galleryName>/images/<imageName> 在 <region> 区域不可用。请联系映像所有者以将其复制到此区域,或者更改你请求的区域。Message: The gallery image /subscriptions/<subscriptionID>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<galleryName>/images/<imageName> is not available in <region> region. Please contact image owner to replicate to this region, or change your requested region.
原因:选择用于部署的映像定义没有包含在最新版本和指定区域中的任何映像版本。Cause: The image definition selected for deployment does not have any image versions that are included in latest and also in the indicated region.
解决方法:请确保区域中至少有一个映像版本将“从最新版本中排除”设置为 False。Workaround: Ensure that there is at least one image version in the region that has 'Exclude from latest' set to False.

消息:客户端有权在范围 <resourceID> 中执行操作“Microsoft.Compute/galleries/images/versions/read”,但当前租户 <tenantID> 无权访问链接的订阅 <subscriptionID>。Message: The client has permission to perform action 'Microsoft.Compute/galleries/images/versions/read' on scope <resourceID>, however the current tenant <tenantID> is not authorized to access linked subscription <subscriptionID>.
原因:虚拟机或规模集是通过另一租户中的 SIG 映像创建的。Cause: The virtual machine or scale set was created through a SIG image in another tenant. 你尝试对虚拟机或规模集进行更改,但无权访问拥有该映像的订阅。You've tried to make a change to the virtual machine or scale set, but you don't have access to the subscription that owns the image.
解决方法:联系该映像版本的订阅的所有者,请求其授予对该映像版本的读取访问权限。Workaround: Contact the owner of the subscription of the image version to grant read access to the image version.

消息:库映像 <resourceID> 在 <region> 区域中不可用。请联系映像所有者以将其复制到此区域,或者更改你请求的区域。Message: The gallery image <resourceID> is not available in <region> region. Please contact image owner to replicate to this region, or change your requested region.
原因:正在其中创建 VM 的区域不在库映像的已发布区域列表中。Cause: The VM is being created in a region that's not among the list of published regions for the gallery image.
解决方法:将映像复制到该区域中,或在库映像的其中一个发布区域中创建 VM。Workaround: Either replicate the image to the region or create a VM in one of the regions in the gallery image's publishing regions.

消息:不允许使用参数“osProfile”。Message: Parameter 'osProfile' is not allowed.
原因:为基于专用映像版本创建的 VM 提供了管理员用户名、密码或 SSH 密钥。Cause: Admin username, password, or SSH keys were provided for a VM that was created from a specialized image version.
解决方法:如果要基于该映像创建 VM,请勿包含管理员用户名、密码或 SSH 密钥。Workaround: Don't include the admin username, password, or SSH keys if you intend to create a VM from that image. 否则,请使用通用映像版本,并提供管理员用户名、密码或 SSH 密钥。Otherwise, use a generalized image version and supply the admin username, password, or SSH keys.

消息:必需的参数“osProfile”缺失或为 null。Message: Required parameter 'osProfile' is missing (null).
原因:VM 是基于通用映像创建的,并且缺少管理员用户名、密码或 SSH 密钥。Cause: The VM is created from a generalized image, and it's missing the admin username, password, or SSH keys. 因为通用映像不会保留管理员用户名、密码或 SSH 密钥,因此,在创建 VM 或规模集的过程中,必须指定这些字段。Because generalized images don't retain the admin username, password, or SSH keys, these fields must be specified during creation of a VM or scale set.
解决方法:指定管理员用户名、密码或 SSH 密钥,或使用专用映像版本。Workaround: Specify the admin username, password, or SSH keys, or use a specialized image version.

消息:无法更新虚拟机规模集 <vmssName>,因为 VM 规模集的当前 OS 状态为“通用”,不同于更新后的库映像 OS 状态“专用”。Message: Cannot update Virtual Machine Scale Set <vmssName> as the current OS state of the VM Scale Set is Generalized which is different from the updated gallery image OS state which is Specialized.
原因:规模集的当前源映像是一个通用源映像,但使用专用的源映像进行更新。Cause: The current source image for the scale set is a generalized source image, but it's being updated with a source image that is specialized. 规模集的当前源映像和新的源映像必须处于相同状态。The current source image and the new source image for a scale set must be of the same state.
解决方法:若要更新规模集,请使用一个通用的映像版本。Workaround: To update the scale set, use a generalized image version.

消息:共享映像库 <versionID> 中的磁盘加密集 <diskEncryptionSetID> 属于订阅 <subscriptionID_1>,不能用于订阅 <subscriptionID_2> 中的资源Message: Disk encryption set <diskEncryptionSetID> in shared image gallery <versionID> belongs to subscription <subscriptionID_1> and cannot be used with resource '' in subscription <subscriptionID_2>
原因:用于对映像版本进行加密的磁盘加密集所在的订阅不是用于承载映像版本的订阅。Cause: The disk encryption set used to encrypt the image version resides in a different subscription than the subscription to host the image version.
解决方法:为映像版本和磁盘加密集使用同一订阅。Workaround: Use the same subscription for the image version and disk encryption set.

消息:创建 VM 或虚拟机规模集需要很长时间。Message: The VM or virtual machine scale set creation takes a long time.
解决方法:验证你要尝试从中创建 VM 或虚拟机规模集的映像版本的 OSType 与用于创建映像版本的源的 OSType 是否相同。Workaround: Verify that the OSType of the image version that you're trying to create the VM or virtual machine scale set from has the same OSType of the source that you used to create the image version.

消息:ID 为 <vmID> 的资源的计划 ['{"name":"","publisher":"","product":"","promotionCode":""}'] 与父级库映像计划 ['null'] 不同。Message: The resource with id <vmID> has a different plan ['{"name":"","publisher":"","product":"","promotionCode":""}'] than the parent gallery image plan ['null'].
原因:正在部署的映像版本的父映像定义没有购买计划信息。Cause: The parent image definition for the image version being deployed does not have a purchase plan information.
解决方法:根据错误消息创建具有相同购买计划详细信息的映像定义,并在该映像定义内创建映像版本。Workaround: Create an image definition with the same purchase plan details from the error message and create the image version within the image definition.

基于某个映像版本创建磁盘Creating a disk from an image version

消息:参数 imageReference 的值无效。Message: The value of parameter imageReference is invalid.
原因:你尝试从某个 SIG 映像版本导出到磁盘,但使用了该映像中不存在的 LUN 位置。Cause: You've tried to export from a SIG Image version to a disk but used a LUN position that does not exist on the image.
解决方法:检查映像版本,查看正在使用的 LUN 位置。Workaround: Check the image version to see what LUN positions are in use.

共享资源Sharing resources

可以通过 Azure 基于角色的访问控制 (Azure RBAC) 启用对映像库、映像定义、映像版本资源的跨订阅共享。The sharing of image gallery, image definition, and image version resources across subscriptions is enabled using Azure role-based access control (Azure RBAC).

复制速度Replication speed

请使用 --expand ReplicationStatus 标志来检查是否已完成到所有指定目标区域的复制。Use the --expand ReplicationStatus flag to check if the replication to all the specified target regions has finished. 如果尚未完成,请等待作业完成,最长等待时间为 6 小时。If not, wait for up to six hours for the job to finish. 如果失败,请再次触发用于创建并复制映像版本的命令。If it fails, trigger the command again to create and replicate the image version. 如果需要将映像版本复制到许多目标区域,可考虑分阶段进行复制。If there are many target regions that the image version is being replicated to, consider doing the replication in phases.

Azure 限制和配额Azure limits and quotas

Azure 限制和配额适用于所有共享映像库、映像定义和映像版本资源。Azure limits and quotas apply to all shared image gallery, image definition, and image version resources. 请确保未超出订阅限制。Make sure you're within the limits for your subscriptions.

后续步骤Next steps

详细了解共享映像库Learn more about shared image galleries.