Add support for setting the libvirt connection uri
This, for example, allows you to run libvirt with non-default socket path. Change-Id: Ia01f39f425cccc6acebd31f77b46b1948e24d215 Story: 2004344 Task: 27935
This commit is contained in:
parent
4f20ed32f6
commit
ffcdee61dd
@ -11,3 +11,22 @@ libvirt_pool_group: "{{ ansible_user_id }}"
|
|||||||
# By default, allow QEMU without hardware virtualisation since this is a
|
# By default, allow QEMU without hardware virtualisation since this is a
|
||||||
# development tool.
|
# development tool.
|
||||||
libvirt_require_vt: false
|
libvirt_require_vt: false
|
||||||
|
|
||||||
|
# This determines the libvirt unix_sock_dir configuration option. You can set
|
||||||
|
# this option to the empty string if you want to use the default location. The
|
||||||
|
# main use case is to run multiple instances of libvirt side-by-side.
|
||||||
|
libvirt_custom_socket_path: ""
|
||||||
|
|
||||||
|
# Sets the path to the libvirtd PID file. You will need to change this if you
|
||||||
|
# want to run multiple instances of the libvirt daemon side-by-side.
|
||||||
|
libvirt_custom_pid_path: >-
|
||||||
|
{%- if libvirt_custom_socket_path -%}
|
||||||
|
{{ libvirt_custom_socket_path }}/libvirt.pid
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
# This controls the libvirt connection URI. This value is used on commands run
|
||||||
|
# on the hypervisor (as opposed to remote connections).
|
||||||
|
libvirt_local_uri: >-
|
||||||
|
{%- if libvirt_custom_socket_path -%}
|
||||||
|
qemu+unix:///system?socket={{ libvirt_custom_socket_path }}/libvirt-sock
|
||||||
|
{%- endif %}
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
owner: "{{ libvirt_pool_owner }}"
|
owner: "{{ libvirt_pool_owner }}"
|
||||||
group: "{{ libvirt_pool_group }}"
|
group: "{{ libvirt_pool_group }}"
|
||||||
libvirt_host_require_vt: "{{ libvirt_require_vt }}"
|
libvirt_host_require_vt: "{{ libvirt_require_vt }}"
|
||||||
|
libvirt_host_uri: "{{ libvirt_local_uri }}"
|
||||||
|
libvirt_host_socket_dir: "{{ libvirt_custom_socket_path }}"
|
||||||
|
libvirt_host_pid_path: "{{ libvirt_custom_pid_path }}"
|
||||||
|
|
||||||
- name: Set up Virtual BMC daemon
|
- name: Set up Virtual BMC daemon
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
name: virtualbmc-domain
|
name: virtualbmc-domain
|
||||||
vars:
|
vars:
|
||||||
vbmc_domain: "{{ domain }}"
|
vbmc_domain: "{{ domain }}"
|
||||||
|
vbmc_libvirt_uri: "{{ libvirt_local_uri }}"
|
||||||
vbmc_ipmi_address: "{{ ipmi_address }}"
|
vbmc_ipmi_address: "{{ ipmi_address }}"
|
||||||
vbmc_ipmi_username: "{{ ipmi_username }}"
|
vbmc_ipmi_username: "{{ ipmi_username }}"
|
||||||
vbmc_ipmi_password: "{{ ipmi_password }}"
|
vbmc_ipmi_password: "{{ ipmi_password }}"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
include_role:
|
include_role:
|
||||||
name: stackhpc.libvirt-vm
|
name: stackhpc.libvirt-vm
|
||||||
vars:
|
vars:
|
||||||
|
libvirt_vm_uri: "{{ libvirt_local_uri }}"
|
||||||
libvirt_vm_default_console_log_dir: "{{ log_directory }}"
|
libvirt_vm_default_console_log_dir: "{{ log_directory }}"
|
||||||
# Configure VM definitions for the Libvirt provider.
|
# Configure VM definitions for the Libvirt provider.
|
||||||
# FIXME(w-miller): Set absent/present in tenks_schedule on a per-node
|
# FIXME(w-miller): Set absent/present in tenks_schedule on a per-node
|
||||||
|
@ -12,7 +12,12 @@
|
|||||||
# The output format of this command gives two lines of header, followed by
|
# The output format of this command gives two lines of header, followed by
|
||||||
# (for each vNIC):
|
# (for each vNIC):
|
||||||
# <name> <type> <source interface> <model> <MAC>
|
# <name> <type> <source interface> <model> <MAC>
|
||||||
command: /usr/bin/virsh domiflist '{{ node.name }}'
|
command: >-
|
||||||
|
/usr/bin/virsh
|
||||||
|
{% if uri %}-c {{ uri }}{% endif %}
|
||||||
|
domiflist '{{ node.name }}'
|
||||||
|
vars:
|
||||||
|
uri: "{{ hostvars[ironic_hypervisor].libvirt_local_uri }}"
|
||||||
register: iflist_res
|
register: iflist_res
|
||||||
changed_when: false
|
changed_when: false
|
||||||
become: true
|
become: true
|
||||||
|
@ -15,3 +15,5 @@ vbmc_log_directory:
|
|||||||
vbmc_virtualenv_path:
|
vbmc_virtualenv_path:
|
||||||
# Whether the domain should be `present` or `absent` in Virtual BMC.
|
# Whether the domain should be `present` or `absent` in Virtual BMC.
|
||||||
vbmc_state: present
|
vbmc_state: present
|
||||||
|
# libvirt connnection URI
|
||||||
|
vbmc_libvirt_uri:
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
--username '{{ vbmc_ipmi_username }}'
|
--username '{{ vbmc_ipmi_username }}'
|
||||||
--password '{{ vbmc_ipmi_password }}'
|
--password '{{ vbmc_ipmi_password }}'
|
||||||
--address {{ vbmc_ipmi_address }}
|
--address {{ vbmc_ipmi_address }}
|
||||||
|
{% if vbmc_libvirt_uri %} --libvirt-uri '{{vbmc_libvirt_uri}}'{% endif %}
|
||||||
when: vbmc_state == 'present'
|
when: vbmc_state == 'present'
|
||||||
become: true
|
become: true
|
||||||
tags:
|
tags:
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Adds support for setting the libvirt connection uri via the
|
||||||
|
``libvirt_local_uri`` variable. See
|
||||||
|
`this story <https://storyboard.openstack.org/#!/story/2004344>`_
|
||||||
|
for details.
|
Loading…
x
Reference in New Issue
Block a user