Not checking image format produces lots of useless messages

Bug #1257405 reported by Stanislaw Pitucha
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned

Bug Description

The code for resizing partitionless images goes with the "tell, don't ask" idea and attempts to run extfs / mount utilities on an image even though they may fail. This produces lots of useless messages during the instance preparation, like these:

2013-11-21 06:45:07 20902 DEBUG nova.virt.disk.mount.api [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Failed to mount filesystem: Unexpected error while running command.
Command: sudo nova-rootwrap /etc/nova/rootwrap.conf mount /dev/nbd8 /tmp/openstack-vfs-localfsSz6ylg
Exit code: 32
Stdout: ''
Stderr: 'mount: you must specify the filesystem type\n' mnt_dev /usr/lib/python2.7/dist-packages/nova/virt/disk/mount/api.py:198
2013-11-21 06:45:07 20902 DEBUG nova.virt.disk.mount.api [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Fail to mount, tearing back down do_mount /usr/lib/python2.7/dist-packages/nova/virt/disk/mount/api.py:219
2013-11-21 06:45:07 20902 DEBUG nova.virt.disk.mount.api [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Unmap dev /dev/nbd8 unmap_dev /usr/lib/python2.7/dist-packages/nova/virt/disk/mount/api.py:184
2013-11-21 06:45:07 20902 DEBUG nova.virt.disk.mount.nbd [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Release nbd device /dev/nbd8 unget_dev /usr/lib/python2.7/dist-packages/nova/virt/disk/mount/nbd.py:128
2013-11-21 06:45:07 20902 DEBUG nova.openstack.common.processutils [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Running cmd (subprocess): sudo nova-rootwrap /etc/nova/rootwrap.conf qemu-nbd -d /dev/nbd8 execute /usr/lib/python2.7/dist-packages/nova/openstack/common/processutils.py:147
2013-11-21 06:45:07 20902 DEBUG nova.virt.disk.vfs.localfs [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Failed to mount image Failed to mount filesystem: Unexpected error while running command.
Command: sudo nova-rootwrap /etc/nova/rootwrap.conf mount /dev/nbd8 /tmp/openstack-vfs-localfsSz6ylg
Exit code: 32
Stdout: ''
Stderr: 'mount: you must specify the filesystem type\n') setup /usr/lib/python2.7/dist-packages/nova/virt/disk/vfs/localfs.py:83
2013-11-21 06:45:07 20902 DEBUG nova.virt.disk.api [req-939d5d50-25ea-4f7a-8882-a880b9671e47 10873781609182 10816527907643] Unable to mount image /var/lib/nova/instances/5159cff0-91f6-4521-a0be-d74ce4f81fad/disk with error Failed to mount filesystem: Unexpected error while running command.
Command: sudo nova-rootwrap /etc/nova/rootwrap.conf mount /dev/nbd8 /tmp/openstack-vfs-localfsSz6ylg
Exit code: 32
Stdout: ''
Stderr: 'mount: you must specify the filesystem type\n'. Cannot resize. is_image_partitionless /usr/lib/python2.7/dist-packages/nova/virt/disk/api.py:191

This could be fixed by doing a simple check on the the image itself to pick up the magic signature. This would allow to skip e2resize on non-extfs files and simple mounting on partitioned images without the error messages.

Joe Gordon (jogo)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
liuh101410@qq.com (liuh101410) wrote :

I had the same error, when I make snapshot of a running instance.

 Failed to mount filesystem: Unexpected error while running command.
Command: sudo nova-rootwrap /etc/nova/rootwrap.conf mount /dev/nbd14 /tmp/openstack-vfs-localfs4ZzQmW
Exit code: 32
Stdout: ''
Stderr: 'mount: you must specify the filesystem type\n' mnt_dev /usr/lib/python2.7/dist-packages/nova/virt/disk/mount/api.py:198

When I fix the error:
 error: unable to execute QEMU command 'drive-mirror': Could not open '/var/lib/nova/instances/snapshots/tmpNtVLgi/25c19f3475ae4fec8f0dd3bb36dda2e4.delta'

I added the following line to /etc/apparmor/abstractions/libvirt-qemu
/var/lib/nova/instances/snapshots/*/*.delta rw,

And then, the first error happened.
I think this problem may caused by apparmor. Because when I removed it , I can make snapshot of a running instance successfully. But when I used NFS as shared storage, apparmor must be used.

Revision history for this message
liuh101410@qq.com (liuh101410) wrote :

sorry, the path is /etc/apparmor.d/abstractions/libvirt-qemu

Revision history for this message
jichenjc (jichenjc) wrote :

I did see the function is_image_partitionless has check logic

if it's qcow2, it will try to mount the device through qemu-nbd which can't use e2label
if it's a raw, it will try to e2label to check whether it's a ext disk or not

Changed in nova:
assignee: nobody → jichencom (jichenjc)
Revision history for this message
jichenjc (jichenjc) wrote :

so I will not change the code logic, instead, will add a silent flag to ignore debug error info in
disk/api.py is_image_partitionless function for
fs.setup()
fs.teardown()
function

Revision history for this message
jichenjc (jichenjc) wrote :

did see a review
https://review.openstack.org/#/c/64383/
don't know whether it's related to this

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/69896

Changed in nova:
status: Triaged → In Progress
Revision history for this message
jichenjc (jichenjc) wrote :

according to review comments
https://review.openstack.org/#/c/69896/

we might keep the log info since it will have lot of useful info

Changed in nova:
assignee: jichencom (jichenjc) → nobody
Tracy Jones (tjones-i)
Changed in nova:
status: In Progress → Triaged
Revision history for this message
Carmelo Ragusa (carmelo-ragusa) wrote :

has this been abandoned? I'm suddenly getting this error and this is the only place where there was some discussion. I thought it was fixed but I checked the review comments above and doens't seem fixed to me. Any idea?

Sean Dague (sdague)
Changed in nova:
status: Triaged → Invalid
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.