【问题标题】:Terraform Error on AzureRM VM with 3rd Party Marketplace Image Citrix Netscaler带有第 3 方市场映像 Citrix Netscaler 的 AzureRM VM 上的 Terraform 错误
【发布时间】:2017-12-13 14:02:06
【问题描述】:

在使用市场映像和托管磁盘创建 AzureRM VM 时收到错误,我缺少一些语法盟友,也许是计划块 {} 如何找到要放入计划块的信息? - 有没有人有一个基于托管磁盘的 AzureRM VM 的工作示例,它在 Terraform 中使用来自 Azure 的 3rd Party Marketplace 映像?

Error applying plan:

1 error(s) occurred:

* azurerm_virtual_machine.VMns-vpx-1: 1 error(s) occurred:

* azurerm_virtual_machine.VMns-vpx-1: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=200 -- Original Error: Long running operation terminated with status 'Failed': Code="VMMarketplaceInvalidInput" Message="Creating a virtual machine fro
m Marketplace image requires Plan information in the request. OS disk name is 'myosdisk1'."

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
PS C:\Users\eagle\Downloads\citrix\testingvpx>

此外,Azure 门户显示操作系统磁盘周围的错误:

General
Provisioning state Provisioning failed. Creating a virtual machine from Marketplace image requires Plan information in the request. OS disk name is 'myosdisk1'.. VMMarketplaceInvalidInput 
Guest agent Unknown 

Disks
myosdisk1 Provisioning failed. Creating a virtual machine from Marketplace image requires Plan information in the request. OS disk name is 'myosdisk1'.. VMMarketplaceInvalidInput

正在使用的 Terraform 脚本:

resource "azurerm_virtual_machine" "VMns-vpx-1" {
  name                  = "VMns-vpx-1"
  location              = "${var.azu_location}"
  resource_group_name   = "${azurerm_resource_group.rgVMns-vpx.name}"
  network_interface_ids = ["${azurerm_network_interface.VMns-vpx-1-nic.id}"]
  vm_size               = "Standard_DS3_v2"

  storage_image_reference {
    publisher = "citrix"
    offer     = "netscalervpx120"
    sku       = "netscalerbyol"
    version   = "latest"
  }

  storage_os_disk {
    name              = "myosdisk1"
    caching           = "ReadWrite"
    create_option     = "FromImage"
    managed_disk_type = "Premium_LRS"
  }

  os_profile {
    computer_name  = ""
    admin_username = ""
    admin_password = ""
  }

  boot_diagnostics {
      enabled       = "true"
      storage_uri   = "${azurerm_storage_account.xxxx.primary_blob_endpoint}"
  }

  tags {
        Name = "xxxx"
        Service = "xxx"
  }
}

【问题讨论】:

    标签: azure terraform


    【解决方案1】:

    正如它所说,您缺少“plan”属性定义。市场图片往往有这种情况。

    vm 定义中的所有其他内容看起来都很好,除非 Terraform 需要其他内容。

    【讨论】:

      猜你喜欢
      • 2021-06-15
      • 2019-10-13
      • 1970-01-01
      • 2020-07-26
      • 2020-07-06
      • 1970-01-01
      • 2016-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多