Skip to content

Commit e5a9cda

Browse files
committed
qa/suites/nvmeof/basic: add nvmeof_scalability test
Add test to upscale/downscale nvmeof gateways. Signed-off-by: Vallari Agrawal <[email protected]>
1 parent 58d8be9 commit e5a9cda

File tree

5 files changed

+84
-5
lines changed

5 files changed

+84
-5
lines changed

qa/suites/nvmeof/basic/base/install.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ tasks:
33
- install:
44
extra_packages:
55
- nvme-cli
6-
- cephadm:
7-
watchdog_setup:
6+
- cephadm:
87
- cephadm.shell:
98
host.a:
109
# get state before nvmeof deployment

qa/suites/nvmeof/basic/workloads/nvmeof_namespaces.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ tasks:
3535
env:
3636
RBD_POOL: mypool
3737
IOSTAT_INTERVAL: '10'
38-
RUNTIME: '600'
38+
RUNTIME: '120'
3939
NEW_NAMESPACES_COUNT: '5'
40-
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
tasks:
2+
- nvmeof:
3+
client: client.0
4+
gw_image: quay.io/ceph/nvmeof:1.2 # "default" is the image cephadm defaults to; change to test specific nvmeof images, example "latest"
5+
rbd:
6+
pool_name: mypool
7+
image_name_prefix: myimage
8+
gateway_config:
9+
subsystems_count: 3
10+
namespaces_count: 20
11+
cli_image: quay.io/ceph/nvmeof-cli:1.2
12+
13+
- cephadm.wait_for_service:
14+
service: nvmeof.mypool
15+
16+
- workunit:
17+
no_coverage_and_limits: true
18+
timeout: 30m
19+
clients:
20+
client.2:
21+
- rbd/nvmeof_setup_subsystem.sh
22+
- rbd/nvmeof_basic_tests.sh
23+
- rbd/nvmeof_fio_test.sh --rbd_iostat
24+
env:
25+
RBD_POOL: mypool
26+
RBD_IMAGE_PREFIX: myimage
27+
IOSTAT_INTERVAL: '10'
28+
RUNTIME: '60'
29+
30+
- workunit:
31+
no_coverage_and_limits: true
32+
timeout: 30m
33+
clients:
34+
client.2:
35+
- rbd/nvmeof_scalability_test.sh nvmeof.a
36+
- rbd/nvmeof_scalability_test.sh nvmeof.b
37+
env:
38+
SCALING_DELAYS: '50'
39+

qa/tasks/nvmeof.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
log = logging.getLogger(__name__)
1818

1919
conf_file = '/etc/ceph/nvmeof.env'
20-
20+
gw_yaml_file = '/etc/ceph/nvmeof-gw.yaml'
2121

2222
class Nvmeof(Task):
2323
"""
@@ -139,6 +139,9 @@ def deploy_nvmeof(self):
139139

140140
for role, i in daemons.items():
141141
remote, id_ = i
142+
_shell(self.ctx, self.cluster_name, remote, [
143+
'ceph', 'orch', 'ls', 'nvmeof', '--export', run.Raw('>'), gw_yaml_file
144+
])
142145
self.ctx.daemons.register_daemon(
143146
remote, 'nvmeof', id_,
144147
cluster=self.cluster_name,
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash -xe
2+
3+
4+
GATEWAYS=$1 # exmaple "nvmeof.a,nvmeof.b"
5+
DELAY="${SCALING_DELAYS:-50}"
6+
7+
if [ -z "$GATEWAYS" ]; then
8+
echo "At least one gateway needs to be defined for scalability test"
9+
exit 1
10+
fi
11+
12+
pip3 install yq
13+
14+
status_checks() {
15+
ceph nvme-gw show mypool ''
16+
ceph orch ls
17+
ceph orch ps
18+
ceph -s
19+
}
20+
21+
22+
echo "[nvmeof.scale] Setting up config to remove gateways ${GATEWAYS}"
23+
ceph orch ls nvmeof --export > /tmp/nvmeof-gw.yaml
24+
cat /tmp/nvmeof-gw.yaml
25+
yq "del(.placement.hosts[] | select(. | test(\".*($(echo $GATEWAYS | sed 's/,/|/g'))\")))" /tmp/nvmeof-gw.yaml > /tmp/nvmeof-gw-new.yaml
26+
cat /tmp/nvmeof-gw-new.yaml
27+
28+
echo "[nvmeof.scale] Starting scale testing by removing ${GATEWAYS}"
29+
status_checks
30+
ceph orch rm nvmeof.mypool && sleep 20 # temp workaround
31+
ceph orch apply -i /tmp/nvmeof-gw-new.yaml # downscale
32+
sleep $DELAY
33+
status_checks
34+
ceph orch rm nvmeof.mypool && sleep 20 # temp workaround
35+
ceph orch apply -i /tmp/nvmeof-gw.yaml #upscale
36+
sleep $DELAY
37+
status_checks
38+
39+
echo "[nvmeof.scale] Scale testing passed for ${GATEWAYS}"

0 commit comments

Comments
 (0)