forked from thisdavejohnson/sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-vmware-launch.yml
46 lines (43 loc) · 1.23 KB
/
demo-vmware-launch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
# Create a new VM on an ESX server
# Returns changed = False when the VM already exists
# Returns changed = True and a adds ansible_facts from the new VM
# State will set the power status of a guest upon creation. Use powered_on to create and boot.
# Options ['state', 'vm_extra_config', 'vm_disk', 'vm_nic', 'vm_hardware', 'esxi'] are required together
- name: launch instances
hosts: localhost
connection: local
# gather_facts: False
tasks:
- vsphere_guest:
vcenter_hostname: 162.223.13.228
guest: demo-dj-from-template
from_template: yes
template_src: demo-dj-template
# cluster: MainCluster
resource_pool: "/Resources"
- vsphere_guest:
guest: demo-dj-from-template
state: powered_on
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: 2048
num_cpus: 2
osid: centos64Guest
scsi: paravirtual
esxi:
datacenter: Test
hostname: Test