From 902a45a23c582e3f71d999145a843ad386c60bf9 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 18 Sep 2024 16:30:23 +0200 Subject: [PATCH] qa: remove all bluestore signatures on devices We must ensure BlueStore signatures are removed altogether since multiple BlueStore label replications have been introduced. Fixes: https://tracker.ceph.com/issues/68171 Signed-off-by: Guillaume Abrioux --- qa/tasks/nvme_loop.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/qa/tasks/nvme_loop.py b/qa/tasks/nvme_loop.py index 5b29c11f007cb..fef270ea0850e 100644 --- a/qa/tasks/nvme_loop.py +++ b/qa/tasks/nvme_loop.py @@ -67,6 +67,7 @@ def task(ctx, config): with contextutil.safe_while(sleep=1, tries=15) as proceed: while proceed(): + remote.run(args=['lsblk'], stdout=StringIO()) p = remote.run(args=['sudo', 'nvme', 'list', '-o', 'json'], stdout=StringIO()) new_devs = [] # `nvme list -o json` will return the following output: @@ -96,6 +97,7 @@ def task(ctx, config): vendor = device['ModelNumber'] if dev.startswith('/dev/') and vendor == 'Linux': new_devs.append(dev) + bluestore_zap(remote, dev) log.info(f'new_devs {new_devs}') assert len(new_devs) <= len(devs) if len(new_devs) == len(devs): @@ -128,3 +130,13 @@ def task(ctx, config): data=old_scratch_by_remote[remote], sudo=True ) + +def bluestore_zap(remote, device: str) -> None: + for offset in [0, 1073741824, 10737418240]: + remote.run(args=['sudo', 'dd', + 'if=/dev/zero', f'of={device}', + f'seek={offset}', 'bs=1', + 'count=4096'], stdout=StringIO()) + remote.run(args=['sudo', 'hexdump', '-n22', + '-C', f'-s{offset}', f'{device}'], + stdout=StringIO()) \ No newline at end of file -- 2.39.5