Workload Import & Migration
Each Trilio Workload has a dedicated owner. The ownership of a Workload is defined by:
OpenStack User - The OpenStack User-ID is assigned to a Workload
OpenStack Project - The OpenStack Project-ID is assigned to a Workload
OpenStack Cloud - The Trilio Serviceuser-ID is assigned to a Workload
This ownership secures, that only the owners of a Workload are able to work with it.
OpenStack Administrators can reassign Workloads or reimport Workloads from older Trilio installations.
Import workloads
Workload import allows to import Workloads existing on the Backup Target into the Trilio database.
The Workload import is designed to import Workloads, which are owned by the Cloud.
It will not import or list any Workloads that are owned by a different cloud.
workload-get-importworkloads-list
DEPRECATED: use workload-get-import-reassign-list instead.
To get a list of importable Workloads use the following CLI command:
workloadmgr workload-get-importworkloads-list [--project-id <project-id>]
[--source-bt <source-bt> [<source-bt> ...]]--project-id <project-id>➡️ List workloads belonging to the given project only. If not provided, all importable workloads are considered.--source-bt <source-bt> [<source-bt> ...]➡️ List workloads belonging to the given backup target(s) only. If not provided, all available Backup Targets are considered.
workload-importworkloads
DEPRECATED: use workload-import-reassign instead.
To import Workloads into the Trilio database use the following CLI command:
--workload-ids <workload_ids> [<workload_ids> ...]➡️ Specify workload ids to import only the specified workloads. If not provided, all available workloads from the source Backup Target Type are imported.--source-btt <source-btt> [<source-btt> ...]➡️ Search workloads in the given Backup Target Type ids. If not provided, the default Backup Target Type is considered. Only a single--source-bttis allowed when--workload-idsis provided.--target-btt <target-btt>➡️ Backup Target Type id to assign the imported workloads to. If not provided, the workload's original Backup Target Type is used. Warning: if the Backup Target Type of a workload changes, its snapshots are not imported and the next snapshot will be a full snapshot in the newly assigned Backup Target Type.--source-btt-all➡️ Search in all Backup Target Types. Only allowed when--workload-idsis NOT provided.--inplace-upgrade➡️ DEPRECATED. Update all workload and policy records in the database to the current release version instead of importing. Please use the newly added workload-inplace-db-upgrade command instead.
The command returns a JOB-ID; track the progress with job-detail-show.
Orphaned Workloads
DEPRECATED: use workload-get-import-reassign-list with --orphaned instead. The former --generate_yaml option has been replaced by job-detail-show --generate-yaml.
The definition of an orphaned Workload is from the perspective of a specific Trilio installation. Any workload that is located on the Backup Target Storage, but whose owning tenant/user is not valid in the current cloud, is considered orphaned.
Further is to divide between Workloads that were previously owned by Projects/Users in the same cloud or are migrated from a different cloud.
The following CLI command provides the list of orphaned workloads:
--migrate_cloud {True,False}➡️ Set to True if you want to list workloads from other clouds as well. Default is False.
Reassigning Workloads
OpenStack administrators are able to reassign a Workload to a new owner. This involves the possibility to migrate a Workload from one cloud to another or between projects.
DEPRECATED: use workload-import-reassign instead.
Reassigning a workload only changes the database of the target Trilio installation. When the Workload was managed before by a different Trilio installation, will that installation not be updated.
Use the following CLI command to reassign a Workload:
--old_tenant_ids <old_tenant_id>➡️ Specify old tenant ids from which workloads need to be reassigned to the new tenant. Specify multiple times to choose Workloads from multiple tenants.--new_tenant_id <new_tenant_id>➡️ Specify the new tenant id to which the workloads need to be reassigned. Only one target tenant can be specified. Required (together with--user_id) unless--map_fileis used.--workload-ids <workload_ids> [<workload_ids> ...]➡️ Specify workload ids that need to be reassigned to the new tenant. If not provided, all the workloads from the old tenant get reassigned to the new tenant.--user_id <user_id>➡️ Specify the user id to which the workloads need to be reassigned. Only one target user can be specified.--migrate_cloud {True,False}➡️ Set to True if you want to reassign workloads from other clouds as well. Default is False.--source-btt <source-btt> [<source-btt> ...]➡️ Search workloads in the given Backup Target Type ids. If not provided, the default Backup Target Type is considered. Only a single--source-bttis allowed when--workload-idsis provided.--source-btt-all➡️ Search in all Backup Target Types. Only allowed when--workload-idsis NOT provided.--old_tenant_idsand--new_tenant_idmust be provided to use it.--map_file <map_file>➡️ Path (relative or absolute) to a reassign map file in YAML format, listing old workloads mapped to new tenants. See the sample mapping file.
Unified Import and Reassign workflow
Workload import, workload reassignment and orphaned workload discovery are combined into a single, job-based Import & Reassign workflow. All operations run asynchronously: each command returns a JOB-ID and the results or progress of the operation are fetched with workloadmgr job-detail-show <job-id>.
The workflow consists of the following steps:
Discover the workloads available for import and/or reassignment using
workloadmgr workload-get-import-reassign-list. The command returns aJOB-ID.Inspect the discovery results using
workloadmgr job-detail-show <job-id>. Add--generate-yamlto produce a pre-filled reassign map file.Execute the import/reassign operation using
workloadmgr workload-import-reassign. The command returns one or moreJOB-IDs.Track the operation with
workloadmgr job-detail-show <job-id>. Jobs can be listed withworkloadmgr job-listand cleaned up withworkloadmgr job-delete.
workload-get-import-reassign-list
The unified list command discovers all workloads on the Backup Target(s) that can be imported into the Trilio database or reassigned to a new owner.
--old-tenant-ids <old_tenant_id> [<old_tenant_id> ...]➡️ List workloads belonging to the given old tenant ids. Mutually exclusive with--orphaned.--orphaned➡️ Discover orphaned workloads (workloads whose tenant/user is not valid in the current cloud) without specifying any ids. Mutually exclusive with--old-tenant-ids. Combine with--migrate-cloudto also discover orphaned workloads on other clouds' backup targets. This replaces the deprecatedworkload-get-orphaned-workloads-listcommand.--source-btt <source-btt> [<source-btt> ...]➡️ Search workloads in the given Backup Target Type ids only. Mutually exclusive with--source-btt-all. If neither is provided, the default Backup Target Type is considered.--source-btt-all➡️ Search in all Backup Target Types. Mutually exclusive with--source-btt.--migrate-cloud➡️ Include workloads owned by other clouds as well. Default is False.
At least one of --old-tenant-ids, --orphaned, --source-btt or --source-btt-all must be provided.
The command returns a JOB-ID:
job-detail-show
<jobid>➡️ The job id returned by any Import & Reassign command.--generate-yaml➡️ For a discovery job (list_import_reassign), write areassign_map.yamlpre-filled with the discovered workload ids to the system temporary directory. Fill in thenew_tenant_id/user_id/source_bttplaceholders and feed the file back viaworkloadmgr workload-import-reassign --map-file. This replaces the deprecatedworkload-get-orphaned-workloads-list --generate_yamloutput.--output <output>➡️ Optional file path to save a downloadable artifact produced by other job types (e.g. the tenants-chargeback CSV job). Not used for Import & Reassign jobs.
For a discovery job the output contains the job header and, per Backup Target Type searched, the discovered workloads:
workload_to_import➡️ Workloads found on the Backup Target that are not known to this Trilio installation. These will be imported.workload_to_reassign➡️ Workloads that already exist in the Trilio database. These will only be reassigned to the new owner.source_btt➡️ The Backup Target Type id the workloads were found in.current_cloud➡️ Whether the workload's owning tenant belongs to the current cloud. If False,--migrate-cloudis required to import/reassign it.error_message➡️ Any error hit while listing the workloads of this Backup Target Type.
For an import/reassign operation job the output contains the job header followed by the progress of the reassigned workloads (workload_to_update, updated_workloads, source_btt, error_message) and of the imported workloads (workload_to_import, source_btt, error_message, wl_import_job_id, wl_import_job_details).
workload-import-reassign
The unified operation imports workloads from the Backup Target and, when a reassignment target is provided, reassigns them to that tenant/user.
--workload-ids <workload_ids> [<workload_ids> ...]➡️ Specify workload ids to import/reassign. Mutually exclusive with--old-tenant-ids.--old-tenant-ids <old_tenant_ids> [<old_tenant_ids> ...]➡️ Specify old tenant ids whose workloads need to be imported/reassigned. Mutually exclusive with--workload-ids.--new-tenant-id <new_tenant_id>➡️ Optional. New tenant id to reassign the workloads to. If set,--user-idis required. When omitted, the command performs a pure import and the workloads keep their original owner.--user-id <user_id>➡️ Optional. User id to reassign the workloads to. Required when--new-tenant-idis provided. The user must exist in the new tenant and hold the trustee role.--migrate-cloud➡️ Include workloads from other clouds as well. Default is False.--source-btt <source-btt> [<source-btt> ...]➡️ Search workloads in the given Backup Target Type ids. If not provided, the default Backup Target Type is considered. Multiple values are allowed, including together with--workload-ids; when a workload exists in more than one Backup Target Type, the latest copy is imported.--source-btt-all➡️ Search in all Backup Target Types. Not allowed together with--workload-ids. Mutually exclusive with--source-btt.--target-btt <target-btt>➡️ Backup Target Type id to assign the imported workloads to. If not provided, the workload's original Backup Target Type is used.--map-file <map_file>➡️ Path (relative or absolute) to a YAML reassign map file describing multiple mappings in one call. Mutually exclusive with--workload-ids,--old-tenant-ids,--new-tenant-idand--user-id; the remaining options are ignored, as each mapping in the file carries its own values.
One of --workload-ids, --old-tenant-ids or --map-file must be provided.
If --target-btt changes the Backup Target Type of a workload, its existing snapshots are not imported and the next snapshot in the newly assigned Backup Target Type will be a full snapshot.
The command prints workloads that failed validation, workloads that were reassigned immediately (already present in the database) and the JOB-IDs of the asynchronous import operations:
A sample mapping file with explanations is shown below. The easiest way to produce one is workloadmgr job-detail-show <jobid> --generate-yaml on a discovery job:
job-list
All jobs created by the Import & Reassign workflow (and every other job type job-detail-show can render) can be listed, newest first and paginated:
--limit <limit>➡️ Maximum number of jobs to return.--marker <marker>➡️ Return jobs older than (with a job id less than) this job id. Use the last job id of the previous page to fetch the next page.--action <action>➡️ Narrow to the given job action(s). Repeat the option to pass several. If not provided, all job types are listed. One of:import_workloads,list_importable_workloads,inplace_upgrade_db_records,tenants-chargeback-csv,list_import_reassign,list_reassign_workloads,import_reassign,workload_reassign.
The Import & Reassign workflow uses the actions list_import_reassign (discovery jobs) and import_reassign (operation jobs).
job-delete
Job records that are no longer needed can be deleted in bulk:
<jobid> [<jobid> ...]➡️ One or more job ids to delete (space separated for bulk deletion). Deleting a job also removes its detail records.
workload-inplace-db-upgrade
After upgrading Trilio, existing workload and policy database records can be converted to the current release schema without re-importing them:
The command takes no arguments and runs cloud-wide across all backup targets: it converts old policy and workload job-schedule fields to the current schema and refreshes each workload's backup-target-type metadata. It returns a JOB-ID; track the progress with job-detail-show. This replaces the deprecated workload-importworkloads --inplace-upgrade option.
Reassigning workloads on immutable backup targets
Note:- We cannot reassign the immutable backup target workload from one cloud to another. To do this, we need to follow the steps outlined below
Steps:-
Download the immutable workload directory from its mount path and upload/copy it to the non-immutable backup target mount path.
We need to update the backup_target_types and backup_media_target metadata property of the workload and all it’s snapshots at backup target to the current backup target where it exists. Here reference Please perform following steps to accomplish the task.
Check the original backup_target_types and backup_media_target metadata property of the workload using either less or jq command. If you already knows this information then you may skip this step.
Find & replace the backup_target_types property of the workload and it’s all respective snapshots
Find & replace the backup_media_target property of the workload and it’s all respective snapshots
Verify the changes
Now try reassigning the workload.
Last updated
Was this helpful?
