From 4d5ce341164d200dce09b1a2ea4d2b8890d555b2 Mon Sep 17 00:00:00 2001 From: Andrey Shestakov Date: Tue, 27 Sep 2016 18:25:50 +0300 Subject: [PATCH] Add nova-compute-ironic nova-compute-ironic service is same as nova-compute, but with the special compute_driver and few config options required for Ironic. While Ironic has poor integration with Nova, this service cannot be run with regular nova-compute service on same host. Change-Id: I5b6975f2b0fc5fb4002f8ecfc530c4c69ef53e43 --- docker/nova-compute-ironic/Dockerfile.j2 | 8 +++++++ service/files/nova-ironic.conf.j2 | 19 ++++++++++++++++ service/files/nova.conf.j2 | 3 +++ service/nova-compute-ironic.yaml | 29 ++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 docker/nova-compute-ironic/Dockerfile.j2 create mode 100644 service/files/nova-ironic.conf.j2 create mode 100644 service/nova-compute-ironic.yaml diff --git a/docker/nova-compute-ironic/Dockerfile.j2 b/docker/nova-compute-ironic/Dockerfile.j2 new file mode 100644 index 0000000..e4a2f54 --- /dev/null +++ b/docker/nova-compute-ironic/Dockerfile.j2 @@ -0,0 +1,8 @@ +FROM {{ image_spec("nova-base") }} +MAINTAINER {{ maintainer }} + +RUN apt-get -y install --no-install-recommends \ + genisoimage \ + && apt-get clean + +USER nova diff --git a/service/files/nova-ironic.conf.j2 b/service/files/nova-ironic.conf.j2 new file mode 100644 index 0000000..c717893 --- /dev/null +++ b/service/files/nova-ironic.conf.j2 @@ -0,0 +1,19 @@ +# nova-ironic.conf +[DEFAULT] +host = {{ node_name }} +compute_driver = ironic.IronicDriver +ram_allocation_ratio=1.0 +reserved_host_memory_mb=0 +# ironic is not working with vfat +config_drive_format = iso9660 + +[ironic] +api_endpoint = {{ address('ironic-api', ironic.api_port, with_scheme=True) }}/v1 +auth_url = {{ address('keystone', keystone.admin_port, with_scheme=True) }} +auth_strategy = keystone +auth_plugin = password +project_domain_name = default +user_domain_id = default +project_name = service +username = {{ ironic.username }} +password = {{ ironic.password }} diff --git a/service/files/nova.conf.j2 b/service/files/nova.conf.j2 index 5f0982e..3f0467c 100644 --- a/service/files/nova.conf.j2 +++ b/service/files/nova.conf.j2 @@ -26,6 +26,9 @@ allow_resize_to_same_host = true compute_driver = libvirt.LibvirtDriver +# ironic requires different host manager, this not affects regular instances +scheduler_host_manager = ironic_host_manager + force_config_drive = True # vfat format doesn't require sending config drive over scp (like in case # of default iso format) diff --git a/service/nova-compute-ironic.yaml b/service/nova-compute-ironic.yaml new file mode 100644 index 0000000..c7c6a44 --- /dev/null +++ b/service/nova-compute-ironic.yaml @@ -0,0 +1,29 @@ +dsl_version: 0.1.0 +service: + name: nova-compute-ironic + kind: DaemonSet + containers: + - name: nova-compute-ironic + image: nova-compute-ironic + probes: + readiness: "true" + liveness: + command: "true" + type: "exec" + daemon: + command: nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/nova-ironic.conf + files: + - nova.conf + - nova-ironic.conf + dependencies: + - nova-db-migrations + - ironic-user-create +files: + nova.conf: + path: /etc/nova/nova.conf + content: nova.conf.j2 + perm: "0600" + nova-ironic.conf: + path: /etc/nova/nova-ironic.conf + content: nova-ironic.conf.j2 + perm: "0600"