带有第三方市场的AzureRM VM上的Terraform错误图像Citrix Netscaler

时间:2017-07-09 22:57:44

标签: azure terraform

使用Marketplace映像和托管磁盘创建AzureRM VM时收到错误,我遗漏了一些语法,可能是一个计划块{}如何找到放入Plan块的信息? - 有人在Terraform中使用Azure中的第三方市场图像,有一个基于托管磁盘的AzureRM VM的工作示例吗?

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"
  }
}

1 个答案:

答案 0 :(得分:0)

就像它说的那样,你错过了一个“plan”属性定义。市场图像往往具有这种效果。

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