13111: Fix nil pointer dereference at sitefs root.
[arvados.git] / doc / admin / merge-remote-account.html.textile.liquid
1 ---
2 layout: default
3 navsection: userguide
4 title: "Merging a remote account"
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 When you use federation capabilities to connect two or more clusters that were already operating, some users might already have accounts on multiple clusters. Typically, they will want to choose a single account on one of the clusters and abandon the rest, transferring all data or permissions from their old “remote” accounts to a single “home” account.
13
14 This effect can be achieved by changing the UUIDs of the user records on the remote clusters. This should be done before the user has ever used federation features to access cluster B with cluster A credentials. Otherwise, see "managing conflicting accounts" below.
15
16 For example, a user might have:
17 * an account A on cluster A with uuid @aaaaa-tpzed-abcdefghijklmno@, and
18 * an account B on cluster B with uuid @bbbbb-tpzed-lmnopqrstuvwxyz@
19
20 An administrator at cluster B can merge the two accounts by renaming account B to account A.
21
22 <notextile>
23 <pre><code>#!/usr/bin/env python
24 import arvados
25 arvados.api('v1').users().update_uuid(
26     uuid="<span class="userinput">bbbbb-tpzed-lmnopqrstuvwxyz</span>",
27     new_uuid="<span class="userinput">aaaaa-tpzed-abcdefghijklmno</span>").execute()
28 </code></pre></notextile>
29
30 This should be done when the user is idle, i.e., not logged in and not running any jobs or containers.
31
32 h2. Managing conflicting accounts
33
34 If the user has already used federation capabilities to access cluster B using account A before the above migration has been done, this will have already created a database entry for account A on cluster B, and the above program will error out. To fix this, the same "update_uuid API call":../api/methods/users.html#update_uuid can be used to move the conflicting account out of the way first.
35
36 <notextile>
37 <pre><code>#!/usr/bin/env python
38 import arvados
39 import random
40 import string
41 random_chars = ''.join(random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(15))
42 arvados.api('v1').users().update_uuid(
43     uuid="<span class="userinput">aaaaa-tpzed-abcdefghijklmno</span>",
44     new_uuid="bbbbb-tpzed-"+random_chars).execute()
45 </code></pre></notextile>