Shared Filesystems

Todo

rework

The manila.share.manager Module

NAS share manager managers creating shares and access rights.

Related Flags

share_driver:Used by ShareManager.
class ShareManager(share_driver=None, service_name=None, *args, **kwargs)

Bases: manila.manager.SchedulerDependentManager

Manages NAS storages.

RPC_API_VERSION = '1.1'
allow_access(context, access_id)

Allow access to some share.

create_share(context, share_id, request_spec=None, filter_properties=None, snapshot_id=None)

Creates a share.

create_snapshot(context, share_id, snapshot_id)

Create snapshot for share.

delete_free_share_servers(ctxt)
delete_share(context, share_id)

Delete a share.

delete_share_server(context, share_server)
delete_snapshot(context, snapshot_id)

Delete share snapshot.

deny_access(context, access_id)

Deny access to some share.

init_host()

Initialization for a standalone service.

manage_share(context, share_id, driver_options)
publish_service_capabilities(context)

Collect driver status and then publish it.

unmanage_share(context, share_id)

The manila.share.driver Module

Drivers for shares.

class ExecuteMixin

Bases: object

Provides an executable functionality to a driver class.

init_execute_mixin(*args, **kwargs)
set_execute(execute)
class GaneshaMixin

Bases: object

Augment derived classes with Ganesha configuration.

init_ganesha_mixin(*args, **kwargs)
class ShareDriver(driver_handles_share_servers, *args, **kwargs)

Bases: object

Class defines interface of NAS driver.

allocate_network(context, share_server, share_network, count=None, **kwargs)

Allocate network resources using given network information.

allow_access(context, share, access, share_server=None)

Allow access to the share.

check_for_setup_error()

Check for setup error.

create_share(context, share, share_server=None)

Is called to create share.

create_share_from_snapshot(context, share, snapshot, share_server=None)

Is called to create share from snapshot.

create_snapshot(context, snapshot, share_server=None)

Is called to create snapshot.

deallocate_network(context, share_server_id)

Deallocate network resources for the given share server.

delete_share(context, share, share_server=None)

Is called to remove share.

delete_snapshot(context, snapshot, share_server=None)

Is called to remove snapshot.

deny_access(context, share, access, share_server=None)

Deny access to the share.

do_setup(context)

Any initialization the share driver does while starting.

driver_handles_share_servers
ensure_share(context, share, share_server=None)

Invoked to ensure that share is exported.

Driver can use this method to update the list of export locations of the share if it changes. To do that, you should return list with export locations.

:return None or list with export locations

get_network_allocations_number()

Returns number of network allocations for creating VIFs.

Drivers that use Nova for share servers should return zero (0) here same as Generic driver does. Because Nova will handle network resources allocation. Drivers that handle networking itself should calculate it according to their own requirements. It can have 1+ network interfaces.

get_pool(share)

Return pool name where the share resides on.

Parameters:share – The share hosted by the driver.
get_share_stats(refresh=False)

Get share status.

If ‘refresh’ is True, run update the stats first.

manage_existing(share, driver_options)

Brings an existing share under Manila management.

If provided share is not valid, then raise a ManageInvalidShare exception, specifying a reason for the failure.

The share has a share_type, and the driver can inspect that and compare against the properties of the referenced backend share. If they are incompatible, raise a ManageExistingShareTypeMismatch, specifying a reason for the failure.

Parameters:
  • share – Share model
  • driver_options – Driver-specific options provided by admin.
Returns:

share_update dictionary with required key ‘size’, which should contain size of the share.

setup_server(*args, **kwargs)
teardown_server(*args, **kwargs)
unmanage(share)

Removes the specified share from Manila management.

Does not delete the underlying backend share.

For most drivers, this will not need to do anything. However, some drivers might use this call as an opportunity to clean up any Manila-specific configuration that they have associated with the backend share.

If provided share cannot be unmanaged, then raise an UnmanageInvalidShare exception, specifying a reason for the failure.

Incubated Project

Table Of Contents

Previous topic

The Database Layer

Next topic

Authentication and Authorization

This Page