简体   繁体   English

terraform azure OMS VM扩展

[英]terraform azure OMS VM extension

I am trying to add OMS VM extension to a linux machine but its just going for an endless wait during deployment.No errors while running terraform plan. 我正在尝试将OMS VM扩展名添加到linux机器上,但部署过程将无休止地等待。运行terraform计划时没有错误。 I am using the following piece of code along with VM creation code in terraform.Any clue whats happening here You can find the corresponding powershell and CLI scripts here https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/oms-linux 我在terraform.Any线索使用下面的代码段与VM创建代码沿着什么这里发生的一切在这里你可以找到相应的PowerShell和CLI脚本https://docs.microsoft.com/en-us/azure/virtual-machines / extensions / oms-linux

resource "azurerm_virtual_machine_extension" "test" {
  name                 = "${azurerm_virtual_machine.test.name}/OmsExtension"
  location             = "${azurerm_resource_group.test.location}"
  resource_group_name  = "${azurerm_resource_group.test.name}"
  virtual_machine_name = "${azurerm_virtual_machine.test.name}"
  publisher            = "Microsoft.EnterpriseCloud.Monitoring"
  type                 = "OmsAgentForLinux"
  type_handler_version = "1.4"


  settings = <<SETTINGS
      {
          "workspace ID" : "XXXX",
      }
  SETTINGS

    protected_settings = <<PROTECTED_SETTINGS
      {
          "workspace key" :  "XXXX"
      }
  PROTECTED_SETTINGS
}

At first glance it looks like your Workspace Key and ID "Keys" are not correct, both keys do not appear to have a space in them. 乍一看,您的工作区密钥和ID“密钥”似乎不正确,两个密钥似乎都没有空格。 Azure should provide a better error like invalid key provided. Azure应该提供更好的错误,例如提供的无效密钥。

I was able to provision successfully using Terraform, it did fail for me a few times but it succeeded with this configuration. 我能够成功使用Terraform进行配置,但对我来说确实失败了几次,但是在此配置下它成功了。

resource "azurerm_virtual_machine_extension" "oms_mma" {
 name                          = "OMSExtension"
 location                      = "${var.vm_location}"
 resource_group_name           = "${var.resource_group_name}"
 virtual_machine_name          = "${var.vm_machine_name}"
 publisher                     = "Microsoft.EnterpriseCloud.Monitoring"
 type                          = "OmsAgentForLinux"
 type_handler_version          = "1.6"
 auto_upgrade_minor_version    = "True"

 settings = <<-BASE_SETTINGS
 {
   "workspaceId" : "myid"
 }
 BASE_SETTINGS

 protected_settings = <<-PROTECTED_SETTINGS
 {
   "workspaceKey" : "mykey"
 }
 PROTECTED_SETTINGS
}

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

相关问题 使用 terraform 将 VM 添加到新的 Azure 监控(无 OMS 代理) - Use terraform to add a VM to the new Azure Monitoring (without OMS Agent) OMS修补非Azure VM - OMS to patch Non azure VM 使用Terraform部署期间在Azure VM上安装DSC扩展的问题 - Issue with install DSC extension on Azure VM during deployment using Terraform 尝试通过 terraform 添加 LinuxDiagnostic Azure VM 扩展并出现错误 - Trying to add LinuxDiagnostic Azure VM Extension through terraform and getting errors Terraform Azure VM 扩展不将 VM 加入 Azure Active Directory Azure 虚拟桌面 - Terraform Azure VM extension does not join VM to Azure Active Directory for Azure Virtual Desktop Terraform Azure 来自本地脚本的 VM 扩展自定义脚本 - Terraform Azure VM Extension Custom Script from Local Script 使用Terraform在Azure VM上使用Tomcat? - Tomcat on Azure VM using terraform? 使用Terraform与Azure VM建立SSH连接 - SSH connection to Azure VM with Terraform AADLoginForWindows 的 Terraform Azure VM 扩展类型和 type_handler_version 参数值 - Terraform Azure VM extension type and type_handler_version parameter values for AADLoginForWindows 无法为 Terraform 使用 JSON 输入 map 变量 Z3A580F142203677F1F0ZBC308 VM308 - unable to use JSON input for Terraform a map variable in Azure VM extension setting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM