這是我第一次嘗試使用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