libvirt: Nova volume driver for volumes backed by a local file

Registered by Eduard Biceri-Matei on 2014-11-13

Currently there is a class in https://github.com/openstack/nova/blob/master/nova/virt/libvirt/volume.py, line 159, "Class for volumes backed by local file." but the actual implementation is of a block device (is_block_dev=True, conf.source_type = "block").

We have a storage solution (and a cinder volume driver) that exposes volumes as .raw file on a virtual filesystem (FUSE).
Until Juno this worked without issues, but starting with Juno and Kilo we started seeing errors:
/usr/local/bin/nova-rootwrap: Unauthorized command: blockdev --getsize64 /mnt/swift/volume1.raw (no filter matched)

This is caused by the fact that nova treats the volume as a block device and calls blockdev on it (which fails because it's a raw file not a block device.)

Suggestion:
- introduce a new class:
class LibvirtFileVolumeDriver(LibvirtBaseVolumeDriver):
    """Class for volumes backed by local file."""
with is_block_dev=False and conf.source_type = "file"
(this will generate correct xml and works with libvirt/qemu, also avoids code paths of source_type == "block")
- change description of existing class to "Class for volumes backed by local block devices"
- add it to the list of drivers (nova/driver.py)

After that, we'll update the cinder driver to return "file" instead of "local".
See also: https://review.openstack.org/#/c/130733/

Blueprint information

Status:
Started
Approver:
None
Priority:
Undefined
Drafter:
Eduard Biceri-Matei
Direction:
Needs approval
Assignee:
Eduard Biceri-Matei
Definition:
New
Series goal:
Proposed for liberty
Implementation:
Needs Code Review
Milestone target:
None
Started by
Eduard Biceri-Matei on 2014-11-18

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/nova-driver-local-file,n,z

Addressed by: https://review.openstack.org/134134
    New driver for volumes backed by local file.

You should not set a milestone target unless the blueprint has been properly prioritized by the project drivers.
(This is an automated message)

This blueprint needs approving, please submit a spec, or bring this up during a nova-meeting at the start of the L release. --johnthetubaguy 16th Feb 2015

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.