Browse Source

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>
tags/2.1.0
Bogdan Dobrelya 2 years ago
parent
commit
fdb2d5f142

+ 8
- 0
doc/source/configuration.rst View File

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

+ 3
- 0
roles/libvirt/setup/undercloud/defaults/main.yml View File

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

+ 1
- 0
roles/libvirt/setup/undercloud/tasks/main.yml View File

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

+ 3
- 3
roles/libvirt/setup/undercloud/templates/undercloudvm.xml.j2 View File

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

Loading…
Cancel
Save