xenserver boot from iso broken

Bug #1154731 reported by Antony Messerli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
John Garbutt

Bug Description

Created a record in Glance for an iso using this format.

glance image-create --name=name_iso --disk_format=iso --container_format=bare < name_iso.iso

When booting that image, nova-compute errors at this point after bring the iso down:

2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] Traceback (most recent call last):
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] File "/opt/rackstack/1.61/nova/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/virt/xenapi/vmops.py", line 477, in spawn
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] kernel_file, ramdisk_file)
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] File "/opt/rackstack/1.61/nova/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/virt/xenapi/vmops.py", line 193, in inner
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] rv = f(*args, **kwargs)
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] File "/opt/rackstack/1.61/nova/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/virt/xenapi/vmops.py", line 395, in create_vm_record_step
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] vdis, disk_image_type, kernel_file, ramdisk_file)
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] File "/opt/rackstack/1.61/nova/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/virt/xenapi/vmops.py", line 546, in _create_vm_record
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] vdis['root']['ref'], disk_image_type, instance['os_type'])
2013-03-13 17:23:59 18434 TRACE nova.utils [instance: 573984f7-5263-41cb-bc4e-0a54bfad01bc] KeyError: 'root'

Tags: xenserver
Revision history for this message
Chris Behrens (cbehrens) wrote :

Try adding vm_mode=hvm to that image. The code that bombed is trying to determine pv or hvm from the 'disk'.

tags: added: xenserver
Revision history for this message
Chuck Short (zulcss) wrote :

Antony,

Did you try what Chris suggested?

chuck

Changed in nova:
status: New → Incomplete
Revision history for this message
Antony Messerli (antonym) wrote :

I did, I added vm_mode=hvm as a property and then launched a new instance and I ended up with a similar error but at a different location:

2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] Traceback (most recent call last):
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] File "/opt/rackstack/152.23/nova/lib/python2.6/site-packages/nova-2013.1.a4348.gde182d6-py2.6.egg/nova/virt/xenapi/vmops.py", line 492, in spawn
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] attach_disks_step(undo_mgr, vm_ref, vdis, disk_image_type)
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] File "/opt/rackstack/152.23/nova/lib/python2.6/site-packages/nova-2013.1.a4348.gde182d6-py2.6.egg/nova/virt/xenapi/vmops.py", line 200, in inner
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] rv = f(*args, **kwargs)
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] File "/opt/rackstack/152.23/nova/lib/python2.6/site-packages/nova-2013.1.a4348.gde182d6-py2.6.egg/nova/virt/xenapi/vmops.py", line 420, in attach_disks_step
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] injected_files)
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] File "/opt/rackstack/152.23/nova/lib/python2.6/site-packages/nova-2013.1.a4348.gde182d6-py2.6.egg/nova/virt/xenapi/vmops.py", line 587, in _attach_disks
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] cd_vdi = vdis.pop('root')
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862] KeyError: 'root'
2013-03-19 23:43:32.435 686 TRACE nova.utils [instance: 2448ef95-a2b9-4b14-82d8-380062513862]

Revision history for this message
John Garbutt (johngarbutt) wrote :

I would try replace vdis.pop('root') with 'iso'
(You can see ImageType in vm_utils for how this is all defined)

The next issue is vm_utils.fetch_blank_disk
It doesn't exist anymore, as far as I see.

vm_utils._generate_disk should do some of the hard work though.
just need to get root_gb from instance type I guess, for the size.

The above will not support boot from volume though.
You could check for a root, and if not pressent create a blank disk.

Maybe I will take a look at this, if I get chance...

Changed in nova:
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
John Garbutt (johngarbutt) wrote :

PS, the above issue is a bug too, Chris's suggestion is just a workaround.

Changed in nova:
assignee: nobody → John Garbutt (johngarbutt)
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/24895

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
John Garbutt (johngarbutt) wrote :

I got an ISO boot VM started, with the above hacks, but it seemed unable to boot from my CD image.

Changed in nova:
status: In Progress → Confirmed
Revision history for this message
John Garbutt (johngarbutt) wrote :

Started some basic docs to help other create an ISO SR:
https://wiki.openstack.org/wiki/XenServer/BootFromISO

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit b1445e7e84b720ac232541ef866fbe7a59faeaf8
Author: John Garbutt <email address hidden>
Date: Wed Mar 20 11:56:29 2013 +0000

    xenapi: fix support for iso boot

    Fixes bug 1154731 that stated the iso support was broken.

    There were several issues around a vdis list without a 'root' disk.

    Because the ISO boot was HVM, only 0-3 devices will work, so, the
    devices used have been re-ordered to ensure ISOs can be read
    by a HVM guest without PV tools. Once PV tools are present, a
    HVM guest will be able to access an ephemeral or swap disk.

    Change-Id: I4b57f70301a4256fa975323d7964fde19e8d4508

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 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.