Vsphere:Terraform应用无法完成 - 挂起创建VM

时间:2017-07-07 17:20:10

标签: terraform vsphere

提供商:VMWare vSphere

您好, 我正在尝试使用terraform从模板创建一个新的VM。由于我使用的客户操作系统是在VMware的客户操作系统支持矩阵中,因此我添加了“skip_customization”。但是,当我做“terraform apply”时。 Terraform在创建VM状态时陷入困境,并且不会继续前进。

Terraform版本:0.9.11

Terraform配置文件:

# Configure the VMware vSphere Provider
provider "vsphere" {
  user           = "${var.vsphere_user}"
  password       = "${var.vsphere_password}"
  vsphere_server = "${var.vsphere_server}"
  allow_unverified_ssl = true
}

# Create a folder
  resource "vsphere_folder" "Terraform" {
  datacenter = "Datacenter"
  path = "DSM/Terraform"
}

# Create a virtual machine within the folder
  resource "vsphere_virtual_machine" "test" {
  name   = "Terraform-test"
  folder = "${vsphere_folder.Terraform.path}"
  vcpu   = 2
  memory = 4096
  datacenter = "Datacenter"

  network_interface {
      label = "network"
  }
  disk {
     # Guest OS: Ubuntu Linux (32-bit)
     template  = "DSM/A/template"  
  }
   skip_customization = true
}

Terrafrom Apply

这是我在terraform申请后得到的结果:(它不应该花那么长时间,如果我不终止它就不会停止)

... 
vsphere_virtual_machine.test: Still creating... (10s elapsed)
vsphere_virtual_machine.test: Still creating... (20s elapsed)
vsphere_virtual_machine.test: Still creating... (30s elapsed)
vsphere_virtual_machine.test: Still creating... (40s elapsed)
vsphere_virtual_machine.test: Still creating... (50s elapsed) 
...
vsphere_virtual_machine.test: Still creating... (21m20s elapsed) 
vsphere_virtual_machine.test: Still creating... (21m30s elapsed)
vsphere_virtual_machine.test: Still creating... (21m40s elapsed)
vsphere_virtual_machine.test: Still creating... (21m50s elapsed)
vsphere_virtual_machine.test: Still creating... (22m0s elapsed)
Interrupt received. Please wait for Terraform to exit or data loss may occur. 
Gracefully shutting down... 
stopping apply operation...
vsphere_virtual_machine.test: Still creating... (22m10s elapsed) 
Two interrupts received. Exiting immediately. Note that data loss may have occurred.

预期行为

完成创建并显示消息应用完成。

实际行为

Terraform在创建VM时会挂起。

重现步骤

terraform计划 terraform apply

重要的Factoids

使用具有数据中心级别权限访问权限的用户帐户

0 个答案:

没有答案