Generic approach for share provisioning

Generic approach for share provisioning

The Shared File Systems service can be configured to use Nova VMs and Cinder volumes. There are two modules that handle them in manila: 1) ‘service_instance’ module creates VMs in Nova with predefined image called service image. This module can be used by any backend driver for provisioning of service VMs to be able to separate share resources among tenants. 2) ‘generic’ module operates with Cinder volumes and VMs created by ‘service_instance’ module, then creates shared filesystems based on volumes attached to VMs.

Network configurations

Each backend driver can handle networking in its own way, see: https://wiki.openstack.org/wiki/Manila/Networking

One of two possible configurations can be chosen for share provisioning
using ‘service_instance’ module:
  • Service VM has one net interface from net that is connected to public router. For successful creation of share, user network should be connected to public router too.
  • Service VM has two net interfaces, first one connected to service network, second one connected directly to user’s network.

Requirements for service image

  • Linux based distro

  • NFS server

  • Samba server >=3.2.0, that can be configured by data stored in registry

  • SSH server

  • Two net interfaces configured to DHCP (see network approaches)

  • ‘exportfs’ and ‘net conf’ libraries used for share actions

  • Following files will be used, so if their paths differ one needs to create at

    least symlinks for them:

    • /etc/exports (permanent file with NFS exports)
    • /var/lib/nfs/etab (temporary file with NFS exports used by ‘exportfs’)
    • /etc/fstab (permanent file with mounted filesystems)
    • /etc/mtab (temporary file with mounted filesystems used by ‘mount’)

Supported shared filesystems

  • NFS (access by IP)
  • CIFS (access by IP)

Known restrictions

  • One of Nova’s configurations only allows 26 shares per server. This limit comes from the maximum number of virtual PCI interfaces that are used for block device attaching. There are 28 virtual PCI interfaces, in this configuration, two of them are used for server needs and other 26 are used for attaching block devices that are used for shares.
  • Juno version works only with Neutron. Each share should be created with neutron-net and neutron-subnet IDs provided via share-network entity.
  • Juno version handles security group, flavor, image, keypair for Nova VM and also creates service networks, but does not use availability zones for Nova VMs and volume types for Cinder block devices.
  • Juno version does not use security services data provided with share-network. These data will be just ignored.
  • Liberty version adds a share extend capability. Share access will be briefly interrupted during an extend operation.
  • Liberty version adds a share shrink capability, but this capability is not effective because generic driver shrinks only filesystem size and doesn’t shrink the size of Cinder volume.

The manila.share.drivers.generic Module

Generic Driver for shares.

class GenericShareDriver(*args, **kwargs)

Bases: manila.share.driver.ExecuteMixin, manila.share.driver.ShareDriver

Executes commands relating to Shares.

check_for_setup_error()

Returns an error if prerequisites aren’t met.

create_cgsnapshot(context, *args, **kwargs)
create_consistency_group(context, *args, **kwargs)
create_consistency_group_from_cgsnapshot(context, *args, **kwargs)
create_share(context, *args, **kwargs)
create_share_from_snapshot(context, *args, **kwargs)
create_snapshot(context, snapshot, share_server=None)

Creates a snapshot.

delete_cgsnapshot(context, *args, **kwargs)
delete_consistency_group(context, cg_dict, share_server=None)

Deletes a consistency group.

Since we are faking the CG object we do nothing here.

delete_share(context, share, share_server=None)

Deletes share.

delete_snapshot(context, snapshot, share_server=None)

Deletes a snapshot.

do_setup(context)

Any initialization the generic driver does while starting.

ensure_share(context, *args, **kwargs)
extend_share(context, *args, **kwargs)
get_network_allocations_number()

Get number of network interfaces to be created.

manage_existing(share, driver_options)

Manage existing share to manila.

Generic driver accepts only one driver_option ‘volume_id’. If an administrator provides this option, then appropriate Cinder volume will be managed by Manila as well.

Parameters:
  • share – share data
  • driver_options – Empty dict or dict with ‘volume_id’ option.
Returns:

dict with share size, example: {‘size’: 1}

manage_existing_snapshot(snapshot, driver_options)

Manage existing share snapshot with manila.

Parameters:
  • snapshot – Snapshot data
  • driver_options – Not used by the Generic driver currently
Returns:

dict with share snapshot size, example: {‘size’: 1}

shrink_share(context, *args, **kwargs)
unmanage_snapshot(snapshot)

Unmanage share snapshot with manila.

update_access(context, *args, **kwargs)
ensure_server(f)

The manila.share.drivers.service_instance Module

Module for managing nova instances for share drivers.

class BaseNetworkhelper(service_instance_manager)

Bases: object

NAME

Returns code name of network helper.

get_network_name(network_info)

Returns name of network for service instance.

setup_connectivity_with_service_instances()

Sets up connectivity between Manila host and service instances.

setup_network(network_info)

Sets up network for service instance.

teardown_network(server_details)

Teardowns network resources provided for service instance.

class NeutronNetworkHelper(service_instance_manager)

Bases: manila.share.drivers.service_instance.BaseNetworkhelper

NAME
admin_project_id
get_network_name(network_info)

Returns name of network for service instance.

neutron_api
service_network_id
setup_connectivity_with_service_instances()

Sets up connectivity with service instances.

Creates host port in service network and/or admin network, creating and setting up required network devices.

setup_network(*args, **kwargs)
teardown_network(*args, **kwargs)
class NovaNetworkHelper(service_instance_manager)

Bases: manila.share.drivers.service_instance.BaseNetworkhelper

Nova network helper for Manila service instances.

All security-group rules are applied to all interfaces of Nova VM using Nova-network. In that case there is no need to create additional service network. Only one thing should be satisfied - Manila host should have access to all tenant networks. This network helper does not create resources.

NAME
get_network_name(network_info)

Returns name of network for service instance.

setup_connectivity_with_service_instances()

Nothing to do. Placeholder.

setup_network(network_info)
teardown_network(server_details)

Nothing to do. Placeholder.

class ServiceInstanceManager(driver_config=None)

Bases: object

Manages nova instances for various share drivers.

This class provides following external methods:

  1. set_up_service_instance: creates instance and sets up share infrastructure.
  2. ensure_service_instance: ensure service instance is available.
  3. delete_service_instance: removes service instance and network infrastructure.
delete_service_instance(context, server_details)

Removes share infrastructure.

Deletes service vm and subnet, associated to share network.

ensure_service_instance(context, server)

Ensures that server exists and active.

get_common_server()
get_config_option(key)

Returns value of config option.

Parameters:key – key of config’ option.
Returns:str – value of config’s option. first priority is driver’s config, second priority is global config.
network_helper
reboot_server(server, soft_reboot=False)
set_up_service_instance(context, network_info)

Finds or creates and sets up service vm.

Parameters:
  • context – defines context, that should be used
  • network_info – network info for getting allocations
Returns:

dict with service instance details

Raises:

exception.ServiceInstanceException

wait_for_instance_to_be_active(instance_id, timeout)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.