Web lists-archives.com

Re: How to Troubleshoot Xen VM Failure 1stpvguest




Hi Ray,

On Fri, Aug 11, 2017 at 06:52:21PM -0700, ray wrote:
> on Debian 9 with latest Xen on a laptop, I tried to build a pv guest.  I would like to understand how to determine what the failure was.
> 
> *** This is how the image was created:
> # xen-create-image --hostname=1stpvguest  --vcpus=2 --dhcp --pygrub --dist stretch
> # xl create /etc/xen/1stpvguest.cfg

Use "xl create -c /etc/xen/1stpvguest.cfg" to immediately open the
console and watch it boot.

> Parsing config from /etc/xen/1stpvguest.cfg
> libxl: error: libxl_bootloader.c:635:bootloader_finished: bootloader failed - consult logfile /var/log/xen/bootloader.1.log

Bootloader (pygrub) failed to provide you with a kernel/initramfs
that was bootable by Xen.

> # cat bootloader.1.log

[…]

> [Errno 2] No such file or directory
> Error opening /boot/initrd.img- in guest

Seems like pygrub decided that the selected (by default timeout)
entry's initramfs was "/boot/initrd.img-" and then it couldn't open
that file from inside the guest's filesystem.

It would be worth examining your /boot/grub/grub.cfg file to see if
the initramfs is really listed as "/boot/initrd.img-". If it isn't
then pygrub is confused by your grub config. If it is then your grub
config looks broken.

You can also run pygrub standalone to see what it makes of your guest's
filesystem. Example:

$ sudo /usr/lib/xen-4.8/bin/pygrub -l /dev/vg/debtest1_xvda
Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
WARNING:root:grub2's saved_entry/next_entry not supported
WARNING:root:Unknown directive else
WARNING:root:Unknown directive menuentry_id_option
WARNING:root:Unknown directive else
WARNING:root:Unknown directive menuentry_id_option
WARNING:root:Unknown directive export
WARNING:root:Unknown directive font
WARNING:root:Unknown directive else
WARNING:root:Unknown directive else
WARNING:root:Unknown directive font
WARNING:root:Unknown directive load_video
WARNING:root:Unknown directive terminal_output
WARNING:root:Unknown directive else
WARNING:root:Unknown directive else
WARNING:root:Unknown directive export
WARNING:root:Unknown image directive load_video
WARNING:root:Unknown image directive if
WARNING:root:Unknown image directive if
WARNING:root:Unknown image directive else
WARNING:root:Unknown image directive fi
WARNING:root:Unknown image directive load_video
WARNING:root:Unknown image directive if
WARNING:root:Unknown image directive if
WARNING:root:Unknown image directive else
WARNING:root:Unknown image directive fi
WARNING:root:Unknown image directive load_video
WARNING:root:Unknown image directive if
WARNING:root:Unknown image directive if
WARNING:root:Unknown image directive else
WARNING:root:Unknown image directive fi
WARNING:root:Unknown directive source
WARNING:root:Unknown directive elif
WARNING:root:Unknown directive source
title: Debian GNU/Linux
  root: None
  kernel: /boot/vmlinuz-4.12.0-trunk-amd64
  args: root=UUID=d924a9db-5223-4e42-8e79-7006daf90eda ro console=hvc0
  initrd: /boot/initrd.img-4.12.0-trunk-amd64
title: Debian GNU/Linux, with Linux 4.12.0-trunk-amd64
  root: None
  kernel: /boot/vmlinuz-4.12.0-trunk-amd64
  args: root=UUID=d924a9db-5223-4e42-8e79-7006daf90eda ro console=hvc0
  initrd: /boot/initrd.img-4.12.0-trunk-amd64
title: Debian GNU/Linux, with Linux 4.12.0-trunk-amd64 (recovery mode)
  root: None
  kernel: /boot/vmlinuz-4.12.0-trunk-amd64
  args: root=UUID=d924a9db-5223-4e42-8e79-7006daf90eda ro single console=hvc0
  initrd: /boot/initrd.img-4.12.0-trunk-amd64

> *** The above did not display on the desktop.  So here is the grub file extract:
> GRUB_DEFAULT=0

[…]

This isn't a grub config, it's an /etc/default/grub file that is
used to generate a grub config, e.g. when you type "update-grub".
Assuming grub-pc package, the generated grub config will be at
/boot/grub/grub.cfg inside the guest's filesystem. Have a look at
that one.

> GRUB_TIMEOUT=3
> GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
> GRUB_CMDLINE_LINUX_DEFAULT="quiet"
> GRUB_CMDLINE_LINUX=""
> GRUB_CMDLINE_XEN="dom0_mem=1024M,max:1024M"

This looks like it might be the /etc/default/grub file from your
dom0, so doubly irrelevant when debugging guest booting issues.

> Should a console have come up?

You will only be attached to the console of a Xen guest that you
just created, if you use "-c".

> How to I determine what the problem was?

The error message came from pygrub, so the problem is either with
pygrub or with the configuration pygrub is working with.

As an aside, pygrub is not a great way to boot Xen guests. I would
recommend looking into pvgrub2:

    https://wiki.xenproject.org/wiki/PvGrub2#Debian

Also the xen-user mailing list is a good place to ask support
questions, as there are probably more admins who use Xen there.

    https://lists.xenproject.org/mailman/listinfo/xen-users

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting