[英]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.