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: Dictionary packing service data
31 description: Mapping of service_name -> network name. Typically set
32 via parameter_defaults in the resource registry. This
33 mapping overrides those in ServiceNetMapDefaults.
40 description: Role name on which the service is applied
44 description: Parameters specific to the role
48 description: Mapping of service endpoint -> protocol. Typically set
49 via parameter_defaults in the resource registry.
54 UseTLSTransportForLiveMigration:
57 description: If set to true and if EnableInternalTLS is enabled, it will
58 set the libvirt URI's transport to tls and configure the
59 relevant keys for libvirt.
63 use_tls_for_live_migration:
66 - {get_param: EnableInternalTLS}
69 - {get_param: UseTLSTransportForLiveMigration}
75 type: ./containers-common.yaml
78 type: ../../puppet/services/nova-libvirt.yaml
80 EndpointMap: {get_param: EndpointMap}
81 ServiceData: {get_param: ServiceData}
82 ServiceNetMap: {get_param: ServiceNetMap}
83 DefaultPasswords: {get_param: DefaultPasswords}
84 RoleName: {get_param: RoleName}
85 RoleParameters: {get_param: RoleParameters}
89 description: Role data for the Libvirt service.
91 service_name: {get_attr: [NovaLibvirtBase, role_data, service_name]}
94 - get_attr: [NovaLibvirtBase, role_data, config_settings]
95 # FIXME: we need to disable migration for now as the
96 # hieradata is common for all services, and this means nova
97 # and nova_placement puppet runs also try to configure
98 # libvirt, and they fail. We can remove this override when
99 # we have hieradata separation between containers.
100 - tripleo::profile::base::nova::manage_migration: false
101 step_config: &step_config
102 get_attr: [NovaLibvirtBase, role_data, step_config]
104 config_volume: nova_libvirt
105 puppet_tags: nova_config
106 step_config: *step_config
110 - [ {get_param: DockerNamespace}, {get_param: DockerNovaLibvirtConfigImage} ]
112 /var/lib/kolla/config_files/nova_libvirt.json:
115 - use_tls_for_live_migration
116 - /usr/sbin/libvirtd --listen --config /etc/libvirt/libvirtd.conf
117 - /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf
119 - source: "/var/lib/kolla/config_files/src/*"
122 preserve_properties: true
124 - path: /var/log/nova
133 - [ {get_param: DockerNamespace}, {get_param: DockerNovaLibvirtImage} ]
140 - {get_attr: [ContainersCommon, volumes]}
142 - /var/lib/kolla/config_files/nova_libvirt.json:/var/lib/kolla/config_files/config.json:ro
143 - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
144 - /lib/modules:/lib/modules:ro
147 - /sys/fs/cgroup:/sys/fs/cgroup
148 - /var/lib/nova:/var/lib/nova
149 # Needed to use host's virtlogd
150 - /var/run/libvirt:/var/run/libvirt
151 - /var/lib/libvirt:/var/lib/libvirt
152 - /etc/libvirt/qemu:/etc/libvirt/qemu
153 - /var/log/libvirt/qemu:/var/log/libvirt/qemu:ro
154 - /var/log/containers/nova:/var/log/nova
156 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
158 - name: create libvirt persistent data directories
165 - /var/log/containers/nova
166 - name: set enable_package_install fact
168 enable_package_install: {get_param: EnablePackageInstall}
169 # We use virtlogd on host, so when using Deployed Server
170 # feature, we need to ensure libvirt is installed.
171 - name: install libvirt-daemon
175 when: enable_package_install
176 - name: start virtlogd socket
178 name: virtlogd.socket
181 when: enable_package_install
183 - name: Stop and disable libvirtd service
185 service: name=libvirtd state=stopped enabled=no