From f1fcdeb341fc582480c854007d7e2b1108d30f53 Mon Sep 17 00:00:00 2001 From: Cunyin Chang Date: Mon, 10 Oct 2016 09:23:39 +0800 Subject: [PATCH] script: Add method to construct rbd bdev. Change-Id: I2c1e083628ac5a1402b8e89bdf05ca2ed55bc1a5 Signed-off-by: Cunyin Chang --- scripts/rpc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/rpc.py b/scripts/rpc.py index ffc42fa237..2c888f9b72 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -169,6 +169,20 @@ p = subparsers.add_parser('construct_nvme_bdev', help='Add bdev with nvme backen p.add_argument('pci_address', help='PCI address domain:bus:device.function') p.set_defaults(func=construct_nvme_bdev) +def construct_rbd_bdev(args): + params = { + 'pool_name': args.pool_name, + 'rbd_name': args.rbd_name, + 'size': args.size, + } + jsonrpc_call('construct_rbd_bdev', params) + +p = subparsers.add_parser('construct_rbd_bdev', help='Add a bdev with ceph rbd backend') +p.add_argument('pool_name', help='rbd pool name') +p.add_argument('rbd_name', help='rbd image name') +p.add_argument('size', help='rbd block size', type=int) +p.set_defaults(func=construct_rbd_bdev) + def set_trace_flag(args): params = {'flag': args.flag} jsonrpc_call('set_trace_flag', params)