Skip to content

Unable to provision VM to the specific ESXi hosts #1487

Open
@dareth-koh

Description

@dareth-koh
SUMMARY

I have 3 hosts in a cluster and it will randomly provision the VM in any of the 3 hosts.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest

ANSIBLE VERSION

$ 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)]


##### COLLECTION VERSION
<!--- Paste verbatim output from "ansible-galaxy collection list <namespace>.<collection>"  between the quotes
for example: ansible-galaxy collection list community.general
-->
`vmware_guest

CONFIGURATION

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)

STEPS TO REPRODUCE

yml file

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

community.vmware
vars:
vcenter: xxxx.xxx.2.5
vcenter_username: [email protected]
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.xxx.2.3

ACTUAL RESULTS

Provision the VM to the random hosts. it can be xxx.xxx.2.2 or xxx.xxx.2.4. Sometimes, it will provision to the correct host. It is quite random.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugneeds_triageNeeds a first human triage before being processed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions