Allow custom undercloud initrd/vmlinuz

Preserve default behavior, which is extract
those from the overcloud image.

The example use case is when running oooq from
a priv container. Like running in Centos container
on the Ubuntu virthost. The virt-copy-out may be
working fine on the host OS and failing within the
container with an error like:
"'/dev/urandom' is not a supported random source".
So those images may be prepared as well at the host
OS and reused as external ones.

Partial-bug: #1676373
Change-Id: I19db238b4966a59675e42983daccffe3c437019c
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2017-03-20 09:20:21 +01:00
parent 1415164248
commit fdb2d5f142
4 changed files with 15 additions and 3 deletions

View File

@ -77,3 +77,11 @@ Please note that you also need to define all the images you want to
fetch, using the ``images`` setting. You will need to define the name fetch, using the ``images`` setting. You will need to define the name
of the image, the url where to get it, and the image type (qcow2, tar). of the image, the url where to get it, and the image type (qcow2, tar).
As a reference, please look at the `config <http://git.openstack.org/cgit/openstack/tripleo-quickstart/tree/config/release/master-tripleo-ci.yml>`_ As a reference, please look at the `config <http://git.openstack.org/cgit/openstack/tripleo-quickstart/tree/config/release/master-tripleo-ci.yml>`_
Consuming external/custom vmlinuz and initrd for undercloud
-----------------------------------------------------------
By default, the kernel executable and initial rootfs for an undercloud VM
are extracted from the overcloud image. In order to switch to custom
``undercloud_custom_initrd`` and ``undercloud_custom_vmlinuz`` images,
set the ``undercloud_use_custom_boot_images`` to True.

View File

@ -1,3 +1,6 @@
# variable only used during gating (when compressed_gating_repo is defined) # variable only used during gating (when compressed_gating_repo is defined)
gating_repo_enabled: true gating_repo_enabled: true
undercloud_use_custom_boot_images: false
undercloud_custom_vmlinuz: "{{ working_dir }}/overcloud-full.vmlinuz"
undercloud_custom_initrd: "{{ working_dir }}/overcloud-full.initrd"

View File

@ -234,6 +234,7 @@
'{{ working_dir }}' '{{ working_dir }}'
environment: environment:
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}" LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
when: not undercloud_use_custom_boot_images|bool
# NOTE(trown): This is a bit of a hack to get the undercloud vm # NOTE(trown): This is a bit of a hack to get the undercloud vm
# template to use the external kernel and initrd. We should # template to use the external kernel and initrd. We should

View File

@ -6,9 +6,9 @@
<type arch='{{ libvirt_arch }}'>hvm</type> <type arch='{{ libvirt_arch }}'>hvm</type>
<boot dev='hd'/> <boot dev='hd'/>
<bootmenu enable='no'/> <bootmenu enable='no'/>
{% if overcloud_as_undercloud|bool %} {% if overcloud_as_undercloud|bool or undercloud_use_custom_boot_images|bool %}
<kernel>{{ working_dir }}/overcloud-full.vmlinuz</kernel> <kernel>{{ undercloud_custom_vmlinuz }}</kernel>
<initrd>{{ working_dir }}/overcloud-full.initrd</initrd> <initrd>{{ undercloud_custom_initrd }}</initrd>
<cmdline>console=ttyS0 root=/dev/vda</cmdline> <cmdline>console=ttyS0 root=/dev/vda</cmdline>
{% endif %} {% endif %}
</os> </os>