ssh key injection fails for instances booted from remote volumes

Bug #1190583 reported by Giulio Fidente
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Yaguang Tang

Bug Description

ssh key injection expects the instance's disk image to be available locally and fails if the instance is booted from a remote cinder volume

compute.log reports something like the following:

WARNING nova.virt.disk.api [req-bd4be1ec-1d62-4da3-a194-b82003553709 8165f2c0a4d945a3ad61cdfc82bc71e8 6a89483177bd4301bba60d6ebd095e52] Ignoring error injecting data into image (Error mounting /var/lib/nova/instances/c8964c15-47b6-459e-8731-bd06d05be1f1/disk with libguestfs (/var/lib/nova/instances/c8964c15-47b6-459e-8731-bd06d05be1f1/disk: No such file or directory))

Yaguang Tang (heut2008)
Changed in nova:
assignee: nobody → Yaguang Tang (heut2008)
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/33221

Changed in nova:
status: New → In Progress
Revision history for this message
Lingxian Kong (kong) wrote :

Key, metadata, password, files ... do not support injection When using cinder backend system volume, is it the expected bahavior? Or, is there some reason that we do not know, but has been talked about before.

Revision history for this message
wingwj (wingwj) wrote :

Hi Yaguang Tang, do you continue modifying this issue? I met the same problem right now.

Revision history for this message
Yaguang Tang (heut2008) wrote :

wingwj, I'll pick it up again and try to fix.

Revision history for this message
Ray Chen (chenrano2002) wrote :

in current code virt/libvirt/driver.py:_inject_data

there is one function ' injection_image.check_image_exists' to help check whether disk image is there.
if not, just print warn and do NOT handle file injection.

2511 if any((key, net, metadata, admin_pass, files)):
2512 injection_image = self.image_backend.image(
2513 instance,
2514 'disk' + suffix,
2515 image_type)
2516 img_id = instance['image_ref']
2517
2518 try:
2519 if injection_image.check_image_exists():
2520 disk.inject_data(injection_image.path,
2521 key, net, metadata, admin_pass, files,
2522 partition=target_partition,
2523 use_cow=CONF.use_cow_images,
2524 mandatory=('files',))
2525 else:
2526 LOG.warn(_LW('Image %s not found on disk storage. '
2527 'Continue without injecting data'),
2528 injection_image.path, instance=instance)
2529 except Exception as e:
2530 with excutils.save_and_reraise_exception():
2531 LOG.error(_LE('Error injecting data into image '
2532 '%(img_id)s (%(e)s)'),
2533 {'img_id': img_id, 'e': e},
2534 instance=instance)

reference: http://openstack.10931.n7.nabble.com/nova-libvirt-Should-file-injection-work-for-boot-from-volume-images-td19568.html

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.