# Create Multiple WMware VMs Through Ansible

**URL:** <https://forum.ansible.com/t/create-multiple-wmware-vms-through-ansible/20666>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [February 24, 2016, 3:03pm UTC](https://forum.ansible.com/t/create-multiple-wmware-vms-through-ansible/20666 "2016-02-24T15:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Matthews](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Mark\_Matthews](https://forum.ansible.com/u/Mark_Matthews)\
**Post date:** [February 24, 2016, 3:03pm UTC](https://forum.ansible.com/t/create-multiple-wmware-vms-through-ansible/20666/1 "2016-02-24T15:03:04Z")

</div>

Hi

Is it at all possible to create multiple VMware VM’s using an Ansible playbook? Giving each VM a unique name (server1, server2, server3)

I can see anyway of doing this using the following playbooks

```auto
- vsphere_guest:
    vcenter_hostname: vcenter.mydomain.local
    username: myuser
    password: mypass
    guest: newvm001
    state: reconfigured
    vm_extra_config:
      vcpu.hotadd: yes
      mem.hotadd: yes
      notes: This is a test VM
    vm_disk:
      disk1:
        size_gb: 10
        type: thin
        datastore: storage001
    vm_nic:
      nic1:
        type: vmxnet3
        network: VM Network
        network_type: standard
    vm_hardware:
      memory_mb: 4096
      num_cpus: 4
      osid: centos64Guest
      scsi: paravirtual
    esxi:
      datacenter: MyDatacenter
      hostname: esx001.mydomain.local

# Deploy a guest from a template
- vsphere_guest:
    vcenter_hostname: vcenter.mydomain.local
    username: myuser
    password: mypass
    guest: newvm001
    from_template: yes
    template_src: centosTemplate
    cluster: MainCluster
    resource_pool: "/Resources"
    vm_extra_config: 

```

folder: MyFolder
