更新虚拟机比例设置为添加一个秘密的失败,VHD错误 [英] Updating a Virtual Machine Scale Set to add a secret fails with VHD error

查看:309
本文介绍了更新虚拟机比例设置为添加一个秘密的失败,VHD错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署了虚拟机的大规模集(VMSS)到Azure作为服务面料集群的一部分。当我尝试重新部署模板,稍增强了一个额外的秘密更新VMSS,我碰到下面的错误。我已经验证了我使用的参数是正确的。

类型:Microsoft.Compute / virtualMachineScaleSets
// ...
osProfile:{
  // ...
  秘诀:
    {
      sourceVault:{
        ID:[参数('sourceVaultValue')]
      },
      vaultCertificates:[
        {
          certificateStore:[参数('certificateStoreValue'),
          certificateUrl:[参数('certificateUrlValue')]
        },
        { // ******* 添加 *******
          certificateStore:[参数('certificateStoreValue'),
          certificateUrl:[参数('sslCertificateUrlValue')]
        } // ******* 添加 *******
      ]
    }
  ]
} // ...


新AzureRmResourceGroupDeployment:下午5点46分二十秒 - 资源Microsoft.Compute / virtualMachineScaleSets'主'失败,消息
目前正在使用的任何虚拟机比例设置虚拟机实例VHD容器可能不会被删除。要删除VHD容器,所有
虚拟机使用比例,必须先删除设置虚拟机实例。
在D:\\ MyApp的\\部署\\ deploy.ps1:104字符:5
+新-AzureRmResourceGroupDeployment -ResourceGroupName $ resourceGr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
    + CategoryInfo:NotSpecified:(:) [新-AzureRmResourceGroupDeployment],异常
    + FullyQualifiedErrorId:Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand


解决方案

我已经设法解决这个PowerShell的使用,而不是基于的这个答案。但我还是真的想找到一种方法,有ARM模板部署添加新的证书或其他秘密现有VMSS部署。

更新:原来,当我抄下来的ARM模板,我已经修改了存储帐户的参数,但服务织物已经配置为使用自动生成的前名

I've deployed a virtual machine scale set (VMSS) to Azure as part of a Service Fabric cluster. When I try to redeploy the template, slightly enhanced to update the VMSS with an additional secret, I get the following error. I've verified that the parameters I'm using are all correct.

"type": "Microsoft.Compute/virtualMachineScaleSets",
// ...
"osProfile": {
  // ...
  "secrets": [
    {
      "sourceVault": {
        "id": "[parameters('sourceVaultValue')]"
      },
      "vaultCertificates": [
        {
          "certificateStore": "[parameters('certificateStoreValue')]",
          "certificateUrl": "[parameters('certificateUrlValue')]"
        },
        { // ******* ADDED *******
          "certificateStore": "[parameters('certificateStoreValue')]",
          "certificateUrl": "[parameters('sslCertificateUrlValue')]"
        } // ******* ADDED *******
      ]
    }
  ]
}, // ...

New-AzureRmResourceGroupDeployment : 5:46:20 PM - Resource Microsoft.Compute/virtualMachineScaleSets 'Primary' failed with message
'VHD Containers currently being used by any Virtual Machine Scale Set VM instances may not be removed. To remove a VHD Container, all
Virtual Machine Scale Set VM instances using it must first be deleted.'
At D:\myapp\deploy\deploy.ps1:104 char:5
+     New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGr ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand

解决方案

I've managed to work around this using PowerShell instead, based on this answer. But I would still really like to find a way to have the ARM template deployment add new certificates or other secrets to an existing VMSS deployment.

UPDATE: Turns out that when I had copied down the ARM template I had modified the storage account parameters, but Service Fabric was already configured to use the prior autogenerated names.

这篇关于更新虚拟机比例设置为添加一个秘密的失败,VHD错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