aboutsummaryrefslogtreecommitdiff
path: root/docker/nova/nova-libvirt/Dockerfile.j2
blob: 1d05dfcdafef324dbbb58a4aadfe879a7395ca07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}

{% block nova_libvirt_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}

    {% set nova_libvirt_packages = [
        'libvirt-daemon',
        'libguestfs',
        'qemu-kvm',
        'libvirt-daemon-driver-nwfilter',
        'libvirt-daemon-config-nwfilter',
        'libvirt-daemon-driver-lxc',
        'ceph-common'
    ] %}

{% elif base_distro == 'ubuntu' %}

    {% set nova_libvirt_packages = [
        'ceph-common',
        'libvirt-bin',
        'dmidecode',
        'pm-utils',
        'qemu',
        'qemu-block-extra',
        'ebtables',
        'xen-utils-4.6'
    ] %}

    {% set libvirt_group = 'libvirtd' %}

{% elif base_distro == 'debian' %}

    {% set nova_libvirt_packages = [
        'ceph-common',
        'libvirt-bin',
        'dmidecode',
        'pm-utils',
        'qemu',
        'qemu-block-extra',
        'ebtables',
        'xen-utils-4.4',
        'usermode'
    ] %}

    {% set libvirt_group = 'libvirt' %}

{% endif %}

{{ macros.install_packages(nova_libvirt_packages | customizable("packages")) }}

{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}

RUN usermod -a -G qemu nova

{% elif base_distro in ['ubuntu', 'debian'] %}

RUN mkdir -p /etc/ceph \
    && rm -f /etc/libvirt/qemu/networks/default.xml \
        /etc/libvirt/qemu/networks/autostart/default.xml \
    && usermod -a -G {{ libvirt_group }} nova

{% endif %}

COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start

{% block nova_libvirt_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}