Hi,
Forgive me for my bad english.
I’m actually experiencing some problems using the vmare_guest module. I want to create vms on vmware using this module.
When I create a new vm, the two nic cards are not connected at boot. This is the first problem.
The second one is that I can’t change the number of cores per vcpu and other specific configurations.
I tried to set custom values using customvalues:
customvalues:
- key: “ethernet0.startConnected”
value: true - key: “cpuid.coresPerSocket”
value: 1
I have tested with ansible 2.3, 2.4 and 2.5 (from github). I can’t find any documentation to set customvalues.
How do you do this ? Thanks.
The totally code :
- name: “Creating a VM based on template”
vmware_guest:
datacenter: “DC1”
cluster: “mycluster”
hostname: “{{ vcenter_host }}”
username: “{{ vcenter_user }}”
password: “{{ vcenter_password }}”
validate_certs: no
folder: {{ v_folder |default(“/”) }}
name: “{{ v_hostname }}”
annotation: “{{ ansible_date_time.date }} - VM creation {{ v_hostname }} using ansible”
state: poweredon
template: “{{ vmware_template }}”
customvalues: - key: “vcpu.hotadd”
values: “yes” - key: “mem.hotadd”
value: “yes” - key: “ethernet0.startConnected”
value: true - key: “cpuid.coresPerSocket”
value: 1
disk: - disk1:
size_gb: 20
type: “{{ v_disk_type }}”
datastore: “mydatastore” - disk2:
size_gb: “{{ v_disk_size }}”
type: “{{ v_disk_type }}”
datastore: “mydatastore”
hardware:
memory_mb: “{{ v_memory_size }}”
num_cpus: “{{ v_cpu_number }}”
scsi: paravirtual
networks: - name: “{{ vmware_network }}”
vlan: “{{ v_vlan_id }}”
device_type: “e1000”
type: “static”
ip: “{{ v_ip }}”
netmask: “{{ v_netmask | default(‘255.255.255.0’) }}”
gateway: “{{ v_gateway }}”
register: deploy
when: do_action == “new”
delegate_to: localhost
tags: createvm