Looks like your vm_guest formatting part is wrong
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: [email protected] <[email protected]> on
behalf of Orkhan Mammadov <[email protected]>
Sent: Monday, July 5, 2021 3:46:34 AM
To: Ansible Project <[email protected]>
Subject: [ansible-project] Re: deploy VM in ESXi using Ansible
Actually,
I am using ESXi evaluation mode (free). I created .yml file with the following
entry:
---
- name: Create VM
vmware_guest:
hostname: esxilab
username: root
password: 123456
validate_certs: no
folder: /ha-datacenter/vm (I am not sure if it is correctly added)
name: testvm
state: poweredon
guest_id: centos64Guest
esxi_hostname: 192.168.1.101
disk:
- size_gb: 10
type: thin
datastore: datastore1
hardware:
memory_mb: 1024
num_cpus: 2
scsi: paravirtual
cdrom:
type: iso
iso_path: datastore1/iso files/CentOS-8.1.1911-x86_64-boot.iso
networks:
- name: VM Network
mac: 00:0c:29:c6:fe:93
ip: 192.168.1.105
netmask: 255.255.255.0
device_type: vmnic0
wait_for_ip_address: yes
delegate_to: localhost
register: deploy_vm
However, while running the file, I get the following error message:
ERROR! 'vmware_guest' is not a valid attribute for a Play
The error appears to be in '/home/ansible/projects/test/deploy_vm.yml': line 2,
column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Create VM
^ here
On Saturday, July 3, 2021 at 9:45:47 PM UTC+4 [email protected] wrote:
https://docs.ansible.com/ansible/latest/scenario_guides/vmware_scenarios/faq.html#can-i-deploy-a-virtual-machine-on-a-standalone-esxi-server
"Yes. vmware_guest can deploy a virtual machine with required settings on a
standalone ESXi server. However, you must have a paid license to deploy virtual
machines this way. If you are using the free version, the API is read-only."
On Saturday, 3 July 2021 at 16:14:21 UTC+1 Orkhan Mammadov wrote:
Hi guys,
Could you please help me with the guidance to create VM in ESXi using ansible
playbook?
I tried to find proper one over forums, unfortunately could not find.
Regards.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0c6c7550-4f4c-416a-a751-35880fb420a2n%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/0c6c7550-4f4c-416a-a751-35880fb420a2n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/SY6P282MB31965223BEA9CB0A2C3C4E6DAD1D9%40SY6P282MB3196.AUSP282.PROD.OUTLOOK.COM.