xenapi: pygrub running in domU

Bug #1196570 reported by Mate Lakat
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Mate Lakat

Bug Description

While I was playing with boot from volume, I discovered that I end up with a:

PV instance if --image-id specified
HVM instance if --image-id is NOT specified

That should be an issue caused by not having the proper metadata without --image-id switch. But, as part of the investigation, interesting log entries appeared in cpu log:

DEBUG nova.virt.xenapi.vm_utils [req-67592d22-4561-4a81-8868-8ac6895efa9d admin demo] Looking up vdi OpaqueRef:055...
WARNING nova.virt.xenapi.vm_utils [req-67592d22-4561-4a81-8868-8ac6895efa9d admin demo] Image format is None: trying to determine PV status using pygrub; if instance with vdi OpaqueRef:05503c3e-f1c2-e789-ac3b-38b616
6c59aa does not boot correctly, try with image metadata.
DEBUG nova.virt.xenapi.vm_utils [req-67592d22-4561-4a81-8868-8ac6895efa9d admin demo] Running pygrub against xvdc
DEBUG nova.openstack.common.processutils [req-67592d22-4561-4a81-8868-8ac6895efa9d admin demo] Running cmd (subprocess): sudo nova-rootwrap /etc/nova/rootwrap.conf pygrub -qn /dev/xvdc

Error while executing pygrub! Please, ensure the binary is installed correctly, and available in your PATH; on some Linux distros, pygrub may be installed in /usr/lib/xen-X.Y/bin/pygrub. Attempting to boot in HVM mode.
TRACE nova.virt.xenapi.vm_utils Traceback (most recent call last):
TRACE nova.virt.xenapi.vm_utils File "/opt/stack/nova/nova/virt/xenapi/vm_utils.py", line 2039, in _is_vdi_pv
TRACE nova.virt.xenapi.vm_utils out, err = utils.execute('pygrub', '-qn', dev_path, run_as_root=True)
TRACE nova.virt.xenapi.vm_utils File "/opt/stack/nova/nova/utils.py", line 162, in execute
TRACE nova.virt.xenapi.vm_utils return processutils.execute(*cmd, **kwargs)
TRACE nova.virt.xenapi.vm_utils File "/opt/stack/nova/nova/openstack/common/processutils.py", line 173, in execute
TRACE nova.virt.xenapi.vm_utils cmd=' '.join(cmd))
TRACE nova.virt.xenapi.vm_utils ProcessExecutionError: Unexpected error while running command.
TRACE nova.virt.xenapi.vm_utils Command: sudo nova-rootwrap /etc/nova/rootwrap.conf pygrub -qn /dev/xvdc
TRACE nova.virt.xenapi.vm_utils Exit code: 96
TRACE nova.virt.xenapi.vm_utils Stdout: '/usr/local/bin/nova-rootwrap: Executable not found: pygrub (filter match = pygrub)\n'
TRACE nova.virt.xenapi.vm_utils Stderr: ''
TRACE nova.virt.xenapi.vm_utils

This error says, you need to have pygrub in domU. I think, we should really be calling down to dom0, and asking those tools to detect if the machine is PV bootable or not.

Tags: xenserver
Mate Lakat (mate-lakat)
tags: added: xenserver
description: updated
Revision history for this message
Mate Lakat (mate-lakat) wrote :

xen-utils package contains pygrub, although:

- it is not added to the path, it's only available at:
/usr/lib/xen-4.1/bin/pygrub

- it could be out-of sync with the hypervisor's revision

Revision history for this message
Mate Lakat (mate-lakat) wrote :

sudo RUNLEVEL=1 apt-get install xen-utils

Changed in nova:
importance: Undecided → Medium
importance: Medium → Low
status: New → Triaged
Revision history for this message
Mate Lakat (mate-lakat) wrote :

@John - could you check if pygrub is installed in domU at rackspace?

Mate Lakat (mate-lakat)
Changed in nova:
assignee: nobody → Mate Lakat (mate-lakat)
Revision history for this message
Mate Lakat (mate-lakat) wrote :

to install just pygrub with an Ubuntu installation (without installing xen)

apt-get download xen-utils-4.1
sudo dpkg -i --force-depends xen-utils-4.1_4.1.2-2ubuntu2.10_amd64.deb
sudo ln -s /usr/lib/xen-4.1/bin/pygrub /bin/

So you won't get this error

Mate Lakat (mate-lakat)
Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/36523

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/36523
Committed: http://github.com/openstack/nova/commit/e3ef5214c664e44c125fd80a25418141146ff381
Submitter: Jenkins
Branch: master

commit e3ef5214c664e44c125fd80a25418141146ff381
Author: Mate Lakat <email address hidden>
Date: Wed Jul 10 18:51:17 2013 +0100

    xenapi: remove pv detection

    It was assumed that pygrub is there in domU, so that the RAW and unknown
    disks were attached to domU and investigated with pygrub to find out if
    PV could be used. This patch removes this functionality. Also some
    cleanup is made around the ImageType mess.

    From now RAW and unknown disks will not be investigated for PV-ness and
    will boot as HVM.

    Fixes bug 1196570

    Change-Id: If84b93cee36938257b7ad0fa44b3b22878520506

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.