Skip to contentSkip to conversation

grub PVHv2 booting patch series - no block devices available in guest

DISCUSSION Andy Smith 2 participants 3 messages Jan 23, 2018

lore
Share & tools
lore

Andy Smith

author
#0 lore raw

Hi Juergen,

I am trying out your grub PVHv2 guest support patch series as found at <https://lists.gnu.org/archive/html/grub-devel/2017-11/msg00054.html>

I have a Xen 4.10.0 host on which I've cloned
https://git.savannah.gnu.org/git/grub.git and applied your patch series.

When the guest is booted as type = "pvh" and using the generated pvh grub image as kernel, it does boot grub which does successfully find /boot/grub/grub.cfg within the guest. The selected kernel and initramfs are read and it does boot that but there do not appear to be any block devices so it ultimately fails to find root filesystem.

Doing PVHv2 direct kernel boot does seem to boot normally.

It also works under PV with pvgrub image or direct kernel boot.

Here is guest config file which results in a boot with no block devices:

name       = "debtest1"
type       = "pvh"
memory     = 2048
vcpus      = 2
vif        = [ "mac=00:16:5e:00:02:39, ip=192.168.82.225, vifname=v-debtest1" ]
kernel     = "/opt/grub/lib/pvhgrub.bin"
disk       = [ "phy:/dev/vg0/domu_debtest1_xvda,xvda,w",
               "phy:/dev/vg0/domu_debtest1_xvdb,xvdb,w" ]

It ends up dumped at busybox prompt since there is no root filesystem. cat /proc/partitions at that time shows no block devices at all.

Here is guest config file which boots okay as PVHv2 guest:

name       = "debtest1"
type       = "pvh"
memory     = 2048
vcpus      = 2
vif        = [ "mac=00:16:5e:00:02:39, ip=192.168.82.225, vifname=v-debtest1" ]
# kernel and initramfs manually extracted from out of guest
kernel     = "/var/tmp/vmlinuz-4.13.0-31-generic"
ramdisk    = "/var/tmp/initrd.img-4.13.0-31-generic"
cmdline    = "root=/dev/xvda1 ro console=hvc0"
disk       = [ "phy:/dev/vg0/domu_debtest1_xvda,xvda,w",
               "phy:/dev/vg0/domu_debtest1_xvdb,xvdb,w" ]

And previous situation of being booted as PV guest also is fine:

name       = "debtest1"
memory     = 2048
vcpus      = 2
vif        = [ "mac=00:16:5e:00:02:39, ip=192.168.82.225, vifname=v-debtest1" ]
kernel     = "/opt/grub/lib/grub-x86_64-xen.bin"
disk       = [ "phy:/dev/vg0/domu_debtest1_xvda,xvda,w",
               "phy:/dev/vg0/domu_debtest1_xvdb,xvdb,w" ]

Build process for my /opt/grub/lib/pvhgrub.bin:

./autogen.sh && \
sudo tar -C /opt/grub/share/memdisk -cvf /opt/grub/share/memdisk.tar grub.cfg && \
./configure --prefix=/opt/grub --with-platform=xenpvh && \
make && \
sudo make install && \

sudo /opt/grub/bin/grub-mkimage \
    -O i386-xenpvh \
    -c /opt/grub/etc/grub-bootstrap.cfg \
    -m /opt/grub/share/memdisk.tar \
    -o /opt/grub/lib/pvhgrub.bin \
    -p /boot/grub \
    -v /opt/grub/lib/grub/i386-xenpvh/*.mod

/opt/grub/share/memdisk/grub.cfg just looks for /boot/grub/grub.cfg in guest and uses that. This part is working as it does display the menu, allow selection of the boot entry and then boots it.

Any ideas what is wrong there?

Thanks,
Andy

#1 lore raw
Quoted 9 lines · Andy Smith

Hi Juergen,

I am trying out your grub PVHv2 guest support patch series as found at <https://lists.gnu.org/archive/html/grub-devel/2017-11/msg00054.html>

I have a Xen 4.10.0 host on which I've cloned
https://git.savannah.gnu.org/git/grub.git and applied your patch series.

Quoted 5 lines

When the guest is booted as type = "pvh" and using the generated pvh grub image as kernel, it does boot grub which does successfully find /boot/grub/grub.cfg within the guest. The selected kernel and initramfs are read and it does boot that but there do not appear to be any block devices so it ultimately fails to find root filesystem.

You will need some more Linux kernel patches:

https://lists.xen.org/archives/html/xen-devel/2017-11/msg01681.html

Juergen

author
#2 lore raw

Hi Juergen,

Thanks for replying so quickly!

Quoted 8 lines · Juergen Gross
Quoted 3 lines · Andy Smith

The selected kernel and initramfs are read and it does boot that but there do not appear to be any block devices so it ultimately fails to find root filesystem.

You will need some more Linux kernel patches:

https://lists.xen.org/archives/html/xen-devel/2017-11/msg01681.html

Ah, that is a shame. I was investigating this now because I thought with PVHv2 support available since 4.11 there was a good chance that a modern guest distribution release (in this specific case "debtest1" was in fact Ubuntu 16.04 LTS with HWE 4.13 kernel) would be usable without additional guest modifications.

I see now that at the moment this really only means usable by directly supplying kernel and initramfs, which is not going to work for my users who like to choose between several distributions and control their own kernels.

I will evaluate again when/if these patches become available in distribution packaged kernels.

Thanks,
Andy