部署dscExtension天青VMSS问题 [英] Issues deploying dscExtension to Azure VMSS

查看:226
本文介绍了部署dscExtension天青VMSS问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直有一些问题,部署dscExtension到的Azure虚拟机规模组使用部署模板(VMSS)。

I've been having some issues deploying a dscExtension to an Azure virtual machine scale set (VMSS) using a deployment template.

下面是我如何把它添加到我的模板:

Here's how I've added it to my template:

{
  "name": "dscExtension",
  "properties": {
    "publisher": "Microsoft.Powershell",
    "type": "DSC",
    "typeHandlerVersion": "2.9",
    "autoUpgradeMinorVersion": true,
    "settings": {
      "ModulesUrl": "[concat(parameters('_artifactsLocation'), '/', 'MyDscPackage.zip', parameters('_artifactsLocationSasToken'))]",
      "ConfigurationFunction": "CmvmProcessor.ps1\\CmvmProcessor",
      "Properties": [
        {
          "Name": "ServiceCredentials",
          "Value": {
            "UserName": "parameters('administratorLogin')",
            "Password": "parameters('administratorLoginPassword')"
          },
          "TypeName": "System.Management.Automation.PSCredential"
        }
      ]
    }
  }
}

该VMSS本身是成功部署,但是当我浏览单个虚拟机的InstanceView的dscExtension显示了一条错误消息失败的情况。

The VMSS itself is successfully deploying, but when I browse the InstanceView of the individual VMs, the dscExtension shows the failed status with an error message.

是我在这些问题如下:

ARM的部署不尝试更新后重新部署的dscExtension。我习惯了MSDeploy Web应用程序扩展那里的文物被更新和code重新部署在每个新的部署。我不知道如何迫使它来更新新的二进制文件的dscExtension。事实上,它似乎只给在VMSS的第一个部署错误,那么它甚至不会再试。

The ARM deployment does not try to update the dscExtension upon redeploy. I am used to MSDeploy web app extensions where the artifacts are updated and the code is redeployed on each new deployment. I do not know how to force it to update the dscExtension with new binaries. In fact it only seems to give an error on the first deploy of the VMSS, then it won't even try again.

我得到的错误是老code,它不存在了。

The error I'm getting is for old code that doesn't exist anymore.

我在一个自定义的DSC PowerShell脚本错误previously,我尝试使用的 -replace 的这是应该运算符来创建的 $匹配的变量,但这是说的 $匹配的是不存在的。

I had a bug previously in a custom DSC Powershell script where I tried to use the -replace operator which is supposed to create a $Matches variable but it was saying $Matches didn't exist.

在任何情况下,我已经因为重构了code和删除整个资源组,然后重新部署。该dscExtension仍给予同样的错误。我已经验证了我在哪里DSC .zip文件位于不再具有code,它能够产生此错误消息的Blob存储帐户。天青必须某处缓存dscExtension。我不能让它使用我的新斑点的.zip,我每次在部署之前上传

In any case, I've since refactored the code and deleted the entire resource group then redeployed. The dscExtension is still giving the same error. I've verified the blob storage account where my DSC .zip is located no longer has the code which is capable of producing this error message. Azure must be caching the dscExtension somewhere. I can't get it to use my new blob .zip that I upload before each deployment.

任何洞察DSC扩展以及如何迫使其上部署更新?

Any insight into the DSC Extension and how to force it to update on deploy?

推荐答案

这听起来像你可能正在运行成多的东西在这里,所以首先尝试简单。为了得到一台VM分机在随后的部署运行,你需要种子了。 (你说的没错,这比AzureRM其余不同),看看这个模板:

It sounds like you may be running into multiple things here, so trying the simple one first. In order to get a VM extension to run on a subsequent deployment you have to "seed" it. (and you're right this is different than the rest of AzureRM) Take a look at this template:

https://github.com/bmoore-msft/AzureRM-Samples/blob/master/VMDSCInstallFile/azuredeploy.json

有是呼吁DSC扩展属性:

There is a property on the DSC extension called:

              "forceUpdateTag" : "changeThisToEnsureScriptRuns-maxlength=50",

如果你想扩展再次运行该属性值必须是不同的。因此,例如,如果你想让它每次运行时你会用随机数或GUID种子吧。你也可以使用版本号,如果你想要的版本它在某种程度上。问题的关键是,如果在模板中的值是一样的,你正在传递一个,扩展将不再运行。

The property value must be different if you ever want the extension to run again. So for example, if you wanted it to run every time you'd seed it with a random number or a guid. You could also use version numbers if you wanted to version it somehow. The point is, if the value in the template is the same as the one you're passing in, the extension won't run again.

这示例使用一个虚拟机,但VMSS语法的的是相同的。该属性也适用于其他扩展(如自定义脚本)。

That sample uses a VM, but the VMSS syntax should be the same. That property also applies to other extensions (e.g. custom script).

这似乎很奇怪的部分是,你说你删除的整个RG,不能让它接受新的包......这听起来很糟糕(即像一个bug)。如果以上不能解决问题,我们可能需要深入挖掘到模板和脚本。 LMK ...

The part that seems odd is that you said you deleted the entire RG and couldn't get it to accept the new package... That sounds bad (i.e. like a bug). If the above doesn't fix it, we may need to dig deeper into the template and script. LMK...

这篇关于部署dscExtension天青VMSS问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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