【发布时间】: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"
}
}
【问题讨论】: