← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1221985] Re: passing files to inject into compute node failes

 

In summary this is libguestfs specific and hits when the instance has an empty /etc/fstab
Workarounds are to populate /etc/fstab appropriately in the guest,
set libvirt_inject_partition=1 (albeit that would impact all guests)
or update libguestfs to try unpartitioned, or partition 1 in this case

Hence closing this for nova

** Changed in: nova
       Status: In Progress => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1221985

Title:
  passing files to inject into compute node failes

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  through the nova API - while trying to inject a file into a VM, the
  nova compute throws the following ERROR:

  2013-09-04 18:00:20.942 ERROR nova.virt.libvirt.driver [req-f39fd530-764c-4601-9954-dbdb2d4c6e8b 973093ddd3db4b7a8dcaf670b32b7b41 616e857a78f24206ad13b4e84652c997] [instance: e562b310-d5db-4833-992a-3647a4808bb2] Error injecting data into image 9924e399-d53f-495f-a640-ad5c1734fe8e (Error mounting /var/lib/nova/instances/e562b310-d5db-4833-992a-3647a4808bb2/disk with libguestfs (could not parse /etc/fstab or empty file))
  2013-09-04 18:00:20.943 ERROR nova.compute.manager [req-f39fd530-764c-4601-9954-dbdb2d4c6e8b 973093ddd3db4b7a8dcaf670b32b7b41 616e857a78f24206ad13b4e84652c997] [instance: e562b310-d5db-4833-992a-3647a4808bb2] Instance failed to spawn
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2] Traceback (most recent call last):
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1121, in _spawn
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     block_device_info)
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 1531, in spawn
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     admin_pass=admin_password)
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 1930, in _create_image
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     instance=instance)
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     self.gen.next()
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 1925, in _create_image
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     mandatory=('files',))
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib/python2.6/site-packages/nova/virt/disk/api.py", line 294, in inject_data
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     fs.setup()
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]   File "/usr/lib/python2.6/site-packages/nova/virt/disk/vfs/guestfs.py", line 117, in setup
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]     {'imgfile': self.imgfile, 'e': e})
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2] NovaException: Error mounting /var/lib/nova/instances/e562b310-d5db-4833-992a-3647a4808bb2/disk with libguestfs (could not parse /etc/fstab or empty file)
  2013-09-04 18:00:20.943 3634 TRACE nova.compute.manager [instance: e562b310-d5db-4833-992a-3647a4808bb2]
  2013-09-04 18:00:25.238 3634 ERROR nova.virt.libvirt.driver [-] [instance: e562b310-d5db-4833-992a-3647a4808bb2] During wait destroy, instance disappeared.

  
  ----

  I noticed in /usr/lib/python2.6/site-packages/nova/virt/disk/api.py at
  line 300, the code raises an exception/error if there are any files to
  inject:

  296 :       # If a mandatory item is passed to this function,
  297:        # then reraise the exception to indicate the error.
  298:        for inject in mandatory:
  299:            inject_val = locals()[inject]
  300:            if inject_val:
  301:                raise
  302:        LOG.warn(_('Ignoring error injecting data into image '
  303:                   '(%(e)s)') % locals())
  304:        return False

  
  I believe line 300 should be:
  300:            if not inject_val:

  where it should only raise an exception/error only if the inject_val
  is nil

  Please verify.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1221985/+subscriptions