1 heat_template_version: pike
4 OpenStack Libvirt Service
9 default: 'tripleoupstream'
11 DockerNovaLibvirtImage:
13 default: 'centos-binary-nova-libvirt:latest'
15 # we configure libvirt via the nova-compute container due to coupling
16 # in the puppet modules
17 DockerNovaLibvirtConfigImage:
18 description: The container image to use for the nova_libvirt config_volume
19 default: 'centos-binary-nova-compute:latest'
23 description: Set to true to enable package installation
27 description: Mapping of service_name -> network name. Typically set
28 via parameter_defaults in the resource registry. This
29 mapping overrides those in ServiceNetMapDefaults.
36 description: Role name on which the service is applied
40 description: Parameters specific to the role
44 description: Mapping of service endpoint -> protocol. Typically set
45 via parameter_defaults in the resource registry.
50 UseTLSTransportForLiveMigration:
53 description: If set to true and if EnableInternalTLS is enabled, it will
54 set the libvirt URI's transport to tls and configure the
55 relevant keys for libvirt.
59 use_tls_for_live_migration:
62 - {get_param: EnableInternalTLS}
65 - {get_param: UseTLSTransportForLiveMigration}
71 type: ./containers-common.yaml
74 type: ../../puppet/services/nova-libvirt.yaml
76 EndpointMap: {get_param: EndpointMap}
77 ServiceNetMap: {get_param: ServiceNetMap}
78 DefaultPasswords: {get_param: DefaultPasswords}
79 RoleName: {get_param: RoleName}
80 RoleParameters: {get_param: RoleParameters}
84 description: Role data for the Libvirt service.
86 service_name: {get_attr: [NovaLibvirtBase, role_data, service_name]}
89 - get_attr: [NovaLibvirtBase, role_data, config_settings]
90 # FIXME: we need to disable migration for now as the
91 # hieradata is common for all services, and this means nova
92 # and nova_placement puppet runs also try to configure
93 # libvirt, and they fail. We can remove this override when
94 # we have hieradata separation between containers.
95 - tripleo::profile::base::nova::manage_migration: false
96 step_config: &step_config
97 get_attr: [NovaLibvirtBase, role_data, step_config]
99 config_volume: nova_libvirt
100 puppet_tags: nova_config
101 step_config: *step_config
105 - [ {get_param: DockerNamespace}, {get_param: DockerNovaLibvirtConfigImage} ]
107 /var/lib/kolla/config_files/nova_libvirt.json:
110 - use_tls_for_live_migration
111 - /usr/sbin/libvirtd --listen --config /etc/libvirt/libvirtd.conf
112 - /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf
114 - source: "/var/lib/kolla/config_files/src/*"
117 preserve_properties: true
119 - path: /var/log/nova
128 - [ {get_param: DockerNamespace}, {get_param: DockerNovaLibvirtImage} ]
135 - {get_attr: [ContainersCommon, volumes]}
137 - /var/lib/kolla/config_files/nova_libvirt.json:/var/lib/kolla/config_files/config.json:ro
138 - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
139 - /lib/modules:/lib/modules:ro
142 - /sys/fs/cgroup:/sys/fs/cgroup
143 - /var/lib/nova:/var/lib/nova
144 # Needed to use host's virtlogd
145 - /var/run/libvirt:/var/run/libvirt
146 - /var/lib/libvirt:/var/lib/libvirt
147 - /etc/libvirt/qemu:/etc/libvirt/qemu
148 - /var/log/libvirt/qemu:/var/log/libvirt/qemu:ro
149 - /var/log/containers/nova:/var/log/nova
151 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
153 - name: create libvirt persistent data directories
160 - /var/log/containers/nova
161 - name: set enable_package_install fact
163 enable_package_install: {get_param: EnablePackageInstall}
164 # We use virtlogd on host, so when using Deployed Server
165 # feature, we need to ensure libvirt is installed.
166 - name: install libvirt-daemon
170 when: enable_package_install
171 - name: start virtlogd socket
173 name: virtlogd.socket
176 when: enable_package_install
178 - name: Stop and disable libvirtd service
180 service: name=libvirtd state=stopped enabled=no