这是我第一次尝试使用terraform创建vSphere VM。虚拟机成功创建,但需要7分钟才能完成。这是我采取的步骤。Terraform vSphere慢启动
- 手动上传Ubuntu 16.04 ova。
- 手动将图像转换为模板。
- 通过GUI从模板手动创建VM。虚拟机启动需要大约20秒的时间,需要 。
- 使用指向模板的terraform创建VM。这需要7 分钟。
使用terraform VM启动顺序与手动创建的VM相同,然后在下面的消息中挂起大约6分半钟。
[ 12.109016] blk_update_request: I/O error, dev fd0, sector 0
对于手动和terraform VM创建,该错误消息重复约6次。但在手动创建期间,它几乎立即转到登录提示。在terraform创建期间,它会在此消息中挂起大约6分半钟,然后转到登录提示符。任何想法为什么它挂在terraform创作过程中?
intance.tf
resource "vsphere_virtual_machine" "hellovm" {
name = "hellovm2"
vcpu = 1
memory = 1024
datacenter = "Lab09-Datacenter01"
network_interface {
label = "Lab09-NetA"
}
disk {
template = "${var.vmtemp}"
type = "thin"
datastore = "${var.vmdatastore}"
}
}
terraform标准输出
Macbook12:concoursebootstrap steve$ terraform apply
vsphere_folder.concourse-base: Refreshing state... (ID: Lab09-Datacenter01/VirtualMachines)
vsphere_virtual_machine.hellovm: Refreshing state... (ID: hellovm)
vsphere_virtual_machine.hellovm: Creating...
datacenter: "" => "Lab09-Datacenter01"
detach_unknown_disks_on_delete: "" => "false"
disk.#: "" => "1"
disk.3867083049.bootable: "" => ""
disk.3867083049.controller_type: "" => "scsi"
disk.3867083049.datastore: "" => "nfs-lab09-vol1"
disk.3867083049.iops: "" => ""
disk.3867083049.keep_on_remove: "" => ""
disk.3867083049.key: "" => "<computed>"
disk.3867083049.name: "" => ""
disk.3867083049.size: "" => ""
disk.3867083049.template: "" => "ubuntu-16.04-server-cloudimg-amd64"
disk.3867083049.type: "" => "thin"
disk.3867083049.uuid: "" => "<computed>"
disk.3867083049.vmdk: "" => ""
domain: "" => "vsphere.local"
enable_disk_uuid: "" => "false"
linked_clone: "" => "false"
memory: "" => "1024"
memory_reservation: "" => "0"
moid: "" => "<computed>"
name: "" => "hellovm"
network_interface.#: "" => "1"
network_interface.0.ip_address: "" => "<computed>"
network_interface.0.ipv4_address: "" => "<computed>"
network_interface.0.ipv4_gateway: "" => "<computed>"
network_interface.0.ipv4_prefix_length: "" => "<computed>"
network_interface.0.ipv6_address: "" => "<computed>"
network_interface.0.ipv6_gateway: "" => "<computed>"
network_interface.0.ipv6_prefix_length: "" => "<computed>"
network_interface.0.label: "" => "Lab09-NetA"
network_interface.0.mac_address: "" => "<computed>"
network_interface.0.subnet_mask: "" => "<computed>"
skip_customization: "" => "false"
time_zone: "" => "Etc/UTC"
uuid: "" => "<computed>"
vcpu: "" => "1"
vsphere_virtual_machine.hellovm: Still creating... (10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (1m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (1m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (1m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (1m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (1m40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (1m50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (2m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (2m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (2m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (2m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (2m40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (2m50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (3m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (3m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (3m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (3m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (3m40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (3m50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (4m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (4m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (4m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (4m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (4m40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (4m50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (5m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (5m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (5m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (5m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (5m40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (5m50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (6m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (6m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (6m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (6m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (6m40s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (6m50s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (7m0s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (7m10s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (7m20s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (7m30s elapsed)
vsphere_virtual_machine.hellovm: Still creating... (7m40s elapsed)
vsphere_virtual_machine.hellovm: Creation complete (ID: hellovm)
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
申请Ubuntu的dmesg的
VM后terraform跟踪输出创建,它是等待启动
的terraform输出的其余部分。重复原木然后几分钟以下
感谢您的建议。我会试一试并发布结果。 – ptsw
嗨vancluever,我们尝试将IP分配更改为静态值,尝试删除该部分,并且我们没有更改部署时间。在查看toolsDeployPkg.log中的日志之后,没有与操作相关联的时间戳,使得难以在输出中查看原因。您是否有任何其他建议可以看到内核启动过程和显示登录提示 – ecoles
@ptsw之间发生的问题对于此问题上的无线电沉默,感到抱歉!我只是想提一下,我们今天发布了插件的0.3.0版本,它显着改变了定制和网络服务员的行为,所以你可能想要放弃!另外,如果这些更改都不能解决您的问题,您可能需要完全跳过服务员,现在可以通过设置新的['wait_for_guest_net'](https://www.terraform.io/docs/providers/vsphere /r/virtual_machine.html#wait_for_guest_net)选项设置为“false”。让我知道事情的后续! – vancluever