vmware_guest spin up multiple VMs at once?

21 views
Skip to first unread message

Tuyen Nguyen

unread,
Dec 5, 2018, 10:45:15 AM12/5/18
to Ansible Project
Hi

Is it possible to spin up multiple vmware VMs at once with vmware_guest?  I found something about using with_items to loop it, but it sounds like it is going to loop it meaning it would spin up the VMs sequentially?  I haven't tested this out yet, but it seems like that is what it would do right?  What if I want to spin up 5 or 10 VMs at once, can that be done ?   Or should I just plan on running 5 or 10 separate ansible-playlist commands at once to deploy multiple VMs at once?

Kai Stian Olstad

unread,
Dec 6, 2018, 1:31:15 AM12/6/18
to ansible...@googlegroups.com
On 05.12.2018 16:45, Tuyen Nguyen wrote:
> Is it possible to spin up multiple vmware VMs at once with
> vmware_guest? I
> found something about using with_items to loop it, but it sounds like
> it is
> going to loop it meaning it would spin up the VMs sequentially? I
> haven't
> tested this out yet, but it seems like that is what it would do right?

yes, with_items will run it sequentially unless you use async.


> What if I want to spin up 5 or 10 VMs at once, can that be done ? Or
> should I just plan on running 5 or 10 separate ansible-playlist
> commands at
> once to deploy multiple VMs at once?

If you specify the new host in a playbook and do delegate_to: localhost
on the create vm task they will run in parallel.
Default forks is at 5 so it will run 5 at a time unless you change forks
so a higher value.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages