Open
Description
SUMMARY
I want to use ansible vmware_guest module to create virtual machine on my vCenter.But I got this error message: "fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to create a virtual machine : A component of the virtual machine is not accessible on the host."}"
ISSUE TYPE
- Bug Report
COMPONENT NAME
vmware_guest
ANSIBLE VERSION
ansible 2.10.8
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
COLLECTION VERSION
community.vmware 1.7.0
CONFIGURATION
no changed
OS / ENVIRONMENT
OS: Ubuntu 22.04 LTS
STEPS TO REPRODUCE
vim playbook.yml
(write playbook...)ansible-playbook playbook.yml
<-- (Got Error)
- hosts: localhost
gather_facts: no
tasks:
- name: create demo vm
vmware_guest:
hostname: vc.test.com
username: demo
password: 1234
validate_certs: no
folder: /
datacenter: "mydatacenter"
name: demo1-by-ansible
guest_id: centos7_64Guest
state: poweredoff
disk:
- size_gb: 1
type: thin
datastore: QH82-datadisk
hardware:
hotadd_cpu: true
hotremove_cpu: true
hotadd_memory: true
memory_mb: "128"
num_cpus: "1"
scsi: lsilogic
networks:
- name: "VM Network"
device_type: vmxnet3
ip: "192.168.45.11"
netmask: 255.255.255.0
EXPECTED RESULTS
ACTUAL RESULTS
PLAY [localhost] *********************************************************************************************************************************
TASK [create demo vm] ****************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to create a virtual machine : A component of the virtual machine is not accessible on the host."}
PLAY RECAP ***************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0