1 heat_template_version: pike
4 OpenStack Libvirt Service
7 DockerNovaLibvirtImage:
10 # we configure libvirt via the nova-compute container due to coupling
11 # in the puppet modules
12 DockerNovaLibvirtConfigImage:
13 description: The container image to use for the nova_libvirt config_volume
17 description: Dictionary packing service data
21 description: Mapping of service_name -> network name. Typically set
22 via parameter_defaults in the resource registry. This
23 mapping overrides those in ServiceNetMapDefaults.
30 description: Role name on which the service is applied
34 description: Parameters specific to the role
38 description: Mapping of service endpoint -> protocol. Typically set
39 via parameter_defaults in the resource registry.
44 UseTLSTransportForLiveMigration:
47 description: If set to true and if EnableInternalTLS is enabled, it will
48 set the libvirt URI's transport to tls and configure the
49 relevant keys for libvirt.
50 DockerNovaMigrationSshdPort:
52 description: Port that dockerized nova migration target sshd service
57 description: Whether to enable or not the Rbd backend for Nova
59 CinderEnableRbdBackend:
61 description: Whether to enable or not the Rbd backend for Cinder
64 description: The Ceph client key. Can be created with ceph-authtool --gen-print-key. Currently only used for external Ceph deployments to create the openstack user keyring.
69 description: The Ceph cluster FSID. Must be a UUID.
73 use_tls_for_live_migration:
76 - {get_param: EnableInternalTLS}
79 - {get_param: UseTLSTransportForLiveMigration}
85 - {get_param: NovaEnableRbdBackend}
88 - {get_param: CinderEnableRbdBackend}
94 type: ./containers-common.yaml
97 type: ../../puppet/services/database/mysql-client.yaml
100 type: ../../puppet/services/nova-libvirt.yaml
102 EndpointMap: {get_param: EndpointMap}
103 ServiceData: {get_param: ServiceData}
104 ServiceNetMap: {get_param: ServiceNetMap}
105 DefaultPasswords: {get_param: DefaultPasswords}
106 RoleName: {get_param: RoleName}
107 RoleParameters: {get_param: RoleParameters}
108 MigrationSshPort: {get_param: DockerNovaMigrationSshdPort}
112 description: Role data for the Libvirt service.
114 service_name: {get_attr: [NovaLibvirtBase, role_data, service_name]}
116 get_attr: [NovaLibvirtBase, role_data, config_settings]
117 step_config: &step_config
120 - - {get_attr: [NovaLibvirtBase, role_data, step_config]}
121 - {get_attr: [MySQLClient, role_data, step_config]}
123 config_volume: nova_libvirt
124 puppet_tags: libvirtd_config,nova_config,file
125 step_config: *step_config
126 config_image: {get_param: DockerNovaLibvirtConfigImage}
128 /var/lib/kolla/config_files/nova_libvirt.json:
131 - use_tls_for_live_migration
132 - /usr/sbin/libvirtd --listen --config /etc/libvirt/libvirtd.conf
133 - /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf
135 - source: "/var/lib/kolla/config_files/src/*"
138 preserve_properties: true
139 - source: "/var/lib/kolla/config_files/src-ceph/"
142 preserve_properties: true
143 /var/lib/kolla/config_files/nova_virtlogd.json:
144 command: /usr/sbin/virtlogd --config /etc/libvirt/virtlogd.conf
146 - source: "/var/lib/kolla/config_files/src/*"
149 preserve_properties: true
151 - path: /var/log/nova
158 image: {get_param: DockerNovaLibvirtImage}
165 - {get_attr: [ContainersCommon, volumes]}
167 - /var/lib/kolla/config_files/nova_virtlogd.json:/var/lib/kolla/config_files/config.json:ro
168 - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
169 - /lib/modules:/lib/modules:ro
172 - /sys/fs/cgroup:/sys/fs/cgroup
173 - /var/lib/nova:/var/lib/nova
174 - /var/run/libvirt:/var/run/libvirt
175 - /var/lib/libvirt:/var/lib/libvirt
176 - /etc/libvirt/qemu:/etc/libvirt/qemu:ro
177 - /var/log/libvirt/qemu:/var/log/libvirt/qemu
179 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
182 image: {get_param: DockerNovaLibvirtImage}
189 - {get_attr: [ContainersCommon, volumes]}
191 - /var/lib/kolla/config_files/nova_libvirt.json:/var/lib/kolla/config_files/config.json:ro
192 - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
193 - /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
194 - /lib/modules:/lib/modules:ro
197 - /sys/fs/cgroup:/sys/fs/cgroup
198 - /var/lib/nova:/var/lib/nova
199 - /etc/libvirt:/etc/libvirt
200 - /var/run/libvirt:/var/run/libvirt
201 - /var/lib/libvirt:/var/lib/libvirt
202 - /var/log/libvirt/qemu:/var/log/libvirt/qemu:ro
203 - /var/log/containers/nova:/var/log/nova
205 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
208 - need_libvirt_secret
209 - nova_libvirt_init_secret:
211 image: {get_param: DockerNovaLibvirtImage}
216 - {get_attr: [ContainersCommon, volumes]}
218 - /var/lib/config-data/puppet-generated/nova_libvirt/etc/nova:/etc/nova:ro
219 - /etc/libvirt:/etc/libvirt
220 - /var/run/libvirt:/var/run/libvirt
221 - /var/lib/libvirt:/var/lib/libvirt
226 template: /usr/bin/virsh secret-define --file /etc/nova/secret.xml && /usr/bin/virsh secret-set-value --secret 'SECRET_UUID' --base64 'SECRET_KEY'
228 SECRET_UUID: {get_param: CephClusterFSID}
229 SECRET_KEY: {get_param: CephClientKey}
232 - name: create libvirt persistent data directories
238 - /etc/libvirt/secrets
241 - /var/log/containers/nova
242 - name: ensure ceph configurations exist
247 - name: Stop and disable libvirtd service
249 service: name=libvirtd state=stopped enabled=no