| 1 |
============= |
| 2 |
cyborg-dbsync |
| 3 |
============= |
| 4 |
|
| 5 |
Synopsis |
| 6 |
======== |
| 7 |
|
| 8 |
:: |
| 9 |
|
| 10 |
cyborg-dbsync <command> [<args>] |
| 11 |
|
| 12 |
Description |
| 13 |
=========== |
| 14 |
|
| 15 |
:program:`cyborg-dbsync` is a tool for managing the Cyborg database schema |
| 16 |
and performing data migrations. |
| 17 |
|
| 18 |
Options |
| 19 |
======= |
| 20 |
|
| 21 |
The standard pattern for executing a :program:`cyborg-dbsync` command is:: |
| 22 |
|
| 23 |
cyborg-dbsync <command> [<args>] |
| 24 |
|
| 25 |
Run without arguments to see a list of available commands:: |
| 26 |
|
| 27 |
cyborg-dbsync |
| 28 |
|
| 29 |
Commands are: |
| 30 |
|
| 31 |
* ``upgrade`` |
| 32 |
* ``revision`` |
| 33 |
* ``stamp`` |
| 34 |
* ``version`` |
| 35 |
* ``create_schema`` |
| 36 |
* ``online_data_migrations`` |
| 37 |
|
| 38 |
Detailed descriptions are below. |
| 39 |
|
| 40 |
``cyborg-dbsync upgrade`` |
| 41 |
Upgrade the database schema to the latest version. Optionally, use |
| 42 |
``--revision`` to specify an alembic revision string to upgrade to. |
| 43 |
|
| 44 |
``cyborg-dbsync revision`` |
| 45 |
Create a new alembic revision. Use ``-m`` or ``--message`` to set the |
| 46 |
message string. |
| 47 |
|
| 48 |
``cyborg-dbsync stamp`` |
| 49 |
Stamp the database with a specific alembic revision. |
| 50 |
|
| 51 |
``cyborg-dbsync version`` |
| 52 |
Print the current database version information and exit. |
| 53 |
|
| 54 |
``cyborg-dbsync create_schema`` |
| 55 |
Create the database schema. |
| 56 |
|
| 57 |
``cyborg-dbsync online_data_migrations`` |
| 58 |
Perform online data migrations. Currently backfills the ``project_id`` |
| 59 |
column on existing accelerator requests (ARQs) by querying Nova for |
| 60 |
the project that owns each bound instance. |
| 61 |
|
| 62 |
This command should be run after upgrading Cyborg to ensure that all |
| 63 |
ARQs have a correct ``project_id`` value. The cyborg-conductor service |
| 64 |
also runs this migration automatically on startup, but the CLI command |
| 65 |
allows operators to perform the migration at a convenient time and |
| 66 |
monitor progress. |
| 67 |
|
| 68 |
**Prerequisites** |
| 69 |
|
| 70 |
* Cyborg must be configured with a valid OpenStack SDK compute |
| 71 |
adapter (the ``[nova]`` group: auth URL, credentials, and region) |
| 72 |
so ``cyborg-dbsync`` can call the Nova API to resolve instance |
| 73 |
ownership. This is independent of ``[keystone_authtoken]``, which |
| 74 |
only applies to validating incoming API requests to Cyborg. |
| 75 |
* Nova must be running and accessible. |
| 76 |
|
| 77 |
**Return codes** |
| 78 |
|
| 79 |
The command prints the number of ARQs migrated and exits with code 0 |
| 80 |
on success. |