Merge "Enables support for configuring Cinder with Pure Storage FlashArray storage...
[apex-tripleo-heat-templates.git] / docker / services / nova-libvirt.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack Libvirt Service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerLibvirtImage:
12     description: image
13     default: 'centos-binary-nova-libvirt:latest'
14     type: string
15   # we configure libvirt via the nova-compute container due to coupling
16   # in the puppet modules
17   DockerNovaConfigImage:
18     description: image
19     default: 'centos-binary-nova-compute:latest'
20     type: string
21   ServiceNetMap:
22     default: {}
23     description: Mapping of service_name -> network name. Typically set
24                  via parameter_defaults in the resource registry.  This
25                  mapping overrides those in ServiceNetMapDefaults.
26     type: json
27   DefaultPasswords:
28     default: {}
29     type: json
30   EndpointMap:
31     default: {}
32     description: Mapping of service endpoint -> protocol. Typically set
33                  via parameter_defaults in the resource registry.
34     type: json
35
36 resources:
37
38   ContainersCommon:
39     type: ./containers-common.yaml
40
41   NovaLibvirtBase:
42     type: ../../puppet/services/nova-libvirt.yaml
43     properties:
44       EndpointMap: {get_param: EndpointMap}
45       ServiceNetMap: {get_param: ServiceNetMap}
46       DefaultPasswords: {get_param: DefaultPasswords}
47
48 outputs:
49   role_data:
50     description: Role data for the Libvirt service.
51     value:
52       service_name: {get_attr: [NovaLibvirtBase, role_data, service_name]}
53       config_settings:
54         map_merge:
55           - get_attr: [NovaLibvirtBase, role_data, config_settings]
56           # FIXME: we need to disable migration for now as the
57           # hieradata is common for all services, and this means nova
58           # and nova_placement puppet runs also try to configure
59           # libvirt, and they fail. We can remove this override when
60           # we have hieradata separation between containers.
61           - tripleo::profile::base::nova::manage_migration: false
62       step_config: &step_config
63         get_attr: [NovaLibvirtBase, role_data, step_config]
64       puppet_config:
65         config_volume: nova_libvirt
66         puppet_tags: nova_config
67         step_config: *step_config
68         config_image:
69           list_join:
70           - '/'
71           - [ {get_param: DockerNamespace}, {get_param: DockerNovaConfigImage} ]
72       kolla_config:
73         /var/lib/kolla/config_files/nova-libvirt.json:
74           command: /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf
75       docker_config:
76         step_3:
77           nova_libvirt:
78             image:
79               list_join:
80               - '/'
81               - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
82             net: host
83             pid: host
84             privileged: true
85             restart: always
86             volumes:
87               yaql:
88                 expression: $.data.common.concat($.data.service)
89                 data:
90                   common: {get_attr: [ContainersCommon, volumes]}
91                   service:
92                     - /var/lib/kolla/config_files/nova-libvirt.json:/var/lib/kolla/config_files/config.json:ro
93                     - /var/lib/config-data/nova_libvirt/etc/libvirt/:/etc/libvirt/:ro
94                     - /lib/modules:/lib/modules:ro
95                     - /dev:/dev
96                     - /run:/run
97                     - /sys/fs/cgroup:/sys/fs/cgroup
98                     - /var/lib/nova:/var/lib/nova
99                     # Needed to use host's virtlogd
100                     - /var/run/libvirt:/var/run/libvirt
101                     - /var/lib/libvirt:/var/lib/libvirt
102                     - /etc/libvirt/qemu:/etc/libvirt/qemu
103             environment:
104               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
105       host_prep_tasks:
106         - name: create libvirt persistent data directories
107           file:
108             path: "{{ item }}"
109             state: directory
110           with_items:
111             - /etc/libvirt/qemu
112             - /var/lib/libvirt
113       upgrade_tasks:
114         - name: Stop and disable libvirtd service
115           tags: step2
116           service: name=libvirtd state=stopped enabled=no