简体   繁体   English

通过ARM模板更新弹性池EDTU

[英]Update elastic pool EDTUs through ARM template

Initially we had deployed database elastic pool in Azure though ARM template. 最初,我们通过ARM模板在Azure中部署了数据库弹性池。 The pool is in Standard edition and had 50 EDTUs in total. 该池为标准版,总共有50个EDTU。 This is happening when deploying the app from VSTS through release management. 通过发布管理从VSTS部署应用程序时会发生这种情况。

At some point the databases grew in size so we had to increase the EDTUs of the pool to get some additional space. 在某些时候数据库的大小增加了,所以我们必须增加池的EDTU来获得更多的空间。 We did this directly from the portal and we didn't deploy through ARM templates. 我们直接从门户网站进行了此操作,而没有通过ARM模板进行部署。 We increase the EDTUs to 100. 我们将EDTU增加到100。

The problem happens now when we want to redeploy the app through VSTS and use the ARM template. 现在,当我们想通过VSTS重新部署应用程序并使用ARM模板时,就会出现问题。 We update the value in ARM template to reflect the one we configured in the portal (100) but we are getting the following error. 我们更新了ARM模板中的值,以反映我们在门户网站(100)中配置的值,但出现以下错误。

The DTUs or storage limit for the elastic pool 'pool-name' cannot be decreased since that would not provide sufficient storage space for its databases. 不能降低弹性池“池名称”的DTU或存储限制,因为这不会为其数据库提供足够的存储空间。 "

Our ARM template for the pool is like the following 我们的池的ARM模板如下所示

{
  "comments": "The elastic pool that hosts all the databases",
  "apiVersion": "2014-04-01-preview",
  "type": "elasticPools",
  "location": "[resourceGroup().location]",
  "dependsOn": ["[concat('Microsoft.Sql/Servers/', variables('sqlServerName'))]"],
  "name": "[variables('elasticPoolName')]",
  "properties": {
      "edition": "Standard",
      "dtu": "100",
      "databaseDtuMin": "0",
      "databaseDtuMax": "10",
   }
}

The message is descriptive but we don't get why it tries to decrease the size even if we have provided an appropriate size through EDTUs value. 该消息是描述性的,但即使通过EDTUs值提供了适当的大小,我们也无法理解为什么它试图减小大小。

We partially identified why the problem is happening. 我们部分确定了问题发生的原因。

As it's mentioned here and especially the documentation of StorageMB optional argument is better not to provide this and let Azure calculate the size. 正如这里提到的,尤其是StorageMB可选参数的文档最好不要提供此参数,而让Azure计算大小。

Specifies the storage limit, in megabytes, for the elastic pool. 指定弹性池的存储限制(以兆字节为单位)。 You cannot specify a value for this parameter for the Premium edition. 您不能为此高级版的此参数指定值。

If you do not specify this parameter, this cmdlet calculates a value that depends on the value of the Dtu parameter. 如果未指定此参数,则此cmdlet将计算一个值,该值取决于Dtu参数的值。 We recommend that you do not specify the StorageMB parameter. 我们建议您不要指定StorageMB参数。

As noted in the initial post we didn't specify the StorageMB option in the ARM template and this was set by Azure. 如第一篇文章中所述,我们没有在ARM模板中指定StorageMB选项,而是由Azure设置的。 What is not mentioned and it was not clear is that this happens only the first time. 没有提到,也不清楚是第一次发生。

So when we deployed for first time with 50 EDTUs the size of the pool was set to 50 GB. 因此,当我们第一次使用50个EDTU进行部署时,池的大小设置为50 GB。 When we deployed again and set the EDTUs to 100 then the size remains on 50GB which is confusing. 当我们再次部署并将EDTU设置为100时,其大小仍为50GB,这令人困惑。 So the solution and probably a safer way is to always specify the StorageMB option for the pool to have a better view and control of what is happening. 因此,解决方案和可能更安全的方法是始终为池指定StorageMB选项,以更好地查看和控制正在发生的事情。

My guess is that the current size of the databases in the pool may be greater than the included data storage that comes with a Standard 100 eDTU pool. 我的猜测是,池中数据库的当前大小可能大于Standard 100 eDTU池随附的随附数据存储。 The included storage amount for that size is 100 GB. 该大小包含的存储量为100 GB。 The amount of storage is a meter that can be adjusted separately so that you have pools with fewer eDTU but higher amounts of storage. 存储量是可以单独调整的计量器,因此您的池中的eDTU较少,但存储量较高。 The current max of storage on an Standard 100 eDTU pool is 750 GB. Standard 100 eDTU池上的当前最大存储容量为750 GB。

I wonder if someone went into the portal and also adjusted the max data storage size for the pool. 我想知道是否有人进入门户网站并调整了池的最大数据存储大小。 If this is the case, and the databases within the pool now exceed the 100 GB mark, then this error you are seeing makes sense. 如果是这种情况,并且池中的数据库现在超过了100 GB,则您看到的此错误是有道理的。 Since the template doesn't specify the larger data storage amount then my guess is the system is defaulting it to the included amount of 100 GB and attempting to apply that, which may be too small now. 由于模板未指定较大的数据存储量,因此我想系统会默认将其默认为100 GB的存储量,并尝试应用该数量,现在可能太小了。

I'd suggest checking the portal for the total size of storage currently being used by the databases in the pool. 我建议检查门户网站,以了解池中数据库当前正在使用的总存储容量。 If it exceeds the 100 GB then you'll want to update the template to also include the additional setting for the max size you are using. 如果超过100 GB,则需要更新模板,使其也包含所用最大大小的其他设置。

If it doesn't exceed the 100 GB total now I'm not sure what it's complaining about. 如果现在它不超过100 GB,我不确定它在抱怨什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM