Merge pull request #10 from w-miller/disable-power-on

Disable automatic power-on of Libvirt nodes
This commit is contained in:
w-miller 2018-09-11 19:46:12 +01:00 committed by GitHub
commit ffc4a8edf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -21,4 +21,5 @@
libvirt_vms: >-
{{ nodes | map('set_libvirt_interfaces')
| map('set_libvirt_volume_pool')
| map('set_libvirt_start_params')
| list }}

View File

@ -41,6 +41,7 @@ class FilterModule(object):
# Libvirt filters.
'set_libvirt_interfaces': set_libvirt_interfaces,
'set_libvirt_start_params': set_libvirt_start_params,
'set_libvirt_volume_pool': set_libvirt_volume_pool,
# Miscellaneous filters.
@ -83,6 +84,18 @@ def set_libvirt_volume_pool(context, node):
return node
def set_libvirt_start_params(node):
"""Set the Libvirt start and autostart parameters.
Since Ironic will be managing the power state and we may want to perform
inspection, don't start the VM after definition or automatically start on
host start-up.
"""
node['start'] = False
node['autostart'] = False
return node
@contextfilter
def bridge_name(context, physnet):
"""Get the Tenks OVS bridge name from a physical network name.