Bug 1415250 - QEMU image file locking (RHOS)
Summary: QEMU image file locking (RHOS)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Upstream M1
: 13.0 (Queens)
Assignee: Lee Yarwood
QA Contact: Archit Modi
URL:
Whiteboard:
Depends On: 1378241 1378242 1415252 1417306 1432523
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-20 16:37 UTC by Ademar Reis
Modified: 2019-09-09 17:01 UTC (History)
30 users (show)

Fixed In Version: openstack-nova-17.0.0-0.20180123163703.27eadbc.el7ost
Doc Type: Enhancement
Doc Text:
Clone Of: 1378242
Environment:
Last Closed: 2018-06-27 13:29:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1718295 0 None None None 2017-09-21 13:17:12 UTC
OpenStack gerrit 505673 0 None MERGED Support qemu >= 2.10 2020-07-31 02:01:02 UTC
Red Hat Product Errata RHEA-2018:2086 0 None None None 2018-06-27 13:31:13 UTC

Comment 1 Stephen Gordon 2017-01-26 21:49:54 UTC
Hi Ademar,

I've read the virt-devel thread and I still have no idea what we're supposed to do at the OpenStack layer and when - can you please expand a little? Ideally it seems like this should be handled for us transparently by libvirt/qemu...

Thanks,

Steve

Comment 2 Ademar Reis 2017-01-27 11:18:13 UTC
(In reply to Stephen Gordon from comment #1)
> Hi Ademar,
> 
> I've read the virt-devel thread and I still have no idea what we're supposed
> to do at the OpenStack layer and when - can you please expand a little?
> Ideally it seems like this should be handled for us transparently by
> libvirt/qemu...
> 

It should and it probably will. In this case, I recommend changing this BZ to TestOnly.

We have made it a habit to open BZs for layered products whenever we change something substantial in QEMU, so you're aware of changes and have time to evaluate if it impacts you or not. In this particular case, looks like everything should be transparent to OpenStack.

Comment 3 Kashyap Chamarthy 2017-03-07 10:51:54 UTC
As of now (07-MAR-2017), the upstream QEMU patch series for image locking is now targeted at QEMU 2.10.

And also adding 'TestOnly' keyword, as this should be handled transparently by libvirt, which will have all the details about image sharing.

Comment 4 Stephen Gordon 2017-07-18 16:04:22 UTC
Expect any issues here to be detected via normal regression testing.

Comment 5 Daniel Berrangé 2017-09-21 13:04:50 UTC
I'm re-opening this because I think we need a proactive action to audit Nova code.  In particular any place in Nova which runs 'qemu-img' must be checked to make sure it doesn't do this while a running QEMU has the disk open. QEMU acquires locks on all images, so this would cause 'qemu-img' to fail unless told to override the locks.  I think this is tricky enough that we shouldn't rely on normal QE testing finding all the problems, but rather actively check the code.

Comment 6 Matthew Booth 2017-09-21 13:10:51 UTC
There's an upstream WIP patch to address this:

  https://review.openstack.org/#/c/505673/

Comment 11 Matt Riedemann 2018-01-04 03:21:25 UTC
Hey guess what, this breaks the support for working on volume multiattach in the upstream Queens release:

https://review.openstack.org/#/c/267587/75/nova/virt/libvirt/guest.py

We test against the ubuntu pike cloud archive which has qemu 2.10 and libvirt 3.6.0 and fail to attach a volume (block device) to a 2nd guest even with the shareable flag set.

So I guess we'll have to put some conditional logic in the libvirt driver in nova to determine when multiattach will work or not based on the version of qemu and libvirt.

Comment 12 Peter Krempa 2018-01-04 07:27:13 UTC
What kind of error is reported in that case?

Comment 13 Ildiko Vancsa 2018-01-04 08:03:46 UTC
(In reply to Peter Krempa from comment #12)
> What kind of error is reported in that case?

The error we see now is this:

libvirtError: internal error: unable to execute QEMU command 'device_add': Failed to get "write" lock
Driver failed to attach volume 68fc8c1d-b39d-4365-b370-a068c5d99d81 at /dev/vdb: libvirtError: internal error: unable to execute QEMU command 'device_add': Failed to get "write" lock

Comment 14 Lee Yarwood 2018-01-04 11:26:23 UTC
(In reply to Matt Riedemann from comment #11)
> Hey guess what, this breaks the support for working on volume multiattach in
> the upstream Queens release:
> 
> https://review.openstack.org/#/c/267587/75/nova/virt/libvirt/guest.py
> 
> We test against the ubuntu pike cloud archive which has qemu 2.10 and
> libvirt 3.6.0 and fail to attach a volume (block device) to a 2nd guest even
> with the shareable flag set.
> 
> So I guess we'll have to put some conditional logic in the libvirt driver in
> nova to determine when multiattach will work or not based on the version of
> qemu and libvirt.

Just to be clear, this bug is tracking https://review.openstack.org/#/c/505673/ into Queens for OSP 13. That change simply allows `qemu-img info` to be used against live instances with QEMU 2.10. AFAICT this change isn't causing the issues we are seeing with multi-attach at this time.

Comment 15 Peter Krempa 2018-01-05 13:59:42 UTC
(In reply to Matt Riedemann from comment #11)
> Hey guess what, this breaks the support for working on volume multiattach in
> the upstream Queens release:
> 
> https://review.openstack.org/#/c/267587/75/nova/virt/libvirt/guest.py
> 
> We test against the ubuntu pike cloud archive which has qemu 2.10 and
> libvirt 3.6.0 and fail to attach a volume (block device) to a 2nd guest even
> with the shareable flag set.
> 
> So I guess we'll have to put some conditional logic in the libvirt driver in
> nova to determine when multiattach will work or not based on the version of
> qemu and libvirt.

So I learnt that 'multiattach' is supposed to mean that two VMs are able to use one image read-write (e.g. for cluster filesystems).

This configuration should be possible in libvirt if the image shared is formatted as 'RAW' (qcow2 would suffer metadata corruption in such case) and the <shareable/> flag is put into the libvirt disk XML.

Comment 19 errata-xmlrpc 2018-06-27 13:29:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:2086


Note You need to log in before you can comment on or make changes to this bug.