Skip to content

Commit e557094

Browse files
authored
Merge pull request #24 from stackhpc/xena-dib-backports
Backport all overcloud DIB patches (Xena)
2 parents dccc454 + 2f16e80 commit e557094

File tree

9 files changed

+352
-32
lines changed

9 files changed

+352
-32
lines changed

ansible/group_vars/all/overcloud-dib

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
# is False. This will change in a future release.
1111
overcloud_dib_build_host_images: False
1212

13+
# List of overcloud host disk images to build. Each element is a dict defining
14+
# an image in a format accepted by the stackhpc.os-images role. Default is to
15+
# build an image named "deployment_image" configured with the overcloud_dib_*
16+
# variables defined below: {"name": "deployment_image", "elements": "{{
17+
# overcloud_dib_elements }}", "env": "{{ overcloud_dib_env_vars }}",
18+
# "packages": "{{ overcloud_dib_packages }}"}.
19+
overcloud_dib_host_images:
20+
- name: "deployment_image"
21+
elements: "{{ overcloud_dib_elements }}"
22+
env: "{{ overcloud_dib_env_vars }}"
23+
packages: "{{ overcloud_dib_packages }}"
24+
1325
# DIB base OS element. Default is {{ os_distribution }}.
1426
overcloud_dib_os_element: "{{ os_distribution }}"
1527

@@ -53,6 +65,20 @@ overcloud_dib_env_vars: "{{ overcloud_dib_env_vars_default | combine(overcloud_d
5365
# List of DIB packages to install. Default is to install no extra packages.
5466
overcloud_dib_packages: []
5567

68+
# List of default git repositories containing Diskimage Builder (DIB) elements.
69+
# See stackhpc.os-images role for usage. Default is empty.
70+
overcloud_dib_git_elements_default: []
71+
72+
# List of additional git repositories containing Diskimage Builder (DIB)
73+
# elements. See stackhpc.os-images role for usage. Default is empty.
74+
overcloud_dib_git_elements_extra: []
75+
76+
# List of git repositories containing Diskimage Builder (DIB) elements. See
77+
# stackhpc.os-images role for usage. Default is a combination of
78+
# overcloud_dib_git_elements_default and overcloud_dib_git_elements_extra.
79+
overcloud_dib_git_elements: >-
80+
{{ overcloud_dib_git_elements_default + overcloud_dib_git_elements_extra }}
81+
5682
# Upper constraints file for installing packages in the virtual environment
5783
# used for building overcloud host disk images. Default is {{
5884
# pip_upper_constraints_file }}.
Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
---
2-
# Build and install a overcloud host disk image for the seed host's ironic
2+
# Build and install overcloud host disk images for the seed host's ironic
33
# service.
44

5-
- name: Ensure overcloud host disk image is built and installed
5+
- name: Ensure overcloud host disk images are built and installed
66
hosts: seed
77
tags:
88
- overcloud-host-image-build
99
vars:
10-
overcloud_host_image_name: "deployment_image"
11-
overcloud_host_disk_images:
12-
- "{{ overcloud_host_image_name }}.qcow2"
1310
overcloud_host_image_force_rebuild: False
1411
tasks:
1512
- block:
16-
- name: Ensure overcloud host disk image is built
13+
- name: Validate overcloud host disk image configuration
14+
assert:
15+
that:
16+
- overcloud_dib_host_images is sequence
17+
- overcloud_dib_host_images | selectattr('name', 'undefined') | list | length == 0
18+
- overcloud_dib_host_images | selectattr('elements', 'undefined') | list | length == 0
19+
msg: "overcloud_dib_host_images set to invalid value"
20+
21+
- name: Ensure overcloud host disk images are built
1722
include_role:
1823
name: stackhpc.os-images
1924
vars:
@@ -22,30 +27,18 @@
2227
os_images_upper_constraints_file: "{{ overcloud_dib_upper_constraints_file }}"
2328
os_images_cache: "{{ image_cache_path }}"
2429
os_images_common: ""
25-
os_images_list:
26-
- name: "{{ overcloud_host_image_name }}"
27-
elements: "{{ overcloud_dib_elements }}"
28-
env: "{{ overcloud_dib_env_vars }}"
29-
packages: "{{ overcloud_dib_packages }}"
30-
type: qcow2
30+
os_images_list: "{{ overcloud_dib_host_images }}"
31+
os_images_git_elements: "{{ overcloud_dib_git_elements }}"
3132
os_images_upload: False
3233
os_images_force_rebuild: "{{ overcloud_host_image_force_rebuild }}"
3334

