Skip to content

Commit e24c627

Browse files
authored
Merge pull request #8694 from romayalon/romy-online-upgrade-documentation
NC | Online Upgrade | Documentation
2 parents 49ad768 + 70d7d56 commit e24c627

File tree

5 files changed

+122
-16
lines changed

5 files changed

+122
-16
lines changed

docs/NooBaaNonContainerized/NooBaaCLI.md

+69-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
1. [Health](#health)
2222
2. [Metrics](#metrics)
2323
3. [Gather Logs](#gather-logs)
24-
9. [Global Options](#global-options)
25-
10. [Examples](#examples)
24+
9. [Upgrade](#upgrade)
25+
1. [Upgrade Start](#upgrade-start)
26+
2. [Upgrade Status](#upgrade-status)
27+
3. [Upgrade History](#upgrade-history)
28+
10. [Global Options](#global-options)
29+
11. [Examples](#examples)
2630
1. [Bucket Commands Examples](#bucket-commands-examples)
2731
2. [Account Commands Examples](#account-commands-examples)
2832
3. [White List Server IP Command Example](#white-list-server-ip-command-example)
@@ -458,8 +462,70 @@ noobaa-cli diagnose metrics
458462
The `gather-logs` command is used for extract NooBaa non containerized logs.
459463
Not implemented yet, running this command will fail with not implemented error.
460464

465+
## Upgrade
461466

462-
## Global Flags
467+
The `upgrade` command is being used for running config directory upgrade operations.
468+
- **[Start](#upgrade-start)**: Initiate config directory upgrade.
469+
- **[Status](#upgrade-status)**: Retrieve the in progress config directory upgrade status.
470+
- **[History](#upgrade-history)**: Retrieve the history information of past config directory upgrades.
471+
472+
For more information about the config directory upgrade, See - [Upgrade](./Upgrade.md#online-upgrade-version--5180)
473+
474+
### Upgrade Start
475+
476+
The `upgrade start` command is used to start a config directory upgrade run.
477+
478+
#### Usage
479+
```sh
480+
noobaa-cli upgrade start --expected_version <expected-version> --expected_hosts <expected-hosts> [--skip-verification] [--custom_upgrade_scripts_dir]
481+
```
482+
483+
#### Flags -
484+
- `expected_version` (Required)
485+
- Type: String
486+
- Description: Specifies the upgrade's expected target version.
487+
- Example - `--expected_version 5.18.0`
488+
489+
- `expected_hosts` (Required)
490+
- Type: String
491+
- Description: Specifies the upgrade's expected hosts. String of hostnames separated by comma (,).
492+
- Example - `--expected_hosts hostname1,hostname2,hostname3`
493+
494+
- `skip_verification`
495+
- Type: Boolean
496+
- Description: Specifies if NooBaa should skip upgrade verification. </br>
497+
The upgrade verification process contains the following checks - </br>
498+
* The expected_hosts appear in system.json.
499+
* The expected_version is the version that runs in the host that is running the upgrade.
500+
* The source code (RPM) in all the expected_hosts is upgraded to the expected_version.
501+
- **WARNING:** Can cause corrupted config directory files created by hosts running old code. This should generally not be used and is intended exclusively for NooBaa team support.
502+
503+
- `custom_upgrade_scripts_dir`
504+
- Type: String
505+
- Description: Specifies a custom upgrade scripts directory. Used for running custom config directory upgrade scripts.
506+
- **WARNING:** Can cause corrupted config directory, specifying a custom upgrade scripts directory will initiate a non NooBaa official config directory upgrade. This should generally not be used and is intended exclusively for NooBaa team support. Requires a special code fix provided by NooBaa dev team and stored in the custom_upgrade_scripts_dir.
507+
508+
### Upgrade Status
509+
510+
The `upgrade status` command is used for displaying the status of an ongoing upgrade run. </br>
511+
The available status information is upgrade start timestamp, from_version, to_version, config_dir_from_version, config_dir_to_version, running_host etc.
512+
513+
#### Usage
514+
```sh
515+
noobaa-cli upgrade status
516+
```
517+
518+
### Upgrade History
519+
520+
The `upgrade history` command is used for displaying the history information of past config directory upgrades. </br>
521+
The available history information is an array of upgrade information - upgrade start timestamp, from_version, to_version, config_dir_from_version,config_dir_to_version, running_host etc.
522+
523+
#### Usage
524+
```sh
525+
noobaa-cli upgrade history
526+
```
527+
528+
## Global Options
463529

464530
Global options used by the CLI to define the config directory settings.
465531

docs/NooBaaNonContainerized/Upgrade.md

+37-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
4. [Offline Upgrade (Version < 5.18.0)](#offline-upgrade-version--5180)
77
1. [Offline Upgrade steps](#offline-upgrade-steps)
88
5. [Online Upgrade (Version >= 5.18.0)](#online-upgrade-version--5180)
9-
9+
1. [Online Upgrade Goals](#online-upgrade-goals)
10+
2. [Online Upgrade Algorithm](#online-upgrade-algorithm)
11+
3. [Additional Upgrade Properties of `system.json`](#additional-upgrade-properties-of-systemjson)
12+
4. [Upgrade Helpers](#upgrade-helpers)
13+
5. [Config Directory Upgrade - 5.18.0](#config-directory-upgrade---5180)
1014

1115
## Introduction
1216
This document provides step-by-step instructions to help you successfully upgrade your current Upstream NooBaa RPM version to a newer version.
@@ -101,7 +105,7 @@ Online Upgrade Algorithm commands examples -
101105
4. Restart NooBaa service - `systemctl restart noobaa`
102106
5. `noobaa-cli upgrade start --expected_version=5.18.0 --expected_hosts=hostname1,hostname2,hostname3`
103107

104-
### Additional Upgrade Properties of `system.json`-
108+
### Additional Upgrade Properties of `system.json`
105109

106110
1. New per host property -
107111
- config_dir_version
@@ -229,3 +233,34 @@ Online Upgrade Algorithm commands examples -
229233
1. NooBaa Health CLI - will report on the config directory status, upgrade failures and hosts that are blocked for config directory updates.
230234
2. NooBaa CLI upgrade status - will print the upgrade status per the information written in system.json.
231235
236+
## Config Directory Upgrade - 5.18.0
237+
During the upgrade to NooBaa NC 5.18.0, NooBaa will execute an upgrade script that will convert NooBaa's config directory structure to have identities directory for storing accounts config files. The motivation for this change is to transition from an account name-based structure to an ID-based structure, which allows for greater scalability and the inclusion of additional identity types in the future. </br>
238+
For more details about the new config directory structure and components, See -
239+
1. [Config Directory Structure](./Configuration.md#configuration-directory-structure).
240+
2. [Config Directory Components](./Configuration.md#configuration-directory-components).
241+
242+
### Config Directory Upgrade Steps
243+
**1. Creation of `identities/` Directory - </br>**
244+
The identities/ directory will serve as the primary storage location for account configuration files. Each account will have a dedicated subdirectory named after its unique identifier and identity.json file that will contain the account's configuration content.
245+
246+
**2. Creation of `accounts_by_name/` directory - </br>**
247+
On some S3/CLI flows, NooBaa will search for an account by name, therefore, the accounts_by_name/ directory will be created. It will contain symbolic links that map each account name to the corresponding identity.json file under the ID-based subdirectory within identities/.
248+
249+
**3. Upgrade configuration files of all the existing accounts - </br>**
250+
Each account config file in the old `accounts/` directory will be migrated to the new structure:
251+
252+
- **Identity creation - </br>**
253+
An ID-based subdirectory will be created under `identities/`, and an `identity.json` file will contain the original account config file content. The ID is the original account's id taken from the account's config file. </br>
254+
Example of identity path - `/etc/noobaa.conf.d/identities/123456789/identity.json`
255+
256+
- **Account name symlink creation - </br>**
257+
A symbolic link will be created in the `accounts_by_name/` directory, mapping the account name to the newly created `identity.json` file under the ID-based subdirectory. </br>
258+
Example of the new account name symlink path - `/etc/noobaa.conf.d/accounts_by_name/alice.symlink -> ../../identities/123456789/identity.json`
259+
260+
- **Account access Key symlink update - </br>**
261+
Any symbolic links related to access keys will be updated to point to the new ID-based `identity.json` file. </br>
262+
Example of old (NooBaa 5.17.z or lower) access_key symlink path - `/etc/noobaa.conf.d/access_keys/AKIAIOSFODNN7EXAMPLE.symlink -> ../accounts/alice.json`. </br>
263+
Example of new (NooBaa 5.18 and higher) access_key symlink path - `/etc/noobaa.conf.d/access_keys/AKIAIOSFODNN7EXAMPLE.symlink -> ../../identities/123456789/identity.json`.
264+
265+
**4. Backup and deletion of `accounts/` directory - </br>**
266+
Once all account configurations have been migrated and verified, the `accounts/` directory will be backed-up and removed to finalize the upgrade process. A backup of the old account config files can be found under `.backup_accounts_dir_${from_version}/` while from_version is the version upgraded from.

src/manage_nsfs/manage_nsfs_help_utils.js

+13-7
Original file line numberDiff line numberDiff line change
@@ -417,19 +417,25 @@ Usage:
417417
418418
Flags:
419419
420-
--expected_version <string> The expected target version of the upgrade
421-
--expected_hosts <string> The expected hosts running NooBaa NC, a string of hosts separated by ,
422-
--skip_verification <boolean> (optional) skip verification of the hosts package version
423-
WARNING: can cause corrupted config dir files created by hosts running old code
424-
--custom_upgrade_scripts_dir <string> (optional) custom upgrade scripts dir, use for running custom config dir upgrade scripts
420+
--expected_version <string> The expected target version of the upgrade
421+
--expected_hosts <string> The expected hosts running NooBaa NC, a string of hosts separated by ,
422+
--skip_verification <boolean> (optional) skip upgrade verification
423+
WARNING: can cause corrupted config dir files created by hosts running old code.
424+
this should generally not be used and is intended exclusively for NooBaa team support.
425+
--custom_upgrade_scripts_dir <string> (optional) a custom upgrade scripts dir, use for running custom config dir upgrade scripts.
426+
WARNING: can cause corrupted config directory. specifying a custom upgrade scripts directory
427+
will initiate a non NooBaa official config directory upgrade.
428+
this should generally not be used and is intended exclusively for NooBaa team support.
429+
requires a special code fix provided by NooBaa dev team and stored in the
430+
custom_upgrade_scripts_dir directory.
425431
426432
`;
427433

428434
const UPGRADE_STATUS_OPTIONS = `
429435
Help:
430436
431437
'upgrade status' is a noobaa-cli command that will return the status of an ongoing upgrade run,
432-
the available status information is upgrade start timestmp, from_version, to_version, config_dir_from_version,
438+
the available status information is upgrade start timestamp, from_version, to_version, config_dir_from_version,
433439
config_dir_to_version, running_host etc.
434440
435441
Usage:
@@ -442,7 +448,7 @@ const UPGRADE_HISTORY_OPTIONS = `
442448
Help:
443449
444450
'upgrade history' is a noobaa-cli command that will return the history of past upgrades,
445-
the available history information is an array of upgrade information - upgrade start timestmp, from_version, to_version, config_dir_from_version,
451+
the available history information is an array of upgrade information - upgrade start timestamp, from_version, to_version, config_dir_from_version,
446452
config_dir_to_version, running_host etc.
447453
448454
Usage:

src/upgrade/nc_upgrade_manager.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ class NCUpgradeManager {
148148

149149
/**
150150
* _verify_config_dir_upgrade verifies that -
151-
* 1. All hosts appearing in system.json were RPM upgraded to the same version the host running the upgrade
151+
* 1. All hosts appearing in expected_hosts were RPM upgraded to the same version the host running the upgrade
152152
* 2. The user's expected_version is the host's package version -
153153
* expected_version is the expected source code version that the user asks to upgrade to, it's an optional verification,
154154
* if expected_version was not provided we assume that the source code on this host is
155155
* 3. The user's expected_hosts exist in system.json
156-
* 4. If there are hosts in system.json that ere not provided in the expected_hosts we will print a warning but won't fail
156+
* 4. If there are hosts in system.json thatwere not provided in the expected_hosts we will print a warning but won't fail
157157
* we do that because of hostname can be renamed, hosts that are on maintainance and we don't want to block the upgrade becuase it might take a lot of time,
158158
* or because of hosts that used to be a part of the cluster and they were removed from the cluster, we don't get the updated info of the hosts on system.json
159159
* therefore we can not treat the system.json as the source of truth of the hosts information

src/upgrade/nc_upgrade_scripts/1.0.0/config_dir_restructure.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function run({ dbg, from_version }) {
5151

5252
/**
5353
* upgrade_accounts_config_files list all old accounts and upgrade their config files by doing the following -
54-
* 1. Iterate all accounts under accounts/ (old dire
54+
* 1. Iterate all accounts under accounts/ (old directory)
5555
* 2. upgrade account config file with 3 retries
5656
* @param {import('../../../sdk/config_fs').ConfigFS} config_fs
5757
* @param {String[]} old_account_names
@@ -96,7 +96,6 @@ async function upgrade_accounts_config_files(config_fs, old_account_names, from_
9696
* 1.1. identity creation
9797
* 1.2. account name symlink creation
9898
* 1.3. account access key symlink update
99-
* 1.4. delete account old path
10099
* @param {import('../../../sdk/config_fs').ConfigFS} config_fs
101100
* @param {String} account_name
102101
* @param {String} backup_access_keys_path

0 commit comments

Comments
 (0)