【Azure Cloud Service】创建Azure云服务时遇见分配VM资源错误: VM(s) with the following constraints cannot be allocated, because the condition is too restrictive

本文涉及的产品
应用实时监控服务-应用监控,每月50GB免费额度
云原生网关 MSE Higress,422元/月
Serverless 应用引擎免费试用套餐包,4320000 CU,有效期3个月
简介: Allocation failed. VM(s) with the following constraints cannot be allocated, because the condition is too restrictive. Please remove some constraints and try again. Constraints applied are:\n - VM Size

问题描述

创建Azure Cloud Service 资源,遇见资源操作完成时的终端预配状态为Failed的信息。

创建失败,创建的错误日志截图如下:

详细的错误信息为:

{

"code":"DeploymentFailed",

"message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",

"details":[{"code":"OverconstrainedAllocationRequest","message":"Allocation failed. VM(s) with the following constraints cannot be allocated, because the condition is too restrictive. Please remove some constraints and try again. Constraints applied are:\n  - VM Size\n"}]}

 

 

问题解答

错误信息中,提示部署Cloud Service(云服务)时,所选择的VM Size(Standard_D4)被限制,分配失败。因为Cloud Service(云服务)所支持的VM Size在不同的区域会有所变动,需要先通过如下的PowerShell脚本来检索可以使用的VM Size List。

Powershell脚本:

    # Update the location
    $location = 'ChinaNorth3'
    # Get all Compute Resource Skus
    $allSkus = Get-AzComputeResourceSku
    # Filter virtualMachine skus for given location
    $vmSkus = $allSkus.Where{$_.resourceType -eq 'virtualMachines' -and $_.LocationInfo.Location -like $location}
    # From filtered virtualMachine skus, select PaaS Skus
    $passVMSkus = $vmSkus.Where{$_.Capabilities.Where{$_.name -eq 'VMDeploymentTypes'}.Value.Contains("PaaS")}
    # Optional step to format and sort the output by Family
    $passVMSkus | Sort-Object Family, Name | Format-Table -Property Family, Name, Size

执行结果:

 

当把Standard_D4替换成 Standard_D4_v2后,创建Cloud Service(云服务)成功。

 

参考资料

配置云服务(外延支持)的大小 : https://docs.azure.cn/zh-cn/cloud-services-extended-support/available-sizes#configure-sizes-for-cloud-services-extended-support



 

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

相关文章
|
3月前
【Azure 环境】使用Azure bicep对多个ServicePrinciple 进行role assignment分配
使用Azure bicep对多个ServicePrinciple 进行role assignment分配
61 10
|
6月前
|
Windows
【Azure 云服务】Cloud Service Worker Role Workerrole突然停机,查看Events发现 Defrag Error (0x8900002D)
【Azure 云服务】Cloud Service Worker Role Workerrole突然停机,查看Events发现 Defrag Error (0x8900002D)
【Azure 云服务】Cloud Service Worker Role Workerrole突然停机,查看Events发现 Defrag Error (0x8900002D)
|
6月前
|
存储 安全 BI
【Azure Storage Account】使用Azure Policy来检查Storage Account中是否有开启匿名访问的Container
【Azure Storage Account】使用Azure Policy来检查Storage Account中是否有开启匿名访问的Container
【Azure Storage Account】使用Azure Policy来检查Storage Account中是否有开启匿名访问的Container
|
4月前
|
JSON API 数据安全/隐私保护
【Azure Cloud Service】使用RESTAPI更新Cloud Service(Extended Support) 中所配置的证书
本文介绍了在更新Azure Cloud Service (Extended Support) 证书时,若旧证书(如中间证书、根证书)存储在Key Vault Secret中,而新证书仅匹配到服务器证书时,可能导致的错误及解决方法。建议使用PowerShell或RestAPI进行涉及机密的更新。文章详细描述了使用REST API更新证书的三个步骤:上传证书到Azure Key Vault、获取Cloud Service信息并发送GET请求、更新Cloud Service信息并发送PUT请求。通过这些步骤,可以成功更新证书并在云服务节点中验证证书信息。
|
6月前
|
C++
【Azure云服务 Cloud Service】如何在部署云服务Cloud Service时候通过启动任务Start Task来配置IIS (如开启ARR)
【Azure云服务 Cloud Service】如何在部署云服务Cloud Service时候通过启动任务Start Task来配置IIS (如开启ARR)
106 2
|
6月前
|
开发框架 .NET 中间件
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
|
6月前
|
微服务 Windows
【Azure 微服务】Service Fabric 部署时遇见了VMExtensionProvisioningError错误: Multiple VM extensions failed to be provisioned on the VM
【Azure 微服务】Service Fabric 部署时遇见了VMExtensionProvisioningError错误: Multiple VM extensions failed to be provisioned on the VM
|
6月前
|
C#
【Azure Developer】使用 Azure VM 上的用户分配托管标识访问 Azure Key Vault 中国区代码示例
【Azure Developer】使用 Azure VM 上的用户分配托管标识访问 Azure Key Vault 中国区代码示例
|
6月前
|
Java
【Azure 应用服务】在App Service 中如何通过Managed Identity获取访问Azure资源的Token呢? 如Key Vault
【Azure 应用服务】在App Service 中如何通过Managed Identity获取访问Azure资源的Token呢? 如Key Vault
|
6月前
【Azure 应用服务】App Service运行时突然中断:There is not enough space on the disk : 'D:localTempASPNETCORE...
【Azure 应用服务】App Service运行时突然中断:There is not enough space on the disk : 'D:localTempASPNETCORE...