34-
- name: Ensure overcloud host disk image is copied onto seed
35+
- name: Copy overcloud host disk images into /httpboot
3536
copy:
36-
src: "{{ image_cache_path }}/{{ overcloud_host_image_name }}/{{ item }}"
37-
dest: "/etc/kolla/bifrost/{{ item }}"
37+
src: "{{ image_cache_path }}/{{ image.name }}/{{ image.name }}.{{ image.type | default('qcow2') }}"
38+
dest: "/var/lib/docker/volumes/bifrost_httpboot/_data/{{ image.name }}.{{ image.type | default('qcow2') }}"
3839
remote_src: True
39-
with_items: "{{ overcloud_host_disk_images }}"
40+
with_items: "{{ overcloud_dib_host_images }}"
41+
loop_control:
42+
loop_var: image
4043
become: True
41-
42-
- name: Copy overcloud host disk image into /httpboot
43-
command: >
44-
docker exec bifrost_deploy
45-
bash -c 'ansible -vvvv target
46-
-i /bifrost/playbooks/inventory/target
47-
-m copy
48-
-a "src=/etc/bifrost/{{ item }} dest=/httpboot/{{ item }}"
49-
-e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python"'
50-
with_items: "{{ overcloud_host_disk_images }}"
5144
when: overcloud_dib_build_host_images | bool

doc/source/configuration/reference/bifrost.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ For example, to install Bifrost from a custom git repository:
3939
Overcloud root disk image configuration
4040
=======================================
4141

42+
.. note::
43+
44+
This configuration only applies when ``overcloud_dib_build_host_images``
45+
(set in ``${KAYOBE_CONFIG_PATH}/overcloud-dib.yml``) is not changed to true.
46+
4247
Bifrost uses Diskimage builder (DIB) to build a root disk image that is
4348
deployed to overcloud hosts when they are provisioned. The following options
4449
configure how this image is built. Consult the
@@ -180,6 +185,8 @@ Rather than needing to write a custom DIB element, we can use the
180185
kolla_bifrost_dib_packages:
181186
- "biosdevname"
182187
188+
.. _configuration-bifrost-image-deployment-config:
189+
183190
Disk image deployment configuration
184191
===================================
185192

@@ -190,11 +197,10 @@ The name of the root disk image to deploy can be configured via the
190197
Kayobe inventory. This can be used to provision different images across the
191198
overcloud.
192199

193-
.. note::
194-
195-
Support for building multiple disk images is not yet available. Images can
196-
be manually renamed before changing the Kayobe configuration to build a
197-
different image.
200+
While only a single disk image can be built with Bifrost, starting from the
201+
Yoga 12.0.0 release, Kayobe supports building multiple disk images directly
202+
through Diskimage builder. Consult the :ref:`overcloud host disk image build
203+
documentation <overcloud-dib>` for more details.
198204

199205
Ironic configuration
200206
====================

doc/source/configuration/reference/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ options.
1818
kolla
1919
kolla-ansible
2020
bifrost
21+
overcloud-dib
2122
ironic-python-agent
2223
docker-registry
2324
seed-custom-containers

doc/source/configuration/reference/os-distribution.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _os-distribution:
2+
13
===============
24
OS Distribution
35
===============

0 commit comments

Comments
 (0)