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: Set to true to enable package installation at deploy time
21 description: Dictionary packing service data
25 description: Mapping of service_name -> network name. Typically set
26 via parameter_defaults in the resource registry. This
27 mapping overrides those in ServiceNetMapDefaults.
34 description: Role name on which the service is applied
38 description: Parameters specific to the role
42 description: Mapping of service endpoint -> protocol. Typically set
43 via parameter_defaults in the resource registry.
48 UseTLSTransportForLiveMigration:
51 description: If set to true and if EnableInternalTLS is enabled, it will
52 set the libvirt URI's transport to tls and configure the
53 relevant keys for libvirt.
54 DockerNovaMigrationSshdPort:
56 description: Port that dockerized nova migration target sshd service
61 description: Whether to enable or not the Rbd backend for Nova
63 CinderEnableRbdBackend:
65 description: Whether to enable or not the Rbd backend for Cinder
68 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.
73 description: The Ceph cluster FSID. Must be a UUID.
77 use_tls_for_live_migration:
80 - {get_param: EnableInternalTLS}
83 - {get_param: UseTLSTransportForLiveMigration}
89 - {get_param: NovaEnableRbdBackend}
92 - {get_param: CinderEnableRbdBackend}
98 type: ./containers-common.yaml
101 type: ../../puppet/services/database/mysql-client.yaml
104 type: ../../puppet/services/nova-libvirt.yaml
106 EndpointMap: {get_param: EndpointMap}
107 ServiceData: {get_param: ServiceData}
108 ServiceNetMap: {get_param: ServiceNetMap}
109 DefaultPasswords: {get_param: DefaultPasswords}
110 RoleName: {get_param: RoleName}
111 RoleParameters: {get_param: RoleParameters}
112 MigrationSshPort: {get_param: DockerNovaMigrationSshdPort}
116 description: Role data for the Libvirt service.
118 service_name: {get_attr: [NovaLibvirtBase, role_data, service_name]}
120 get_attr: [NovaLibvirtBase, role_data, config_settings]
121 step_config: &step_config
124 - - {get_attr: [NovaLibvirtBase, role_data, step_config]}
125 - {get_attr: [MySQLClient, role_data, step_config]}
127 config_volume: nova_libvirt
128 puppet_tags: libvirtd_config,nova_config,file
129 step_config: *step_config
130 config_image: {get_param: DockerNovaLibvirtConfigImage}
132 /var/lib/kolla/config_files/nova_libvirt.json:
135 - use_tls_for_live_migration
136 - /usr/sbin/libvirtd --listen --config /etc/libvirt/libvirtd.conf
137 - /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf
139 - source: "/var/lib/kolla/config_files/src/*"
142 preserve_properties: true
143 - source: "/var/lib/kolla/config_files/src-ceph/"
146 preserve_properties: true
148 - path: /var/log/nova
154 image: {get_param: DockerNovaLibvirtImage}
161 - {get_attr: [ContainersCommon, volumes]}
163 - /var/lib/kolla/config_files/nova_libvirt.json:/var/lib/kolla/config_files/config.json:ro
164 - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
165 - /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
166 - /lib/modules:/lib/modules:ro
169 - /sys/fs/cgroup:/sys/fs/cgroup
170 - /var/lib/nova:/var/lib/nova
171 - /etc/libvirt:/etc/libvirt
172 # Needed to use host's virtlogd
173 - /var/run/libvirt:/var/run/libvirt
174 - /var/lib/libvirt:/var/lib/libvirt
175 - /var/log/libvirt/qemu:/var/log/libvirt/qemu:ro
176 - /var/log/containers/nova:/var/log/nova
178 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
181 - need_libvirt_secret
182 - nova_libvirt_init_secret:
184 image: {get_param: DockerNovaLibvirtImage}
189 - {get_attr: [ContainersCommon, volumes]}
191 - /var/lib/config-data/puppet-generated/nova_libvirt/etc/nova:/etc/nova:ro
192 - /etc/libvirt:/etc/libvirt
193 - /var/run/libvirt:/var/run/libvirt
194 - /var/lib/libvirt:/var/lib/libvirt
199 template: /usr/bin/virsh secret-define --file /etc/nova/secret.xml && /usr/bin/virsh secret-set-value --secret 'SECRET_UUID' --base64 'SECRET_KEY'
201 SECRET_UUID: {get_param: CephClusterFSID}
202 SECRET_KEY: {get_param: CephClientKey}
205 - name: create libvirt persistent data directories
211 - /etc/libvirt/secrets
214 - /var/log/containers/nova
215 - name: ensure ceph configurations exist
219 - name: set enable_package_install fact
221 enable_package_install: {get_param: EnablePackageInstall}
222 # We use virtlogd on host, so when using Deployed Server
223 # feature, we need to ensure libvirt is installed.
224 - name: install libvirt-daemon
228 when: enable_package_install
229 - name: start virtlogd socket
231 name: virtlogd.socket
234 when: enable_package_install
236 - name: Stop and disable libvirtd service
238 service: name=libvirtd state=stopped enabled=no