distaflibs.gluster.ganesha module

Description: Library for gluster NFS-Ganesha operations.

distaflibs.gluster.ganesha.vol_set_nfs_disable(volname, option=True, mnode=None)

Enables/Disables nfs for the volume. :param volname: Volume name. :type volname: str

Kwargs:
option (Optional[bool]): If True it disables nfs for
that volume else enables nfs for that volume. Default value is True.
mnode (Optional[str]): Node on which the command has
to be executed. Default value is tc.servers[0].
Returns:True if successful, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.vol_set_ganesha(volname, option=True, mnode=None)

Enables/Disables ganesha for the volume. :param volname: Volume name. :type volname: str

Kwargs:
option (Optional[bool]): If True it enables ganesha for
that volume else disables ganesha for that volume. Default value is True.
mnode (Optional[str]): Node on which the command has
to be executed. Default value is tc.servers[0].
Returns:True if successful, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.validate_ganesha_ha_status(mnode=None)

Validates Ganesha HA Status. Kwargs:

mnode (Optional[str]): Node on which the command has
to be executed. Default value is tc.servers[0].
Returns:True if successful(HA status is correct), False otherwise.
Return type:bool
distaflibs.gluster.ganesha.set_nfs_ganesha(option=True, mnode=None)

Enables/Disables NFS-Ganesha Cluster Kwargs:

option (Optional[bool]): If True it enables the nfs-ganesha
HA Cluster, else disables the nfs-ganesha HA Cluster. Default value is True.
mnode (Optional[str]): Node on which the command has
to be executed. Default value is tc.servers[0].
Returns:True if successful, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.get_host_by_name(servers=None)

Get hostname of the specified servers. Kwargs:

servers (Optional[str]): Get hostnames of the specified servers.
Returns:dict with ‘hostname or ip_address” of the server as key and ‘hostname’ of the server as value.
Return type:dict
distaflibs.gluster.ganesha.create_nfs_passwordless_ssh(snodes=[], guser=None, mnode=None)

Sets up the passwordless ssh between mnode and all other snodes. :param snodes: List of nodes for which we require passwordless

ssh from mnode.
Kwargs:

guser (Optional[str]): Username . Default value is root. mnode (Optional[str]): Node from which we require passwordless

ssh to snodes. Default value is tc.servers[0].
Returns:True if successfull, False otherwise
Return type:bool
distaflibs.gluster.ganesha.validate_ganesha_ha_failover(mnode=None, snodes=None)

Validates HA failover status Kwargs:

mnode (Optional[str]): Node on which the ha status command has
to be executed. Default value is tc.servers[0].
snodes (Optional[str]): Node/Nodes on which ganesha process is
Killed/stopped or Node shutdown
Returns:True if successfull, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.get_ganesha_ha_failover_nodes(mnode=None, snodes=None)

Returns HA status and dictionary of Kwargs:

mnode (Optional[str]): Node on which the ha status command has
to be executed. Default value is tc.servers[0].
snodes (Optional[str]): Node/Nodes on which ganesha process
is Killed/stopped or Node shutdown
Returns:If successfull True,dict False otherwise
Return type:bool,dict
distaflibs.gluster.ganesha.update_ganesha_ha_conf(no_of_servers=None)

Updates the ganesha-ha.conf file, with VIPs and hostnames. Kwargs:

no_of_servers (Optional[int]): The number of nodes on which we have
to modify the ganesha-ha.conf file. Default it takes the number of servers from the pool list.
Returns:True if successfull, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.cluster_auth_setup(no_of_servers=None)
Sets the hacluster password, starts pcsd service and runs
pcs cluster auth command.
Kwargs:
no_of_servers (Optional[int]): The number of nodes on which we have
to setup the HA cluster. Default it takes the number of servers from the pool list.
Returns:True if successfull, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.setup_nfs_ganesha(no_of_servers=None)

Setup NFS-Ganesha HA cluster. Kwargs:

no_of_servers (Optional[int]): The number of nodes on which we have
to setup the HA cluster. Default it takes the number of servers from the pool list.
Returns:True if successfull, False otherwise.
Return type:bool
distaflibs.gluster.ganesha.teardown_nfs_ganesha_setup(mnode=None)

Teardowns the NFS-Ganesha HA setup. Kwargs:

mnode (Optional[str]): Node on which the command has
to be executed. Default value is tc.servers[0].
Returns:True if successful, False otherwise.
Return type:bool