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