针对经典部署模型中的分配失败情况进行故障排除的步骤Troubleshooting steps specific to allocation failure scenarios in the classic deployment model

重要

经典 VM 将于 2023 年 3 月 1 日停用。Classic VMs will be retired on March 1, 2023.

如果从 ASM 使用 IaaS 资源,请在 2023 年 3 月 1 日之前完成迁移。If you use IaaS resources from ASM, please complete your migration by March 1, 2023. 我们建议你尽快进行切换,以利用 Azure 资源管理器中的许多增强功能。We encourage you to make the switch sooner to take advantage of the many feature enhancements in Azure Resource Manager.

有关详细信息,请参阅在 2023 年 3 月 1 日之前将 IaaS 资源迁移到 Azure 资源管理器For more information, see Migrate your IaaS resources to Azure Resource Manager by March 1, 2023.

以下是造成分配请求被固定的常见分配案例。The following are common allocation scenarios that cause an allocation request to be pinned. 我们在本文稍后深入探讨每一个案例。We'll dive into each scenario later in this article.

  • 重设 VM 大小或向现有云服务添加 VM 或角色实例Resize a VM or add VMs or role instances to an existing cloud service
  • 重启部分停止(已解除分配)的 VMRestart partially stopped (deallocated) VMs
  • 重启完全停止(已解除分配)的 VMRestart fully stopped (deallocated) VMs
  • 过渡和生产环境部署(仅适用于平台即服务)Staging and production deployments (platform as a service only)
  • 地缘组(VM 或服务邻近性)Affinity group (VM or service proximity)
  • 基于地缘组的虚拟网络Affinity-group-based virtual network

收到分配错误时,请确认所列出的任何方案是否适用于此错误。When you receive an allocation error, check whether any of the listed scenarios apply to your error. 使用 Azure 平台返回的分配错误来识别对应的案例。Use the allocation error that's returned by the Azure platform to identify the corresponding scenario. 如果请求已固定,请尝试删除一些固定约束,向更多群集展现请求,以增加分配成功的机会。If your request is pinned, remove some of the pinning constraints to open your request to more clusters, thereby increasing the chance of allocation success. 一般情况下,如果错误未表示“不支持请求的 VM 大小”,则始终可以稍后重试。In general, if the error does not state that "the requested VM size is not supported," you can always retry at a later time. 这是因为群集中已释放足够资源,可以满足你的请求。This is because enough resources may have been freed in the cluster to accommodate your request. 如果问题在于不支持所请求的 VM 大小,请尝试使用不同的 VM 大小。If the problem is that the requested VM size is not supported, try a different VM size. 否则,唯一的做法就是删除固定约束。Otherwise, the only option is to remove the pinning constraint.

有两个常见的故障案例与地缘组有关。Two common failure scenarios are related to affinity groups. 在过去,地缘组用于支持 VM 和服务实例的邻近性,或用于支持创建虚拟网络。In the past, an affinity group was used to provide close proximity to VMs and service instances, or it was used to enable the creation of a virtual network. 在引进区域虚拟网络之后,创建虚拟网络已不再需要地缘组。With the introduction of regional virtual networks, affinity groups are no longer required to create a virtual network. 由于 Azure 基础结构中的网络延迟时间缩短,原本建议使用地缘组来支持 VM 或服务邻近性的情况已有所改变。With the reduction of network latency in Azure infrastructure, the recommendation to use affinity groups for VMs or service proximity has changed.

下图显示(固定的)分配案例的分类。The following Diagram presents the taxonomy of the (pinned) allocation scenarios.

固定分配分类

重设 VM 大小或向现有云服务添加 VM 或角色实例Resize a VM or add VMs or role instances to an existing cloud service

错误Error

Upgrade_VMSizeNotSupported 或 GeneralErrorUpgrade_VMSizeNotSupported or GeneralError

群集固定的原因Cause of cluster pinning

