Jump to: navigation, search

BlockDeviceDriver

Summary

This blueprint proposes BlockDeviceDriver. This driver is based on VolumeDriver and ISCSIDriver, it has an ability to create volumes on plain block devices. Also it contains basic capabilities to attach/detach volumes, сopy image to volume, сopy volume to image and clone volume. Release Note

Rationale

When it requires to have an ability of quick access to volumes, iSCSI or LVM perform not fast enough. This driver was created for this case. Anyway if use case requires remote volume attachment, although it is not so fast, this driver supports iSCSI as well.

User stories

The idea came from the Sahara project that provides an ability to run Hadoop clusters on OpenStack. One of the problems related to running Hadoop at virtual environment is the I/O performance. In most cases Hadoop is a very data intensive application. LVM generally reduces performance of the Hadoop (or any other I/O intensive app) so it's better to directly attach one or more local hard drives to VMs using VirtIO w/o iSCSI and LVM to avoid I/O performance problems. The another problem is data reliability - Hadoop can store data on several devices and so several hard drives could be attached to one Hadoop node to increase data reliability.

OpenStack Cinder configuration

You can set up the driver by setting following flags in cinder.conf:

  • volume_driver should be set to cinder.volume.drivers.block_device.BlockDeviceDriver
  • available_devices should contain list of all allowable devices

If you need to use iSCSI you should just provide all its settings as with LVM iSCSI driver.

Design

When a volume is being created driver chooses big enough block device from the list of available devices and assigns it to a new volume. Afterwards if connection is being made locally driver provides local path to a block device. If connection is being made remotely it works as LVMISCSIDriver.

Implementation

Driver is provided with list of available devices that it can manage in configuration parameter available_devices.

When the volume is created driver selects all volumes that was created on current host and then matches what devices are free from list of available devices and are big enough. Size is determined by running blockdev command. Path to selected device is added to provider_location of volume, which is the same as in LVMISCSIDriver, but has the 5th field.

All work with exports is done as in LVMISCSIDriver.

If attachment request originates on the same host, driver sets driver_volume_type to ‘local’ and device_path to a path of the selected block device. Otherwise it works like ISCSIDriver.