'The virtio_blk driver allows a serial number to be assigned to virtual
blockdevices.
OpenStack will set a serial number containing the first 20
characters of the Cinder block device ID.
This was introduced in
* https://github.com/openstack/nova/commit/3a47c02c58cefed0e230190b4bcef14527c82709  # noqa
* https://bugs.launchpad.net/nova/+bug/1004328
The udev daemon will read the serial number and create a
symlink to the canonical virtio_blk device path.
We do this because libvirt does not return the correct device path when
additional disks have been attached using a client other than
cinder. This is expected behaviour within Cinder and libvirt See
https://bugs.launchpad.net/cinder/+bug/1387945 and
http://libvirt.org/formatdomain.html#elementsDisks (target section)
:param volume: The Cinder ``Volume`` which is attached.
:returns: ``FilePath`` of the device created by the virtio_blk
driver.'

def _get_device_path_virtio_blk(self, volume):

    expected_path = FilePath('/dev/disk/by-id/virtio-{}'.format(volume.id[:20]))
    if expected_path.exists():
        return expected_path.realpath()
    else:
        raise UnattachedVolume(volume.id)