必须在托管现有云服务的原始群集上,尝试请求重设 VM 大小或向现有云服务添加 VM 或角色实例。A request to resize a VM or add a VM or a role instance to an existing cloud service has to be attempted at the original cluster that hosts the existing cloud service. 创建新的云服务可让 Azure 平台寻找另一个有可用资源的群集,或另一个支持你所请求的 VM 大小的群集。Creating a new cloud service allows the Azure platform to find another cluster that has free resources or supports the VM size that you requested.

解决方法Workaround

如果错误是 Upgrade_VMSizeNotSupported*,请尝试使用不同的 VM 大小。If the error is Upgrade_VMSizeNotSupported*, try a different VM size. 如果使用不同的 VM 大小不可行,但可接受使用不同的虚拟 IP 地址 (VIP),则创建新的云服务来托管新的 VM,并将新的云服务添加到运行现有 VM 的区域虚拟网络中。If using a different VM size is not an option, but if it's acceptable to use a different virtual IP address (VIP), create a new cloud service to host the new VM and add the new cloud service to the regional virtual network where the existing VMs are running. 如果现有的云服务未使用区域虚拟网络,用户仍然可以为新的云服务创建新的虚拟网络,并 将现有虚拟网络连接到新的虚拟网络If your existing cloud service does not use a regional virtual network, you can still create a new virtual network for the new cloud service, and then connect your existing virtual network to the new virtual network. 详细了解 区域虚拟网络See more about regional virtual networks.

如果错误是 GeneralError*,很可能是因为群集虽然支持资源的类型(例如特定的 VM 大小),但群集目前没有可用的资源。If the error is GeneralError*, it's likely that the type of resource (such as a particular VM size) is supported by the cluster, but the cluster does not have free resources at the moment. 类似上述,通过创建新的云服务(请注意,新的云服务必须使用不同的 VIP)添加所需的计算资源,并使用区域虚拟网络连接云服务。Similar to the above scenario, add the desired compute resource through creating a new cloud service (note that the new cloud service has to use a different VIP) and use a regional virtual network to connect your cloud services.

重启部分停止(已解除分配)的 VMRestart partially stopped (deallocated) VMs

错误Error

GeneralError*GeneralError*

群集固定的原因Cause of cluster pinning

部分解除分配表示已停止(解除分配)云服务中的一或多个 VM,但不是全部。Partial deallocation means that you stopped (deallocated) one or more, but not all, VMs in a cloud service. 停止(解除分配)VM 时会释放相关联的资源。When you stop (deallocate) a VM, the associated resources are released. 因此,重启已停止(解除分配)的 VM 是一项新的分配请求。Restarting that stopped (deallocated) VM is therefore a new allocation request. 重新启动已部分解除分配的云服务中的 VM 相当于向现有云服务添加 VM。Restarting VMs in a partially deallocated cloud service is equivalent to adding VMs to an existing cloud service. 必须在托管现有云服务的原始群集上尝试发出分配请求。The allocation request has to be attempted at the original cluster that hosts the existing cloud service. 创建不同的云服务可让 Azure 平台寻找另一个有可用资源的群集,或另一个支持你所请求的 VM 大小的群集。Creating a different cloud service allows the Azure platform to find another cluster that has free resource or supports the VM size that you requested.

解决方法Workaround

如果可接受使用不同的 VIP,请删除已停止(解除分配)的 VM(但保留相关联的磁盘),并通过不同的云服务加回 VM。If it's acceptable to use a different VIP, delete the stopped (deallocated) VMs (but keep the associated disks) and add the VMs back through a different cloud service. 使用区域虚拟网络连接云服务:Use a regional virtual network to connect your cloud services:

重启完全停止(已解除分配)的 VMRestart fully stopped (deallocated) VMs

错误Error

GeneralError*GeneralError*

群集固定的原因Cause of cluster pinning

完全解除分配表示已从云服务停止(解除分配)所有 VM。Full deallocation means that you stopped (deallocated) all VMs from a cloud service. 必须在托管云服务的原始群集上尝试发出分配请求来重新启动这些 VM。The allocation requests to restart these VMs have to be attempted at the original cluster that hosts the cloud service. 创建新的云服务可让 Azure 平台寻找另一个有可用资源的群集,或另一个支持你所请求的 VM 大小的群集。Creating a new cloud service allows the Azure platform to find another cluster that has free resources or supports the VM size that you requested.

