Todo
rework
NAS share manager managers creating shares and access rights.
Related Flags
share_driver: | Used by ShareManager. |
---|
Bases: manila.manager.SchedulerDependentManager
Manages NAS storages.
Migrates a share from current host to another host.
Lock decorator for share replica operations.
Takes a named lock prior to executing the operation. The lock is named with the id of the share to which the replica belongs.
Intended use: If a replica operation uses this decorator, it will block actions on all share replicas of the share until the named lock is free. This is used to protect concurrent operations on replicas of the same share e.g. promote ReplicaA while deleting ReplicaB, both belonging to the same share.
Drivers for shares.
Bases: object
Provides an executable functionality to a driver class.
Bases: object
Augment derived classes with Ganesha configuration.
Bases: object
Class defines interface of NAS driver.
Allocate admin network resources using given network information.
Allocate network resources using given network information.
Allow access to the share.
Check for setup error.
Method that allows driver to choose share server for provided share.
If compatible share-server is not found, method should return None.
Parameters: |
|
---|---|
Returns: | share-server or None |
Create a consistency group snapshot.
Parameters: |
|
---|---|
Returns: | (cgsnapshot_update, member_update_list) cgsnapshot_update - a dict containing any values to be updated for the CGSnapshot in the database. This value may be None. member_update_list - a list of dictionaries containing for every member of the cgsnapshot. Each dict should contains values to be updated for teh CGSnapshotMember in the database. This list may be empty or None. |
Create a consistency group.
Parameters: |
|
---|---|
Returns: | (cg_model_update, share_update_list) cg_model_update - a dict containing any values to be updated for the CG in the database. This value may be None. |
Create a consistency group from a cgsnapshot.
Parameters: |
|
---|---|
Returns: | (cg_model_update, share_update_list) cg_model_update - a dict containing any values to be updated for the CG in the database. This value may be None. share_update_list - a list of dictionaries containing dicts for every share created in the CG. Any share dicts should at a minimum contain the ‘id’ key and ‘export_locations’. Export locations should be in the same format as returned by a share_create. This list may be empty or None. EXAMPLE: .. code: [{'id': 'uuid', 'export_locations': ['export_path']}]
|
Replicate the active replica to a new replica on this backend.
NOTE: This call is made on the host that the new replica is being created upon.
Parameters: |
|
---|
This list also contains the replica to be created. The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘07574742-67ea-4dfd-9844-9fbd8ada3d87’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: |
|
---|
the share already obey. Drivers are expected to apply access rules to the new replica or disregard access rules that don’t apply.
- EXAMPLE:
- [ { ‘id’: ‘f0875f6f-766b-4865-8b41-cccb4cdf1676’, ‘deleted’ = False, ‘share_id’ = ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘access_type’ = ‘ip’, ‘access_to’ = ‘172.16.20.1’, ‘access_level’ = ‘rw’, }]
Parameters: | replica_snapshots – List of dictionaries of snapshot instances |
---|
for each snapshot of the share whose ‘aggregate_status’ property was reported to be ‘available’ when the share manager initiated this request. Each list member will have two sub dictionaries: ‘active_replica_snapshot’ and ‘share_replica_snapshot’. The ‘active’ replica snapshot corresponds to the instance of the snapshot on any of the ‘active’ replicas of the share while share_replica_snapshot corresponds to the snapshot instance for the specific replica that will need to exist on the new share replica that is being created. The driver needs to ensure that this snapshot instance is truly available before transitioning the replica from ‘out_of_sync’ to ‘in_sync’. Snapshots instances for snapshots that have an ‘aggregate_status’ of ‘creating’ or ‘deleting’ will be polled for in the update_replicated_snapshot method.
- EXAMPLE:
[ { ‘active_replica_snapshot’: {
‘id’: ‘8bda791c-7bb6-4e7b-9b64-fefff85ff13e’, ‘share_instance_id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘status’: ‘available’, ‘provider_location’: ‘/newton/share-snapshot-10e49c3e-aca9’, ... },
- ‘share_replica_snapshot’: {
‘id’: ‘’, ‘share_instance_id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’, ‘status’: ‘available’, ‘provider_location’: None,
...},
}]
Parameters: | share_server – <models.ShareServer> or None, |
---|
Share server of the replica being created. :return: None or a dictionary containing export_locations, replica_state and access_rules_status. export_locations is a list of paths and replica_state is one of active, in_sync, out_of_sync or error. A backend supporting ‘writable’ type replication should return ‘active’ as the replica_state. Export locations should be in the same format as returned during the create_share call.
EXAMPLE: .. code:: {
- ‘export_locations’: [
- {
- ‘path’: ‘172.16.20.22/sample/export/path’,
- ‘is_admin_only’: False, ‘metadata’: {‘some_key’: ‘some_value’},
},
- ],
- ‘replica_state’: ‘in_sync’, ‘access_rules_status’: ‘in_sync’,
}
Create a snapshot on active instance and update across the replicas.
NOTE: This call is made on the ‘active’ replica’s host. Drivers are expected to transfer the snapshot created to the respective replicas.
The driver is expected to return model updates to the share manager. If it was able to confirm the creation of any number of the snapshot instances passed in this interface, it can set their status to ‘available’ as a cue for the share manager to set the progress attr to ‘100%’.
Parameters: |
|
---|
The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: |
|
---|---|
Returns: | List of replica_snapshots, a list of dictionaries containing |
values that need to be updated on the database for the snapshot instances being created. :raises: Exception. Any exception in this method will set all instances to ‘error’.
Is called to create share.
Is called to create share from snapshot.
Is called to create snapshot.
Parameters: |
|
---|
Deallocate network resources for the given share server.
Delete a consistency group snapshot
Parameters: |
|
---|---|
Returns: | (cgsnapshot_update, member_update_list) cgsnapshot_update - a dict containing any values to be updated for the CGSnapshot in the database. This value may be None. |
Delete a consistency group
Parameters: |
|
---|---|
Returns: | cg_model_update cg_model_update - a dict containing any values to be updated for the CG in the database. This value may be None. |
Delete a replica.
NOTE: This call is made on the host that hosts the replica being deleted.
Parameters: |
|
---|
This list also contains the replica to be deleted. The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘07574742-67ea-4dfd-9844-9fbd8ada3d87’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: |
|
---|
instances that are associated with the share replica being deleted. No model updates are possible in this method. The driver should return when the cleanup is completed on the backend for both, the snapshots and the replica itself. Drivers must handle situations where the snapshot may not yet have finished ‘creating’ on this replica.
- EXAMPLE:
- [
{ ‘id’: ‘89dafd00-0999-4d23-8614-13eaa6b02a3b’, ‘snapshot_id’: ‘3ce1caf7-0945-45fd-a320-714973e949d3’, ‘status: ‘available’, ‘share_instance_id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’
...}, { ‘id’: ‘8bda791c-7bb6-4e7b-9b64-fefff85ff13e’, ‘snapshot_id’: ‘13ee5cb5-fc53-4539-9431-d983b56c5c40’, ‘status: ‘creating’, ‘share_instance_id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’
...]
Parameters: | share_server – <models.ShareServer> or None, |
---|
Share server of the replica to be deleted. :return: None. :raises Exception. Any exception raised will set the share replica’s ‘status’ and ‘replica_state’ to ‘error_deleting’. It will not affect snapshots belonging to this replica.
Delete a snapshot by deleting its instances across the replicas.
NOTE: This call is made on the ‘active’ replica’s host, since drivers may not be able to delete the snapshot from an individual replica.
The driver is expected to return model updates to the share manager. If it was able to confirm the removal of any number of the snapshot instances passed in this interface, it can set their status to ‘deleted’ as a cue for the share manager to clean up that instance from the database.
Parameters: |
|
---|
The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: |
|
---|---|
Returns: | List of replica_snapshots, a list of dictionaries containing |
values that need to be updated on the database for the snapshot instances being deleted. To confirm the deletion of the snapshot instance, set the ‘status’ attribute of the instance to ‘deleted’(constants.STATUS_DELETED). :raises: Exception. Any exception in this method will set all instances to ‘error_deleting’.
Is called to remove share.
Is called to remove snapshot.
Parameters: |
|
---|
Deny access to the share.
Any initialization the share driver does while starting.
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
Extends size of existing share.
Parameters: |
|
---|
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.
Dedicated for update/extend of data for existing share instances.
Redefine this method in share driver to be able to update/change/extend share instances data that will be used by periodic hook action. One of possible updates is add-on of “automount” CLI commands for each share instance for case of notification is enabled using ‘hook’ approach.
Parameters: |
|
---|---|
Returns: | list of share instances. |
Return pool name where the share resides on.
Parameters: | share – The share hosted by the driver. |
---|
Return list of pools related to a particular share server.
Parameters: | share_server – ShareServer class instance. |
---|
Get share status.
If ‘refresh’ is True, run update the stats first.
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: |
|
---|---|
Returns: | share_update dictionary with required key ‘size’, which should contain size of the share. |
Brings an existing snapshot under Manila management.
If provided snapshot is not valid, then raise a ManageInvalidShareSnapshot exception, specifying a reason for the failure.
Parameters: |
|
---|---|
Returns: | model_update dictionary with required key ‘size’, which should contain size of the share snapshot. |
Is called to cancel driver migration.
If possible, driver can implement a way to cancel an in-progress migration. :param context: The ‘context.RequestContext’ object for the request. :param share_ref: Reference to the share being migrated. :param share_server: Share server model or None. :param dest_driver_migration_info: Migration information provided by destination host.
Is called to perform 2nd phase of driver migration of a given share.
If driver is implementing 2-phase migration, this method should perform tasks related to the 2nd phase of migration, thus completing it. :param context: The ‘context.RequestContext’ object for the request. :param share_ref: Reference to the share being migrated. :param share_server: Share server model or None. :param dest_driver_migration_info: Migration information provided by destination host. :returns: Dictionary containing a model update with relevant data to be updated after migration, such as export locations.
Is called to provide necessary driver migration logic.
Parameters: |
|
---|---|
Returns: | A dictionary with migration information. |
Is called to provide necessary generic migration logic.
Parameters: |
|
---|---|
Returns: | A dictionary with migration information. |
Is called to get migration progress.
If possible, driver can implement a way to return migration progress information. :param context: The ‘context.RequestContext’ object for the request. :param share_ref: Reference to the share being migrated. :param share_server: Share server model or None. :param dest_driver_migration_info: Migration information provided by destination host. :return: A dictionary with ‘total_progress’ field containing the percentage value.
Is called to perform 1st phase of driver migration of a given share.
Driver should implement this method if willing to perform migration in an optimized way, useful for when driver understands destination backend. :param context: The ‘context.RequestContext’ object for the request. :param share_ref: Reference to the share being migrated. :param share_server: Share server model or None. :param host: Destination host and its capabilities. :param dest_driver_migration_info: Migration information provided by destination host. :param notify: whether the migration should complete or wait for 2nd phase call. Driver may throw exception when validating this parameter, exception if does not support 1-phase or 2-phase approach. :returns: Boolean value indicating if driver migration succeeded. :returns: Dictionary containing a model update with relevant data to be updated after migration, such as export locations.
Promote a replica to ‘active’ replica state.
NOTE: This call is made on the host that hosts the replica being promoted.
Parameters: |
|
---|
This list also contains the replica to be promoted. The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘07574742-67ea-4dfd-9844-9fbd8ada3d87’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: |
|
---|
the share already obey. EXAMPLE:
[ { ‘id’: ‘f0875f6f-766b-4865-8b41-cccb4cdf1676’, ‘deleted’ = False, ‘share_id’ = ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘access_type’ = ‘ip’, ‘access_to’ = ‘172.16.20.1’, ‘access_level’ = ‘rw’, }]
Parameters: | share_server – <models.ShareServer> or None, |
---|
Share server of the replica to be promoted. :return: updated_replica_list or None
The driver can return the updated list as in the request parameter. Changes that will be updated to the Database are: ‘export_locations’, ‘access_rules_status’ and ‘replica_state’.
Shrinks size of existing share.
If consumed space on share larger than new_size driver should raise ShareShrinkingPossibleDataLoss exception: raise ShareShrinkingPossibleDataLoss(share_id=share[‘id’])
Parameters: |
|
---|
:raises ShareShrinkingPossibleDataLoss, NotImplementedError
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.
Removes the specified snapshot from Manila management.
Does not delete the underlying backend share snapshot.
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 snapshot.
If provided share snapshot cannot be unmanaged, then raise an UnmanageInvalidShareSnapshot exception, specifying a reason for the failure.
Update access rules for given share.
Drivers should support 2 different cases in this method: 1. Recovery after error - ‘access_rules’ contains all access_rules, ‘add_rules’ and ‘delete_rules’ shall be empty. Driver should clear any existent access rules and apply all access rules for given share. This recovery is made at driver start up.
2. Adding/Deleting of several access rules - ‘access_rules’ contains all access_rules, ‘add_rules’ and ‘delete_rules’ contain rules which should be added/deleted. Driver can ignore rules in ‘access_rules’ and apply only rules from ‘add_rules’ and ‘delete_rules’.
Drivers must be mindful of this call for share replicas. When ‘update_access’ is called on one of the replicas, the call is likely propagated to all replicas belonging to the share, especially when individual rules are added or removed. If a particular access rule does not make sense to the driver in the context of a given replica, the driver should be careful to report a correct behavior, and take meaningful action. For example, if R/W access is requested on a replica that is part of a “readable” type replication; R/O access may be added by the driver instead of R/W. Note that raising an exception will result in the access_rules_status on the replica, and the share itself being “out_of_sync”. Drivers can sync on the valid access rules that are provided on the create_replica and promote_replica calls.
Parameters: |
|
---|
Update the replica_state of a replica.
NOTE: This call is made on the host which hosts the replica being updated.
Drivers should fix replication relationships that were broken if possible inside this method.
This method is called periodically by the share manager; and whenever requested by the administrator through the ‘resync’ API.
Parameters: |
|
---|
This list also contains the replica to be updated. The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘e82ff8b6-65f0-11e5-9d70-feff819cdc9f’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘07574742-67ea-4dfd-9844-9fbd8ada3d87’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: | replica – Dictionary of the replica being updated. |
---|
Replica state will always be ‘in_sync’, ‘out_of_sync’, or ‘error’. Replicas in ‘active’ state will not be passed via this parameter.
- EXAMPLE:
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘deleted’: False, ‘host’: 'openstack2@cmodeSSVMNFS1‘, ‘status’: ‘available’, ‘scheduled_at’: datetime.datetime(2015, 8, 10, 0, 5, 58), ‘launched_at’: datetime.datetime(2015, 8, 10, 0, 5, 58), ‘terminated_at’: None, ‘replica_state’: ‘in_sync’, ‘availability_zone_id’: ‘e2c2db5c-cb2f-4697-9966-c06fb200cb80’, ‘export_locations’: [
models.ShareInstanceExportLocations,], ‘access_rules_status’: ‘in_sync’, ‘share_network_id’: ‘4ccd5318-65f1-11e5-9d70-feff819cdc9f’, ‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, }
Parameters: | access_rules – A list of access rules that other replicas of |
---|
the share already obey. The driver could attempt to sync on any un-applied access_rules. EXAMPLE:
[ { ‘id’: ‘f0875f6f-766b-4865-8b41-cccb4cdf1676’, ‘deleted’ = False, ‘share_id’ = ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘access_type’ = ‘ip’, ‘access_to’ = ‘172.16.20.1’, ‘access_level’ = ‘rw’, }]
Parameters: | replica_snapshots – List of dictionaries of snapshot instances |
---|
for each snapshot of the share whose ‘aggregate_status’ property was reported to be ‘available’ when the share manager initiated this request. Each list member will have two sub dictionaries: ‘active_replica_snapshot’ and ‘share_replica_snapshot’. The ‘active’ replica snapshot corresponds to the instance of the snapshot on any of the ‘active’ replicas of the share while share_replica_snapshot corresponds to the snapshot instance for the specific replica being updated. The driver needs to ensure that this snapshot instance is truly available before transitioning from ‘out_of_sync’ to ‘in_sync’. Snapshots instances for snapshots that have an ‘aggregate_status’ of ‘creating’ or ‘deleting’ will be polled for in the update_replicated_snapshot method.
- EXAMPLE:
[ { ‘active_replica_snapshot’: {
‘id’: ‘8bda791c-7bb6-4e7b-9b64-fefff85ff13e’, ‘share_instance_id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘status’: ‘available’, ‘provider_location’: ‘/newton/share-snapshot-10e49c3e-aca9’, ... },‘share_replica_snapshot’: { ‘id’: ,
‘share_instance_id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘status’: ‘creating’, ‘provider_location’: None,
...},
}]
Parameters: | share_server – <models.ShareServer> or None |
---|---|
Returns: | replica_state replica_state - a str value denoting the replica_state that the replica can have. Valid values are ‘in_sync’ and ‘out_of_sync’ or None (to leave the current replica_state unchanged). |
Update the status of a snapshot instance that lives on a replica.
NOTE: For DR and Readable styles of replication, this call is made on the replica’s host and not the ‘active’ replica’s host.
This method is called periodically by the share manager. It will query for snapshot instances that track the parent snapshot across non-‘active’ replicas. Drivers can expect the status of the instance to be ‘creating’ or ‘deleting’. If the driver sees that a snapshot instance has been removed from the replica’s backend and the instance status was set to ‘deleting’, it is expected to raise a SnapshotResourceNotFound exception. All other exceptions will set the snapshot instance status to ‘error’. If the instance was not in ‘deleting’ state, raising a SnapshotResourceNotFound will set the instance status to ‘error’.
Parameters: |
|
---|
The ‘active’ replica will have its ‘replica_state’ attr set to ‘active’.
- EXAMPLE:
- [
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘in_sync’,
...‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, ‘share_server’: <models.ShareServer> or None, }, { ‘id’: ‘10e49c3e-aca9-483b-8c2d-1c337b38d6af’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘replica_state’: ‘active’,
...‘share_server_id’: ‘f63629b3-e126-4448-bec2-03f788f76094’, ‘share_server’: <models.ShareServer> or None, }, ...
]
Parameters: | share_replica – Dictionary of the replica the snapshot instance |
---|
is meant to be associated with. Replicas in ‘active’ replica_state will not be passed via this parameter.
- EXAMPLE:
{ ‘id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_id’: ‘f0e4bb5e-65f0-11e5-9d70-feff819cdc9f’, ‘deleted’: False, ‘host’: 'openstack2@cmodeSSVMNFS1‘, ‘status’: ‘available’, ‘scheduled_at’: datetime.datetime(2015, 8, 10, 0, 5, 58), ‘launched_at’: datetime.datetime(2015, 8, 10, 0, 5, 58), ‘terminated_at’: None, ‘replica_state’: ‘in_sync’, ‘availability_zone_id’: ‘e2c2db5c-cb2f-4697-9966-c06fb200cb80’, ‘export_locations’: [
models.ShareInstanceExportLocations,], ‘access_rules_status’: ‘in_sync’, ‘share_network_id’: ‘4ccd5318-65f1-11e5-9d70-feff819cdc9f’, ‘share_server_id’: ‘4ce78e7b-0ef6-4730-ac2a-fd2defefbd05’, }
Parameters: |
|
---|
updated. replica_snapshot will be in ‘creating’ or ‘deleting’ states when sent via this parameter.
- EXAMPLE:
{ ‘name’: ‘share-snapshot-18825630-574f-4912-93bb-af4611ef35a2’, ‘share_id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘share_name’: ‘share-d487b88d-e428-4230-a465-a800c2cce5f8’, ‘status’: ‘creating’, ‘id’: ‘18825630-574f-4912-93bb-af4611ef35a2’, ‘deleted’: False, ‘created_at’: datetime.datetime(2016, 8, 3, 0, 5, 58), ‘share’: <models.ShareInstance>, ‘updated_at’: datetime.datetime(2016, 8, 3, 0, 5, 58), ‘share_instance_id’: ‘d487b88d-e428-4230-a465-a800c2cce5f8’, ‘snapshot_id’: ‘13ee5cb5-fc53-4539-9431-d983b56c5c40’, ‘progress’: ‘0%’, ‘deleted_at’: None, ‘provider_location’: None, }
Parameters: | share_server – <models.ShareServer> or None |
---|---|
Returns: | replica_snapshot_model_update, a dictionary containing |
values that need to be updated on the database for the snapshot instance that represents the snapshot on the replica. :raises: exception.SnapshotResourceNotFound for snapshots that are not found on the backend and their status was ‘deleting’.
Enter search terms or a module, class or function name.