terraform - terraform vsphere 提供程序在创建 vm 时挂起
问题描述
我正在尝试使用 terraform 和 vsphere 提供程序基于模板(ubuntu 18.04)创建一个 VM。命令显示的最终错误terraform apply..
是:
* vsphere_virtual_machine.vm: timeout waiting for an available IP address
但是,VM 已创建并接收在 vsphere_virtual_machine 资源内的“克隆”部分中设置的 IP 地址。
resource "vsphere_virtual_machine" "vm" {
count = "${var.count}"
name = "${lookup(var.vm_name, count.index + 1)}"
resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
datastore_id = "${data.vsphere_datastore.datastore.id}"
network_interface {
network_id = "${data.vsphere_network.network.id}"
adapter_type = "${data.vsphere_virtual_machine.template.network_interface_types[0]}"
}
disk {
...
}
clone {
template_uuid = "${data.vsphere_virtual_machine.template.id}"
customize {
linux_options {
host_name = "${lookup(var.hostname, count.index + 1)}"
domain = "${var.domain}"
}
dns_server_list = ["${var.ns1}", "${var.ns2}"]
network_interface {
ipv4_address = "${lookup(var.ipv4_address, count.index + 1)}"
ipv4_netmask = "${var.ipv4_netmask}"
}
ipv4_gateway = "${var.ipv4_gateway}"
}
}
}
该toolsDeployPkg.log
文件显示以下错误:
[2018-09-10T18:07:12.557Z] [ info] ENTER STATE Done
[2018-09-10T18:07:12.557Z] [ info] EXIT STATE INPROGRESS
[2018-09-10T18:07:12.557Z] [ info] Deployment succeeded.
[2018-09-10T18:07:12.557Z] [ info] Launching cleanup.
[2018-09-10T18:07:12.557Z] [ debug] Command to exec : /bin/rm
[2018-09-10T18:07:12.557Z] [ info] sizeof ProcessInternal is 56
[2018-09-10T18:07:12.557Z] [ info] Returning, pending output from stdout
[2018-09-10T18:07:12.558Z] [ info] Returning, pending output from stderr
[2018-09-10T18:07:12.658Z] [ info] Process exited normally after 0 seconds, returned 0
[2018-09-10T18:07:12.658Z] [ info] No more output from stdout
[2018-09-10T18:07:12.658Z] [ info] No more output from stderr
[2018-09-10T18:07:12.658Z] [ info] Customization command output:
[2018-09-10T18:07:12.658Z] [ info] sSkipReboot: false, forceSkipReboot false
[2018-09-10T18:07:12.658Z] [ debug] Ran DeployPkg_DeployPackageFromFile successfully
[2018-09-10T18:07:12.658Z] [ debug] ## Closing log
[2018-09-10T18:07:12.658Z] [ info] Rebooting
[2018-09-10T18:07:12.658Z] [ debug] Command to exec : /sbin/telinit
[2018-09-10T18:07:12.658Z] [ info] sizeof ProcessInternal is 56
[2018-09-10T18:07:12.658Z] [ info] Returning, pending output from stdout
[2018-09-10T18:07:12.658Z] [ info] Returning, pending output from stderr
[2018-09-10T18:07:12.769Z] [ error] Process exited abnormally after 0 sec, uncaught signal 15
[2018-09-10T18:07:12.769Z] [ info] No more output from stdout
[2018-09-10T18:07:12.769Z] [ info] No more output from stderr
[2018-09-10T18:07:12.769Z] [ info] Customization command output:
[2018-09-10T18:07:13.633Z] [ error] telinit returned error 127
我是否需要在 vCenter 中配置其他选项?我正在使用以下软件:
- Terraform v0.11.8
- provider.vsphere v1.7.0
- vCenter 6.7
解决方案
推荐阅读
- python - 难以使用 message.author 来识别谁使用 Python 使用 Discord API 发送了消息
- android - android ClassNotFoundException:找不到类错误
- android-ndk - 为什么创建so文件时不能创建.c .cpp文件?
- linux - 如何在 Raspberry Pi 上插入/拔出以太网时有效监控?
- mongodb - 带有重试的 Mongo 驱动程序事务实现
- php - Laravel 确实更新而不是删除
- java - 拆分字符串给出了越界异常
- php - 无法在登录时执行查询 - 注册并使用 MySQL 上传文件时出错
- scikit-learn - 如何使用 cross_validation_scores 使用的分类器
- javascript - 每 5 秒检查一次后台远程图像