diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 674438daf..16ebee59d 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -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 of the image, the url where to get it, and the image type (qcow2, tar). As a reference, please look at the `config `_ + +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. diff --git a/roles/libvirt/setup/undercloud/defaults/main.yml b/roles/libvirt/setup/undercloud/defaults/main.yml index c729077ee..444cb7b5d 100644 --- a/roles/libvirt/setup/undercloud/defaults/main.yml +++ b/roles/libvirt/setup/undercloud/defaults/main.yml @@ -1,3 +1,6 @@ # variable only used during gating (when compressed_gating_repo is defined) 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" diff --git a/roles/libvirt/setup/undercloud/tasks/main.yml b/roles/libvirt/setup/undercloud/tasks/main.yml index 978e30afd..6b35c9303 100644 --- a/roles/libvirt/setup/undercloud/tasks/main.yml +++ b/roles/libvirt/setup/undercloud/tasks/main.yml @@ -234,6 +234,7 @@ '{{ working_dir }}' environment: 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 # template to use the external kernel and initrd. We should diff --git a/roles/libvirt/setup/undercloud/templates/undercloudvm.xml.j2 b/roles/libvirt/setup/undercloud/templates/undercloudvm.xml.j2 index 805ce84fd..e67c31b9e 100644 --- a/roles/libvirt/setup/undercloud/templates/undercloudvm.xml.j2 +++ b/roles/libvirt/setup/undercloud/templates/undercloudvm.xml.j2 @@ -6,9 +6,9 @@ hvm -{% if overcloud_as_undercloud|bool %} - {{ working_dir }}/overcloud-full.vmlinuz - {{ working_dir }}/overcloud-full.initrd +{% if overcloud_as_undercloud|bool or undercloud_use_custom_boot_images|bool %} + {{ undercloud_custom_vmlinuz }} + {{ undercloud_custom_initrd }} console=ttyS0 root=/dev/vda {% endif %}