Partial-Bug: #1897903 Change-Id: Ia6dd260e6d2f9e2a7d9d381d345d952a3069f8c5 Signed-off-by: Douglas Viroel <viroel@gmail.com>
19 KiB
Share server migration
Share server migration is a functionality that lets administrators migrate a share server, and all its shares and snapshots, to a new destination.
As with share migration, a 2-phase approach was implemented for share server migration, which allows to control the right time to complete the operation, that usually ends on clients disruption.
The process of migrating a share server involves different operations over the share server, but can be achieved by invoking two main operations: "start" and "complete". You'll need to begin with the "start" operation and wait until the service has completed the first phase of the migration to call the "complete" operation. When a share server is undergoing the first phase, it's possible to choose to "cancel" it, or get a report of the progress.
A new operation called "migration check" is available to assist on a pre-migration phase, by validating within the destination host if the migration can or not be completed, providing an output with the compatible capabilities supported by the driver.
Share server migration is driven by share drivers, which means that both source and destination backends must support this functionality, and the driver must provide such operation in an efficient way.
Server migration workflows
Before actually starting the migration, you can use the operation
migration_check <share_server_migration_check_cli>
to verify if the destination host and the requested capabilities are
supported by the driver. If the answer is compatible
equal
to True
, you can proceed with the migration process,
otherwise you'll need to identify the conflicting parameters or, in more
complex scenarios, search for messages directly in the manila logs. The
available capabilities are: writable
,
nondisruptive
, preserve_snapshots
and
new_share_network_id
, which are detailed in shared_file_systems_share_server_migration_parameters
.
The migration process starts by invoking the migration_start <share_server_migration_start_cli>
operation for a given share server. This operation will start the first
phase of the migration that copies all data, from source to destination,
including all shares, their access rules and even snapshots if supported
by the driver controlling the destination host.
For all ongoing migrations, you can optionally request the current
status of a share server migration using migration_get_progress <share_server_migration_get_progress_cli>
operation to retrieve the total progress of the data copy and its
current task state. If supported by the driver, you can also cancel this
operation by issuing migration_cancel <share_server_migration_cancel_cli>
and wait until all status become active
and
available
again.
After completing the data copy, the first phase is completed and the
next operation, migration_complete <share_server_migration_complete_cli>
,
can be initiated to finish the migration. The migration_complete <share_server_migration_complete_cli>
operation usually disrupts clients access, since the export locations of
the shares will change. The new export locations will be derived from
the new share server that is provisioned at the destination, which is
instantiated with distinct network allocations.
A new field task_state
is available in the share server
model to help track which operation is being executed during this
process. The following tables show, for each phase, the expected
task_state
, along with their order of execution and a brief
description of the actions that are being executed in the back end.
Sequence | task_state | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Along with the share server migration progress (in percentage) and
the the current task state, the API also provides the destination share
server ID. Alternatively, you may check the destination share server ID
by querying the share server for a source_share_server_id
set to the ID of the share server being migrated. During the entire
migration process, the source source share server will remain with
server_migrating
status while the destination share server
will remain with server_migrating_to
status.
If an error occurs during the 1st phase of the migration, the source
share server has its status reverted to active
again, while
the destination server has its status set to error
. Both
share servers will have their task_state
updated to
migration_error
. All shares and snapshots are updated to
available
and any read-only
rules are reset to
allow writing into the shares.
Sequence | task_state | Description |
---|---|---|
|
|
|
|
|
|
After finishing the share server migration, all shares and snapshots
have their status updated to available
. The source share
server status is set to inactive
and the destination share
server to active
.
If an error occurs during the 2nd phase of the migration, both source
and destination share servers will have their status updated to
error
, along with their shares and snapshots, since it's
not possible to infer if they are working properly and the current
status of the migration. In this scenario, you will need to manually
verify the health of all share server's resources and manually fix their
statuses. Both share servers will have their task_state
set
to migration_error
.
Sequence | task_state | Description |
---|---|---|
|
|
|
|
|
|
If an error occurs during the migration cancel operation, the source
share server has its status reverted to active
again, while
the destination server has its status updated to error
.
Both share servers will have their task_state
set to
migration_error
. All shares and snapshots have their
statuses updated to available
.
Using share server migration CLI
The available commands to interact with the share server migration API are the following:
Migration check and migration start parameters
Share server migration_check <share_server_migration_check_cli>
and migration_start <share_server_migration_start_cli>
operations have specific parameters that have the semantic detailed
below. From these, only new_share_network
stands as an
optional parameter.
share_server_id
: The ID of the share server that will be migrated.destination_host
: The destination host to which the share server should be migrated to, in formathost@backend
.preserve_snapshots
: enforces when the preservation of snapshots is mandatory for the requested migration. If the destination host doesn't support it, the operation will be denied. If this parameter is set toFalse
, it will be the driver's supported capability that will define if the snapshots will be preserved or not.Note
If the driver doesn't support preserving snapshots but at least one share has a snapshot, the operation will fail and the you will need to manually remove the remaining snapshots before proceeding.
writable
: enforces whether the source share server should remain writable for the requested migration. If the destination host doesn't support it, the operation will be denied. If this parameter is set toFalse
, it will be the driver's supported capability that will define if all shares will remain writable or not.nondisruptive
: enforces whether the migration should keep clients connected throughout the migration process. If the destination host doesn't support it, the operation will be denied. If this parameter is set toFalse
, it will be the driver's supported capability that will define if all clients will remain connected or not.
In order to appropriately move a share server to a different host, it may be required to change the destination share network to be used by the new share server. In this case, a new share network can be provided using the following optional parameter:
new_share_network_id
: specifies the ID of the share network that should be used when setting up the new share server.Note
It is not possible to choose the destination share network subnet since it will be automatically selected according to the destination host's availability zone. If the new share network doesn't have a share network subnet in the destination host's availability zone or doesn't have a default subnet, the operation will fail.
Configuration
For share server migration to work it is necessary to have compatible
back end stanzas present in the manila configuration of all
manila-share
nodes.
Some drivers may provide some driver-specific configuration options
that can be changed to adapt to specific workload. Check share_drivers
documentation
for more details.
Important notes
- Once the migration of a share server has started, the user will see
that the status of all associated resources change to
server_migrating
and this will block any other share actions, such as adding or removing access rules, creating or deleting snapshots, resizing, among others. - Since this is a driver-assisted migration, there is no guarantee
that the destination share server will be cleaned up after a migration
failure. For this reason, the destination share server will be always
updated to
error
if any failure occurs. The same assumption is made for a source share server after a successful migration, where manila updates its status toinactive
to avoid being reused for new shares. - If a failure occurs during the 2nd phase of the migration, you will
need to manually identify the current status of the source share server
in order to revert it back to
active
again. If the share server and all its resources remain healthy, you will need to reset the status usingreset_status
API for each affected resource. - Each step in the migration process is saved to the field
task_state
present in the share server model. If for any reason the state is not set tomigration_error
after a failure, it will need to be reset using thereset_task_state
API, to unlock new share actions. - After a failure occurs, the destination share server will have its
status updated to
error
and will continue pointing to the original source share server. This can help you to identify the failed share servers when running multiple migrations in parallel.