Storage Libs

  • HPC Charm Team
Channel Revision Published Runs on
latest/stable 1 04 Apr 2023
Ubuntu 22.04
juju deploy storage-libs
Show information

Platform:

Ubuntu
22.04

charms.storage_libs.v0.cephfs_interfaces

Library to manage integrations between CephFS share providers and consumers.

This library contains the CephFSProvides and CephFSRequires classes for managing an integration between a CephFS server operator and a CephFS client operator.

CephFSRequires (CephFS Client)

This class provides a uniform interface for charms that need to mount, unmount, or request CephFS shares, and convenience methods for consuming data sent by a CephFS server charm.

Defined events
  • server_connected: Event emitted when the CephFS client is connected to the CephFS server. Here is where CephFS clients will commonly request the CephFS share they need created.
  • mount_share: Event emitted when the CephFS share is ready to be mounted.
  • umount_share: Event emitted when the CephFS share is ready or needs to be unmounted.

Note: This charm library only supports a 1-on-1 relation between a CephFS server and a CephFS client. This is to prevent the CephFS client from having to manage and request multiple CephFS shares, and ensure that CephFS clients are creating unique mount points.

CephFSProvides (CephFS Server)

This library provides a uniform interface for charms that need to process CephFS share requests, and convenience methods for consuming data sent by a CephFS client charm.

Defined events
  • share_requested: Event emitted when the CephFS client requests a CephFS share.

Note: It is the responsibility of the CephFS Provider charm to provide the implementation for creating a new CephFS share. CephFSProvides just provides the interface for the integration.


class ServerConnectedEvent

Description

Emit when a CephFS server is integrated with CephFS client. None

class CephFSAuthInfo

Authorization info to access a CephFS share.

Attributes

username
Name of the user authorized to access the Ceph filesystem.
key
Cephx key for the authorized user.

class CephFSShareInfo

Information about a shared CephFS.

Attributes

fsid
ID of the Ceph cluster.
name
Name of the exported Ceph filesystem.
path
Exported path of the Ceph filesystem.
monitor_hosts
Address list of the available Ceph MON nodes.

Methods

CephFSShareInfo. __init__( self , fsid: str , name: str , path: str , monitor_hosts )

class MountShareEvent

Description

Emit when CephFS share is ready to be mounted. None

class UmountShareEvent

Description

Emit when CephFS share needs to be unmounted. None

class ShareRequestedEvent

Description

Emit when a consumer requests a new CephFS share be created by the provider. None

Methods

ShareRequestedEvent. name( self )

Description

Get name of requested CephFS share. None

class CephFSRequires

Description

Consumer-side interface of CephFS share integrations. None

Methods

CephFSRequires. __init__( self , charm: CharmBase , integration_name: str )

CephFSRequires. request_share( self , integration_id: int , name: str )

Request access to a CephFS share.

Arguments

integration_id

Identifier for specific integration.

name

Name of the CephFS share.

class CephFSProvides

Description

Provider-side interface of CephFS share integrations. None

Methods

CephFSProvides. __init__( self , charm: CharmBase , integration_name: str )

CephFSProvides. set_share( self , integration_id: int , share_info: CephFSShareInfo , auth_info: CephFSAuthInfo )

Set info for mounting a CephFS share.

Arguments

integration_id

Identifier for specific integration.

share_info

Information required to mount the CephFS share.

auth_info

Information required to authenticate against the Ceph cluster.