我正在尝试使用ansible和vmware_guest模块配置新的VM。
我能够成功创建VM,但是未安装vmware工具,并且不确定如何安装VMware工具。
我的剧本是:
- name: Create a virtual machine on given ESXi hostname
vmware_guest:
hostname: "REDACTED"
datacenter: "MyDatacenter"
cluster: "Development"
username: "user@vsphere.local"
password: "my-amazing-password"
validate_certs: no
folder: /my-vms
name: test_vm_0001
state: poweredon
guest_id: centos64Guest
# This is hostname of particular ESXi server on which user wants VM to be deployed
disk:
- size_gb: 10
type: thin
datastore: VxRail-Virtual-SAN-Datastore-e79dd75b-7b8b-42f0-9f3b-b4fa3dda77b7
hardware:
memory_mb: 1024
num_cpus: 2
scsi: paravirtual
networks:
- name: vlanNet
netmask: 255.255.255.0
device_type: vmxnet3
type: static
wait_for_ip_address: True
delegate_to: localhost
register: deploy_vm
我也尝试过使用vmware_guest_tools_wait
模块,并使用相同的VM名称,但这会超时并且无法添加来宾工具。