The cinder.volume.drivers.nfs Module

class NfsDriver(execute=<function execute>, *args, **kwargs)

Bases: cinder.volume.drivers.remotefs.RemoteFSSnapDriver, cinder.volume.driver.ExtendVD

NFS based cinder driver.

Creates file on NFS share for using it as block device on hypervisor.

CI_WIKI_NAME = 'Cinder_Jenkins'
VERSION = '1.4.0'
create_snapshot(inst, *args, **kwargs)
create_volume(inst, *args, **kwargs)
delete_snapshot(inst, *args, **kwargs)
delete_volume(inst, *args, **kwargs)
do_setup(context)

Any initialization the volume driver does while starting.

driver_prefix = 'nfs'
driver_volume_type = 'nfs'
extend_volume(volume, new_size)

Extend an existing volume to the new size.

initialize_connection(volume, connector)
set_nas_security_options(is_new_cinder_install)

Determine the setting to use for Secure NAS options.

Value of each NAS Security option is checked and updated. If the option is currently ‘auto’, then it is set to either true or false based upon if this is a new Cinder installation. The RemoteFS variable ‘_execute_as_root’ will be updated for this driver.

Parameters:is_new_cinder_install – bool indication of new Cinder install
update_migrated_volume(ctxt, volume, new_volume, original_volume_status)

Return the keys and values updated from NFS for migrated volume.

This method should rename the back-end volume name(id) on the destination host back to its original name(id) on the source host.

Parameters:
  • ctxt – The context used to run the method update_migrated_volume
  • volume – The original volume that was migrated to this backend
  • new_volume – The migration volume object that was created on this backend as part of the migration process
  • original_volume_status – The status of the original volume
Returns:

model_update to update DB with any needed changes

volume_backend_name = 'Generic_NFS'