ansible / community

This repository is being archived. See https://github.com/ansible-community/presentations and https://github.com/ansible-community/meetings for the new locations
Apache License 2.0
489 stars 144 forks source link

Unable to provision VM to the specific ESXi hosts #665

Closed dareth-koh closed 2 years ago

dareth-koh commented 2 years ago

$ ansible --version ansible 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = [u'/usr/share/ansible.pcs-modules-2'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /bin/ansible python version = 2.7.5 (default, Jun 28 2022, 15:30:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

$ ansible-config dump --only-changed -t all ansible-config dump --only-changed DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = [u'/usr/share/ansible.pcs-modules-2'] HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False

OS / Environment Centos7 3.10.0-1160.76.1.el7.x86_64

Guest OS: CentOS 4/5 or later (64-bit) Compatibility: ESXi 6.7 and later (VM version 14)

yml file

name: Deploy VM hosts: localhost become: true gather_facts: false collections:

community.vmware vars: vcenter: xxxx.xxx.2.5 vcenter_username: xxxxxxx@vsphere.local esxi: xxx.xxxx.2.3 vars_prompt:

name: vcenter_password prompt: "Enter vcenter password ?" private: yes unsafe: yes #Accept special characters tasks: name: Create a virtual machine from an ISO vmware_guest: datacenter: XXX_XXXXXXX_DataCentre datastore: XXXXXXXXXS01_DG02 #Specify datastore or datastore cluster to provision virtual machine. esxi_hostname: "{{ esxi }}" esxi_hostname: xxx.xxxx.2.3 validate_certs: no hostname: "{{ vcenter }}" username: "{{ vcenter_username }}" password: "{{ vcenter_password }}" folder: xxxxx name: xxxxxxx01_1 guest_id: centos64Guest state: poweredon force: yes hardware: boot_firmware: bios hotadd_cpu: yes hotadd_memory: yes memory_mb: 4096 mem_reservation: 4096 num_cpus: 2 nested_virt: no scsi: paravirtual secure_boot: no

Expected Results Provision the VM to the correct host -> xxx.xxxx.2.3

felixfontein commented 2 years ago

This repository is for management of all Ansible community related initiatives, such as meetings.

Ansible Support