Skip to content

Commit

Permalink
librbd/migration: add external clusters support
Browse files Browse the repository at this point in the history
This commits extends NativeFormat
(aka migration where the migration source is an RBD image)
to support external Ceph clusters.

Signed-off-by: Or Ozeri <[email protected]>
  • Loading branch information
orozery committed Jan 6, 2022
1 parent 1b4ff8d commit 72c3dc0
Show file tree
Hide file tree
Showing 21 changed files with 188 additions and 35 deletions.
2 changes: 2 additions & 0 deletions doc/rbd/rbd-live-migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ as follows::

{
"type": "native",
["cluster_name": "<cluster-name",] (optional, for external clusters)
["client_name": "<client-name",] (optional, for external clusters)
"pool_name": "<pool-name>",
["pool_id": <pool-id>,] (optional alternative to "pool_name")
["pool_namespace": "<pool-namespace",] (optional)
Expand Down
Empty file.
1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/.qa
9 changes: 9 additions & 0 deletions qa/suites/rbd/migration-external/01-base/install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
meta:
- desc: run two ceph clusters
tasks:
- install:
- ceph:
cluster: cluster1
- ceph:
cluster: cluster2

1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/02-cluster/.qa
17 changes: 17 additions & 0 deletions qa/suites/rbd/migration-external/02-cluster/2-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
meta:
- desc: 2 ceph clusters with 1 mon and 3 osds each
roles:
- - cluster1.mon.a
- cluster1.mgr.x
- cluster2.mgr.x
- cluster1.osd.0
- cluster1.osd.1
- cluster1.osd.2
- cluster1.client.0
- cluster2.client.0
- - cluster2.mon.a
- cluster2.osd.0
- cluster2.osd.1
- cluster2.osd.2
- cluster2.client.migrator

1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/03-objectstore
1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/04-msgr-failures
1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/06-clients/.qa
18 changes: 18 additions & 0 deletions qa/suites/rbd/migration-external/06-clients/migrator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
meta:
- desc: configure the permissions for client.migrator
overrides:
ceph:
conf:
client:
rbd default features: 125
debug rbd: 20
log to stderr: false
# override to make these names predictable
client.migrator:
admin socket: /var/run/ceph/rbd-migration.$cluster-$name.asok
pid file: /var/run/ceph/rbd-migration.$cluster-$name.pid
tasks:
- exec:
cluster2.client.migrator:
- "sudo ceph --cluster cluster2 auth caps client.migrator mon 'profile rbd' osd 'profile rbd-read-only'"

1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/07-prepare/.qa
11 changes: 11 additions & 0 deletions qa/suites/rbd/migration-external/07-prepare/native.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tasks:
- exec:
cluster2.client.0:
- echo '{"type":"qcow","stream":{"type":"http","url":"http://download.ceph.com/qa/ubuntu-12.04.qcow2"}}' | rbd --cluster cluster2 migration prepare --import-only --source-spec-path - client.0.0
- rbd --cluster cluster2 migration execute client.0.0
- rbd --cluster cluster2 migration commit client.0.0
- rbd --cluster cluster2 snap create client.0.0@snap
- exec:
cluster1.client.0:
- echo '{"type":"native","cluster_name":"cluster2","client_name":"client.migrator","pool_name":"rbd","image_name":"client.0.0","snap_name":"snap"}' | valgrind rbd --cluster cluster1 migration prepare --import-only --source-spec-path - client.0.0

1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/08-io-workload/.qa
17 changes: 17 additions & 0 deletions qa/suites/rbd/migration-external/08-io-workload/qemu_xfstests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
io_workload:
sequential:
- ceph:
cluster: cluster1
- qemu:
cluster1.client.0:
clone: true
type: block
disks:
- action: none
image_name: client.0.0
- action: create
image_name: client.0.1
- action: create
image_name: client.0.2
test: qa/run_xfstests_qemu.sh
exclude_arch: armv7l
1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/09-migrate-workload/.qa
12 changes: 12 additions & 0 deletions qa/suites/rbd/migration-external/09-migrate-workload/execute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tasks:
- parallel:
- io_workload
- migrate_workload
migrate_workload:
sequential:
- exec:
cluster1.client.0:
- sleep 60
- rbd --cluster cluster1 migration execute client.0.0
- sleep 60
- rbd --cluster cluster1 migration commit client.0.0
1 change: 1 addition & 0 deletions qa/suites/rbd/migration-external/10-cleanup/.qa
6 changes: 6 additions & 0 deletions qa/suites/rbd/migration-external/10-cleanup/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tasks:
- exec:
cluster2.client.0:
- rbd --cluster cluster2 snap remove client.0.0@snap || true
- rbd --cluster cluster2 migration abort client.0.0 || true
- rbd --cluster cluster2 rm client.0.0 || true
Loading

0 comments on commit 72c3dc0

Please sign in to comment.