Ansible Role kvm_host
This role installs the required packages and configures the host as a KVM host.
Mandatory Requirements
Install Python 3, and the python3-libvirt and python3-lxml modules.
Optional Role Variables
Variable |
Description |
Default Value |
---|---|---|
|
What should happen with the guests (VMs) when the host shuts down. Possible options: |
|
|
Number of guests will be shutdown concurrently. |
|
|
Enables or disables the libvirt-guests service, analogous to |
|
|
Number of seconds we’re willing to wait for a guest to shut down. |
|
|
Enables or disables the libvirtd service, analogous to |
|
|
A list of libvirt network definitions. Subkeys: |
|
|
A list of libvirt storage pool definitions. Currently only supports directory pools. Subkeys: |
|
Example:
# optional
kvm_host__libvirt_guests_on_shutdown: 'shutdown'
kvm_host__libvirt_guests_parallel_shutdown: 5
kvm_host__libvirt_guests_service_enabled: true
kvm_host__libvirt_guests_shutdown_timeout: 300
kvm_host__libvirtd_service_enabled: true
kvm_host__networks:
- name: 'default'
bridge: 'virbr0'
ip_address: '192.0.2.0.1'
subnet: '255.255.255.0'
dhcp_start: '192.0.2.0.10'
dhcp_end: '192.0.2.0.254'
kvm_host__pools:
- name: 'default'
path: '/data/kvm/images'