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
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}
86 MigrationSshPort: {get_param: DockerNovaMigrationSshdPort}
90 description: Role data for the Libvirt service.
92 service_name: {get_attr: [NovaLibvirtBase, role_data, service_name]}
94 get_attr: [NovaLibvirtBase, role_data, config_settings]
95 step_config: &step_config
96 get_attr: [NovaLibvirtBase, role_data, step_config]
98 config_volume: nova_libvirt
99 puppet_tags: libvirtd_config,nova_config,file,exec
100 step_config: *step_config
101 config_image: {get_param: DockerNovaLibvirtConfigImage}
103 /var/lib/kolla/config_files/nova_libvirt.json:
106 - use_tls_for_live_migration
107 - /usr/sbin/libvirtd --listen --config /etc/libvirt/libvirtd.conf
108 - /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf
110 - source: "/var/lib/kolla/config_files/src/*"
113 preserve_properties: true
114 - source: "/var/lib/kolla/config_files/src-ceph/"
117 preserve_properties: true
119 - path: /var/log/nova
125 image: {get_param: DockerNovaLibvirtImage}
132 - {get_attr: [ContainersCommon, volumes]}
134 - /var/lib/kolla/config_files/nova_libvirt.json:/var/lib/kolla/config_files/config.json:ro
135 - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
136 - /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
137 - /lib/modules:/lib/modules:ro
140 - /sys/fs/cgroup:/sys/fs/cgroup
141 - /var/lib/nova:/var/lib/nova
142 - /etc/libvirt/secrets:/etc/libvirt/secrets
143 # Needed to use host's virtlogd
144 - /var/run/libvirt:/var/run/libvirt
145 - /var/lib/libvirt:/var/lib/libvirt
146 - /etc/libvirt/qemu:/etc/libvirt/qemu
147 - /var/log/libvirt/qemu:/var/log/libvirt/qemu:ro
148 - /var/log/containers/nova:/var/log/nova
150 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
152 - name: create libvirt persistent data directories
157 - /etc/libvirt/secrets
160 - /var/log/containers/nova
161 - name: ensure ceph configurations exist
165 - name: set enable_package_install fact
167 enable_package_install: {get_param: EnablePackageInstall}
168 # We use virtlogd on host, so when using Deployed Server
169 # feature, we need to ensure libvirt is installed.
170 - name: install libvirt-daemon
174 when: enable_package_install
175 - name: start virtlogd socket
177 name: virtlogd.socket
180 when: enable_package_install
182 - name: Stop and disable libvirtd service
184 service: name=libvirtd state=stopped enabled=no