-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_vm_no_template.yaml
39 lines (38 loc) · 1.21 KB
/
create_vm_no_template.yaml
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
---
# 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
# Note: vm_floppy support added in 2.0
- vsphere_guest:
guest: newvm001
state: powered_on
vm_extra_config:
vcpu.hotadd: yes
mem.hotadd: yes
notes: This is a test VM
folder: /
vm_disk:
disk1:
size_gb: 10
type: thin
datastore: datastore1
# VMs can be put into folders. The value given here is either the full path
# to the folder (e.g. production/customerA/lamp) or just the last component
# of the path (e.g. lamp):
folder: /
vm_nic:
nic1:
type: "Standard port group"
network: "VM portgroup_2"
network_type: standard
vm_hardware:
memory_mb: 1024
num_cpus: 1
osid: centos7Guest
scsi: paravirtual
vm_cdrom:
type: "iso"
iso_path: "datastore2/CentOS-7-x86_64-DVD-1908.iso"
delegate_to: localhost