解决方法Workaround

如果可接受使用不同的 VIP,请删除已停止(解除分配)的原始 VM(但保留相关联的磁盘),并删除对应的云服务(停止(解除分配)VM 时就已释放相关联的计算资源)。If it's acceptable to use a different VIP, delete the original stopped (deallocated) VMs (but keep the associated disks) and delete the corresponding cloud service (the associated compute resources were already released when you stopped (deallocated) the VMs). 创建新的云服务来加回 VM。Create a new cloud service to add the VMs back.

过渡/生产环境部署(仅适用于平台即服务)Staging/production deployments (platform as a service only)

错误Error

New_General* 或 New_VMSizeNotSupported*New_General* or New_VMSizeNotSupported*

群集固定的原因Cause of cluster pinning

云服务的过渡环境部署和生产环境部署托管于同一个群集中。The staging deployment and the production deployment of a cloud service are hosted in the same cluster. 添加第二个部署时,会在托管第一个部署的相同群集中尝试发出对应的分配请求。When you add the second deployment, the corresponding allocation request will be attempted in the same cluster that hosts the first deployment.

解决方法Workaround

删除第一个部署和原始的云服务,并重新部署云服务。Delete the first deployment and the original cloud service and redeploy the cloud service. 此操作可能将第一个部署安排到有足够可用资源可满足这两个部署的群集,或安排到支持所请求 VM 大小的群集。This action may land the first deployment in a cluster that has enough free resources to fit both deployments or in a cluster that supports the VM sizes that you requested.

地缘组(VM/服务邻近性)Affinity group (VM/service proximity)

错误Error

New_General* 或 New_VMSizeNotSupported*New_General* or New_VMSizeNotSupported*

群集固定的原因Cause of cluster pinning

任何分配给地缘组的计算资源都绑定到一个群集。Any compute resource assigned to an affinity group is tied to one cluster. 该地缘组中新的计算资源请求将于托管现有资源的相同群集中尝试发出。New compute resource requests in that affinity group are attempted in the same cluster where the existing resources are hosted. 无论是通过新的云服务还是现有的云服务创建新资源,都是如此。This is true whether the new resources are created through a new cloud service or through an existing cloud service.

解决方法Workaround

如果不一定需要地缘组,请不要使用地缘组或尝试将计算资源分组为多个地缘组。If an affinity group is not necessary, do not use an affinity group, or group your compute resources into multiple affinity groups.

基于地缘组的虚拟网络Affinity-group-based virtual network

错误Error

New_General* 或 New_VMSizeNotSupported*New_General* or New_VMSizeNotSupported*

群集固定的原因Cause of cluster pinning

在引入区域虚拟网络之前,必须先将虚拟网络与地缘组进行关联。Before regional virtual networks were introduced, you were required to associate a virtual network with an affinity group. 这样,放置在地缘组中的计算资源将受到与上面“分配方案:地缘组(VM/服务邻近性)”部分中所述相同约束的约束。As a result, compute resources placed into an affinity group are bound by the same constraints as described in the "Allocation scenario: Affinity group (VM/service proximity)" section above. 计算资源已绑定到一个群集。The compute resources are tied to one cluster.

解决方法Workaround

如果不需要地缘组,请为要添加的新资源创建新的区域虚拟网络,并 将现有虚拟网络连接到新的虚拟网络If you do not need an affinity group, create a new regional virtual network for the new resources you're adding, and then connect your existing virtual network to the new virtual network. 详细了解 区域虚拟网络See more about regional virtual networks.

此外,用户也可以 将基于地缘组的虚拟网络迁移到区域虚拟网络,并重新添加所需的资源。Alternatively, you can migrate your affinity-group-based virtual network to a regional virtual network, and then add the desired resources again.