/
vms_inventory_example.yaml
111 lines (109 loc) · 4.84 KB
/
vms_inventory_example.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright (C) 2020-2023, RTE (http://www.rte-france.com)
# Copyright (C) 2024, SFL (https://savoirfairelinux.com)
# SPDX-License-Identifier: Apache-2.0
all:
children:
VMs:
hosts:
guest0:
description: "Simple VM"
ansible_host: 192.168.212.130 # Update the VM IP
vm_template: "../templates/vm/guest.xml.j2"
vm_disk: "../vm_images/guest.qcow2"
local_disk:
- disk_file: guest0.qcow2
vm_features: []
preferred_host: pc1 # Optional
bridges:
- name: "br0" # Change the bridge name
mac_address: "52:54:00:c4:ff:02" # change the MAC address
guest1:
description: "Complex VM"
ansible_host: 192.168.212.131 # Update the VM IP
vm_template: "../templates/vm/guest.xml.j2"
vm_disk: "../vm_images/guest.qcow2"
local_disk:
- disk_file: guest.qcow2
cpuset: [4, 6] # CPUs list to use.
rt_priority: 1 # FIFO priority
mac_address: "52:54:00:c4:ff:03" # change the MAC address
vm_features: ["rt", "isolated"] # Real time tweaks and CPU pinning
pinned_host: pc2 # Optional
bridges:
- name: "br0" # Change the bridge name
mac_address: "52:54:00:c4:ff:03" # change the MAC address
- name: "br1" # Change the bridge name
mac_address: "52:54:00:c4:ff:04" # change the MAC address
ovs:
- ovs_port: ovs0p0 # Change the OVS port
mac_address: "52:54:00:c4:ff:05" # change the MAC address
pci_passthrough:
- domain: 0x0000 # PCI domain
bus: 0x00 # PCI bus
slot: 0x05 # PCI slot
function: 0x0 # PCI function
sriov:
- sriov_pool1
- sriov_pool2
guest2:
description: "Simple VM with gzipped disk"
ansible_host: 192.168.212.132 # Update the VM IP
vm_template: "../templates/vm/guest.xml.j2"
vm_disk: "../vm_images/guest.img.gz"
disk_extract: true
local_disk:
- disk_file: guest2.qcow2
vm_features: []
preferred_host: pc3 # Optional
bridges:
- name: "br0" # Change the bridge name
mac_address: "52:54:00:c4:ff:05" # change the MAC address
vars:
ansible_user: virtu
apply_network_config: true
# This inventory can be customize using those fields :
# * name: the VM name (string). Only on standalone. Default
# inventory_hostname.
# * uuid: the VM uuid (string). Only on standalone. Default is
# autogenerated.
# * description: the VM description (string). Default is "Test VM".
# * vm_template: the VM template to use (string). Default is
# templates/vm/guest.xml.j2. In most cases, you should not
# change this.
# * vm_disk: the image to use for the VM creation
# * local_disk: list of VM disks. (When using cluster, it's managed by
# vm-manager)
# ** disk_file: name of the disk, note that you must give the same name as
# the vm name.
# * disk_extract: if the disk image is gzipped, set the value to true
# * vm_features: the VM feature (list). Can contained one or more of the
# following items.
# ** isolated: to enable CPU pinning
# ** dpdk: to use link to VM with a OVS/DPDK bridge
# ** rt: to enable real time tweaks
# * cpuset: list of the CPU to use (int list). Use only with isolated.
# * nb_cpu: the number of cpu to use when the vm is not isolated.
# otherwise the length of cpuset is used. Optional (default : 1)
# * memory: the memory to use in Mio (int). Default is 2048.
# * pinned_host: the host to pin the VM (string). Optional. A pinned VM will
# never be migrated on another host.
# * preferred_host: the host to prefer to run the VM (string). Optional. The VM
# will be run on this host if possible. If not, it will be
# run on another host.
# * rt_priority: the FIFO scheduler priority (int). Default is 1. Use only
# with rt.
# * pci_passthrough: a list containing dictionaries of the PCI devices to
# passthrough.
# ** domain: PCI domain (int)
# ** bus: PCI bus (int)
# ** slot: PCI slot (int)
# ** function: PCI function (int)
# * sriov: a list containing the SRIOV pool to use (string list).
# * bridges: a list containing dictionaries of the bridges to use.
# ** name: the bridge name (string)
# ** mac_address: the bridge MAC address (string)
# * ovs: a list containing dictionaries of the OVS ports to use.
# ** ovs_port: the OVS port name (string)
# ** mac_address: the OVS port MAC address (string)
# * apply_network_config: to apply the network configuration without rebooting
# (bool).