rpc: Rename construct_target_node to iscsi_create_target_node
Change-Id: I638a38885a9ae93c5687d49f3bb4e23dfebdebf2 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467488 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
7d114278bc
commit
758b2f9439
@ -103,13 +103,13 @@ In addition to the configuration file, the iSCSI target may also be configured v
|
||||
|
||||
### Target nodes
|
||||
|
||||
- construct_target_node -- Add a iSCSI target node.
|
||||
- iscsi_create_target_node -- Add a iSCSI target node.
|
||||
- delete_target_node -- Delete a iSCSI target node.
|
||||
- target_node_add_lun -- Add an LUN to an existing iSCSI target node.
|
||||
- iscsi_get_target_nodes -- Show information about all available iSCSI target nodes.
|
||||
|
||||
~~~
|
||||
/path/to/spdk/scripts/rpc.py construct_target_node Target3 Target3_alias MyBdev:0 1:2 64 -d
|
||||
/path/to/spdk/scripts/rpc.py iscsi_create_target_node Target3 Target3_alias MyBdev:0 1:2 64 -d
|
||||
~~~
|
||||
|
||||
## Configuring iSCSI Initiator {#iscsi_initiator}
|
||||
@ -253,7 +253,7 @@ Finally construct one target using previously created bdevs as LUN0 (Malloc0) an
|
||||
with a name "disk1" and alias "Data Disk1" using portal group 1 and initiator group 2.
|
||||
|
||||
```
|
||||
$ ./scripts/rpc.py construct_target_node disk1 "Data Disk1" "Malloc0:0 Malloc1:1" 1:2 64 -d
|
||||
$ ./scripts/rpc.py iscsi_create_target_node disk1 "Data Disk1" "Malloc0:0 Malloc1:1" 1:2 64 -d
|
||||
```
|
||||
|
||||
#### Configure initiator
|
||||
|
@ -263,7 +263,7 @@ Example response:
|
||||
"delete_target_node",
|
||||
"delete_pg_ig_maps",
|
||||
"add_pg_ig_maps",
|
||||
"construct_target_node",
|
||||
"iscsi_create_target_node",
|
||||
"iscsi_get_target_nodes",
|
||||
"delete_initiator_group",
|
||||
"delete_initiators_from_initiator_group",
|
||||
@ -3162,7 +3162,7 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
## construct_target_node method {#rpc_construct_target_node}
|
||||
## iscsi_create_target_node method {#rpc_iscsi_create_target_node}
|
||||
|
||||
Add a iSCSI target node.
|
||||
|
||||
@ -3216,7 +3216,7 @@ Example request:
|
||||
"queue_depth": 24
|
||||
},
|
||||
"jsonrpc": "2.0",
|
||||
"method": "construct_target_node",
|
||||
"method": "iscsi_create_target_node",
|
||||
"id": 1
|
||||
}
|
||||
~~~
|
||||
|
@ -347,7 +347,7 @@ decode_rpc_pg_ig_maps(const struct spdk_json_val *val, void *out)
|
||||
sizeof(struct rpc_pg_ig_map));
|
||||
}
|
||||
|
||||
#define RPC_CONSTRUCT_TARGET_NODE_MAX_LUN 64
|
||||
#define RPC_ISCSI_CREATE_TARGET_NODE_MAX_LUN 64
|
||||
|
||||
struct rpc_lun {
|
||||
char *bdev_name;
|
||||
@ -370,7 +370,7 @@ decode_rpc_lun(const struct spdk_json_val *val, void *out)
|
||||
|
||||
struct rpc_luns {
|
||||
size_t num_luns;
|
||||
struct rpc_lun luns[RPC_CONSTRUCT_TARGET_NODE_MAX_LUN];
|
||||
struct rpc_lun luns[RPC_ISCSI_CREATE_TARGET_NODE_MAX_LUN];
|
||||
};
|
||||
|
||||
static int
|
||||
@ -379,7 +379,7 @@ decode_rpc_luns(const struct spdk_json_val *val, void *out)
|
||||
struct rpc_luns *luns = out;
|
||||
|
||||
return spdk_json_decode_array(val, decode_rpc_lun, luns->luns,
|
||||
RPC_CONSTRUCT_TARGET_NODE_MAX_LUN,
|
||||
RPC_ISCSI_CREATE_TARGET_NODE_MAX_LUN,
|
||||
&luns->num_luns, sizeof(struct rpc_lun));
|
||||
}
|
||||
|
||||
@ -433,15 +433,15 @@ static const struct spdk_json_object_decoder rpc_target_node_decoders[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_construct_target_node(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
spdk_rpc_iscsi_create_target_node(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_target_node req = {};
|
||||
struct spdk_json_write_ctx *w;
|
||||
struct spdk_iscsi_tgt_node *target;
|
||||
int32_t pg_tags[MAX_TARGET_MAP] = {0}, ig_tags[MAX_TARGET_MAP] = {0};
|
||||
char *bdev_names[RPC_CONSTRUCT_TARGET_NODE_MAX_LUN] = {0};
|
||||
int32_t lun_ids[RPC_CONSTRUCT_TARGET_NODE_MAX_LUN] = {0};
|
||||
char *bdev_names[RPC_ISCSI_CREATE_TARGET_NODE_MAX_LUN] = {0};
|
||||
int32_t lun_ids[RPC_ISCSI_CREATE_TARGET_NODE_MAX_LUN] = {0};
|
||||
size_t i;
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_target_node_decoders,
|
||||
@ -496,7 +496,8 @@ invalid:
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters");
|
||||
free_rpc_target_node(&req);
|
||||
}
|
||||
SPDK_RPC_REGISTER("construct_target_node", spdk_rpc_construct_target_node, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER("iscsi_create_target_node", spdk_rpc_iscsi_create_target_node, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_create_target_node, construct_target_node)
|
||||
|
||||
struct rpc_tgt_node_pg_ig_maps {
|
||||
char *name;
|
||||
|
@ -1580,7 +1580,7 @@ iscsi_tgt_node_config_json(struct spdk_iscsi_tgt_node *target,
|
||||
{
|
||||
spdk_json_write_object_begin(w);
|
||||
|
||||
spdk_json_write_named_string(w, "method", "construct_target_node");
|
||||
spdk_json_write_named_string(w, "method", "iscsi_create_target_node");
|
||||
|
||||
spdk_json_write_name(w, "params");
|
||||
iscsi_tgt_node_info_json(target, w);
|
||||
|
@ -26,7 +26,7 @@ iscsi_dict = OrderedDict()
|
||||
iscsi_dict["set_iscsi_options"] = []
|
||||
iscsi_dict["add_portal_group"] = []
|
||||
iscsi_dict["add_initiator_group"] = []
|
||||
iscsi_dict["construct_target_node"] = []
|
||||
iscsi_dict["iscsi_create_target_node"] = []
|
||||
|
||||
nvmf_dict = OrderedDict()
|
||||
nvmf_dict["set_nvmf_target_config"] = []
|
||||
@ -639,7 +639,7 @@ def get_iscsi_target_node_json(config, section):
|
||||
|
||||
target_json = {
|
||||
"params": params,
|
||||
"method": "construct_target_node"
|
||||
"method": "iscsi_create_target_node"
|
||||
}
|
||||
|
||||
return [target_json]
|
||||
|
@ -803,7 +803,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
help='Display target nodes')
|
||||
p.set_defaults(func=iscsi_get_target_nodes)
|
||||
|
||||
def construct_target_node(args):
|
||||
def iscsi_create_target_node(args):
|
||||
luns = []
|
||||
for u in args.bdev_name_id_pairs.strip().split(" "):
|
||||
bdev_name, lun_id = u.split(":")
|
||||
@ -814,7 +814,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
pg, ig = u.split(":")
|
||||
pg_ig_maps.append({"pg_tag": int(pg), "ig_tag": int(ig)})
|
||||
|
||||
rpc.iscsi.construct_target_node(
|
||||
rpc.iscsi.iscsi_create_target_node(
|
||||
args.client,
|
||||
luns=luns,
|
||||
pg_ig_maps=pg_ig_maps,
|
||||
@ -828,7 +828,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
header_digest=args.header_digest,
|
||||
data_digest=args.data_digest)
|
||||
|
||||
p = subparsers.add_parser('construct_target_node',
|
||||
p = subparsers.add_parser('iscsi_create_target_node', aliases=['construct_target_node'],
|
||||
help='Add a target node')
|
||||
p.add_argument('name', help='Target node name (ASCII)')
|
||||
p.add_argument('alias_name', help='Target node alias name (ASCII)')
|
||||
@ -856,7 +856,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
help='Header Digest should be required for this target node.', action='store_true')
|
||||
p.add_argument('-D', '--data-digest',
|
||||
help='Data Digest should be required for this target node.', action='store_true')
|
||||
p.set_defaults(func=construct_target_node)
|
||||
p.set_defaults(func=iscsi_create_target_node)
|
||||
|
||||
def target_node_add_lun(args):
|
||||
rpc.iscsi.target_node_add_lun(
|
||||
|
@ -152,7 +152,8 @@ def iscsi_get_target_nodes(client):
|
||||
return client.call('iscsi_get_target_nodes')
|
||||
|
||||
|
||||
def construct_target_node(
|
||||
@deprecated_alias('construct_target_node')
|
||||
def iscsi_create_target_node(
|
||||
client,
|
||||
luns,
|
||||
pg_ig_maps,
|
||||
@ -203,7 +204,7 @@ def construct_target_node(
|
||||
params['header_digest'] = header_digest
|
||||
if data_digest:
|
||||
params['data_digest'] = data_digest
|
||||
return client.call('construct_target_node', params)
|
||||
return client.call('iscsi_create_target_node', params)
|
||||
|
||||
|
||||
def target_node_add_lun(client, name, bdev_name, lun_id=None):
|
||||
|
@ -109,7 +109,7 @@ class UIISCSIDevices(UINode):
|
||||
mutual_chap = self.ui_eval_param(m, "bool", None)
|
||||
header_digest = self.ui_eval_param(h, "bool", None)
|
||||
data_digest = self.ui_eval_param(t, "bool", None)
|
||||
self.get_root().construct_target_node(
|
||||
self.get_root().iscsi_create_target_node(
|
||||
name=name, alias_name=alias_name, luns=luns,
|
||||
pg_ig_maps=pg_ig_maps, queue_depth=queue_depth,
|
||||
chap_group=chap_group, disable_chap=disable_chap,
|
||||
|
@ -383,8 +383,8 @@ class UIRoot(UINode):
|
||||
yield tg
|
||||
|
||||
@verbose
|
||||
def construct_target_node(self, **kwargs):
|
||||
rpc.iscsi.construct_target_node(self.client, **kwargs)
|
||||
def iscsi_create_target_node(self, **kwargs):
|
||||
rpc.iscsi.iscsi_create_target_node(self.client, **kwargs)
|
||||
|
||||
@verbose
|
||||
def delete_target_node(self, **kwargs):
|
||||
|
@ -492,7 +492,7 @@
|
||||
"header_digest": false,
|
||||
"queue_depth": 64
|
||||
},
|
||||
"method": "construct_target_node"
|
||||
"method": "iscsi_create_target_node"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
@ -518,7 +518,7 @@
|
||||
"header_digest": false,
|
||||
"queue_depth": 32
|
||||
},
|
||||
"method": "construct_target_node"
|
||||
"method": "iscsi_create_target_node"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
sleep 1
|
||||
trap 'killprocess $pid; rm -f $testdir/bdev.conf; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
|
||||
|
||||
|
@ -52,7 +52,7 @@ $rpc_py bdev_malloc_create -b MyBdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "0 0 0 1" ==> enable CHAP authentication using auth group 1
|
||||
$rpc_py construct_target_node Target3 Target3_alias 'MyBdev:0' $PORTAL_TAG:$INITIATOR_TAG 64 -g 1
|
||||
$rpc_py iscsi_create_target_node Target3 Target3_alias 'MyBdev:0' $PORTAL_TAG:$INITIATOR_TAG 64 -g 1
|
||||
sleep 1
|
||||
|
||||
if [ "$1" ]; then
|
||||
|
@ -87,7 +87,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py iscsi_create_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -37,7 +37,7 @@ $rpc_py bdev_error_create 'Malloc0'
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target0 Target0_alias EE_Malloc0:0 1:2 64 -d
|
||||
$rpc_py iscsi_create_target_node Target0 Target0_alias EE_Malloc0:0 1:2 64 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
@ -77,7 +77,7 @@ if [ -z "$NO_NVME" ]; then
|
||||
split_size=10000
|
||||
fi
|
||||
$rpc_py construct_split_vbdev Nvme0n1 2 -s $split_size
|
||||
$rpc_py construct_target_node Target1 Target1_alias Nvme0n1p0:0 1:2 64 -d
|
||||
$rpc_py iscsi_create_target_node Target1 Target1_alias Nvme0n1p0:0 1:2 64 -d
|
||||
fi
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -59,7 +59,7 @@ fi
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "256" ==> iSCSI queue depth 256
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target1 Target1_alias 'lvs_0/lbd_0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
$rpc_py iscsi_create_target_node Target1 Target1_alias 'lvs_0/lbd_0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -89,7 +89,7 @@ bdev=$( $rpc_py bdev_malloc_create 1024 512 )
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target3 Target3_alias "raid0:0 ${bdev}:1" $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py iscsi_create_target_node Target3 Target3_alias "raid0:0 ${bdev}:1" $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -36,7 +36,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
sleep 1
|
||||
trap 'killprocess $pid; rm -f $testdir/bdev.conf; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
|
||||
|
||||
|
@ -35,7 +35,7 @@ function rpc_config() {
|
||||
function rpc_add_target_node() {
|
||||
$rpc_py -s $1 add_ip_address 1 $MIGRATION_ADDRESS
|
||||
$rpc_py -s $1 add_portal_group $PORTAL_TAG $MIGRATION_ADDRESS:$ISCSI_PORT
|
||||
$rpc_py -s $1 construct_target_node target1 target1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py -s $1 iscsi_create_target_node target1 target1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
}
|
||||
|
||||
timing_enter ip_migration
|
||||
|
@ -62,7 +62,7 @@ for i in $(seq 1 $NUM_LVS); do
|
||||
lb_name=$($rpc_py bdev_lvol_create -u $ls_guid lbd_$j 10)
|
||||
LUNs+="$lb_name:$((j - 1)) "
|
||||
done
|
||||
$rpc_py construct_target_node Target$i Target${i}_alias "$LUNs" "1:$INITIATOR_TAG" 256 -d
|
||||
$rpc_py iscsi_create_target_node Target$i Target${i}_alias "$LUNs" "1:$INITIATOR_TAG" 256 -d
|
||||
done
|
||||
timing_exit setup
|
||||
|
||||
|
@ -63,7 +63,7 @@ done
|
||||
|
||||
for i in $(seq 1 $CONNECTION_NUMBER); do
|
||||
lun="lvs0/lbd_$i:0"
|
||||
$rpc_py construct_target_node Target$i Target${i}_alias "$lun" $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
$rpc_py iscsi_create_target_node Target$i Target${i}_alias "$lun" $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||
done
|
||||
sleep 1
|
||||
|
||||
|
@ -45,7 +45,7 @@ function run_nvme_remote() {
|
||||
if [ "$1" = "local" ]; then
|
||||
$rpc_py -s "$iscsi_rpc_addr" construct_nvme_bdev -b "Nvme0" -t "rdma" -f "ipv4" -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode1
|
||||
fi
|
||||
$rpc_py -s "$iscsi_rpc_addr" construct_target_node Target1 Target1_alias 'Nvme0n1:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py -s "$iscsi_rpc_addr" iscsi_create_target_node Target1 Target1_alias 'Nvme0n1:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
sleep 1
|
||||
|
||||
echo "Logging in to iSCSI target."
|
||||
|
@ -102,7 +102,7 @@ $rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK
|
||||
|
||||
for (( i=0; i < $DISKNO; i++ ))
|
||||
do
|
||||
$rpc_py construct_target_node Target${i} Target${i}_alias "${bdevs[i]}:0" "$PORTAL_TAG:$INITIATOR_TAG" 64 -d
|
||||
$rpc_py iscsi_create_target_node Target${i} Target${i}_alias "${bdevs[i]}:0" "$PORTAL_TAG:$INITIATOR_TAG" 64 -d
|
||||
done
|
||||
|
||||
cat $testdir/perf.job | ssh_initiator "cat > perf.job"
|
||||
|
@ -43,7 +43,7 @@ for i in $(seq 1 $TGT_NR); do
|
||||
PMEM_BDEVS+="$bdevs_name "
|
||||
luns+="$bdevs_name:$((j - 1)) "
|
||||
done
|
||||
$rpc_py construct_target_node Target$i Target${i}_alias "$luns" "1:$INITIATOR_TAG " 256 -d
|
||||
$rpc_py iscsi_create_target_node Target$i Target${i}_alias "$luns" "1:$INITIATOR_TAG " 256 -d
|
||||
done
|
||||
timing_exit setup
|
||||
sleep 1
|
||||
|
@ -72,7 +72,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target1 Target1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py iscsi_create_target_node Target1 Target1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -46,7 +46,7 @@ $rpc_py get_bdevs
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target3 Target3_alias 'Ceph0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py iscsi_create_target_node Target3 Target3_alias 'Ceph0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -43,7 +43,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
||||
# "1:2" ==> map PortalGroup1 to InitiatorGroup2
|
||||
# "64" ==> iSCSI queue depth 64
|
||||
# "-d" ==> disable CHAP authentication
|
||||
$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
$rpc_py iscsi_create_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
sleep 1
|
||||
|
||||
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
|
||||
|
@ -107,7 +107,8 @@ def verify_iscsi_connection_rpc_methods(rpc_py):
|
||||
|
||||
lun_mapping = "Malloc" + str(rpc_param['lun_total']) + ":0"
|
||||
net_mapping = portal_tag + ":" + initiator_tag
|
||||
rpc.construct_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping, net_mapping, rpc_param['queue_depth'], '-d')
|
||||
rpc.iscsi_create_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping,
|
||||
net_mapping, rpc_param['queue_depth'], '-d')
|
||||
check_output('iscsiadm -m discovery -t st -p {}'.format(rpc_param['target_ip']), shell=True)
|
||||
check_output('iscsiadm -m node --login', shell=True)
|
||||
name = json.loads(rpc.iscsi_get_target_nodes())[0]['name']
|
||||
@ -148,7 +149,8 @@ def verify_scsi_devices_rpc_methods(rpc_py):
|
||||
|
||||
lun_mapping = "Malloc" + str(rpc_param['lun_total']) + ":0"
|
||||
net_mapping = portal_tag + ":" + initiator_tag
|
||||
rpc.construct_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping, net_mapping, rpc_param['queue_depth'], '-d')
|
||||
rpc.iscsi_create_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping,
|
||||
net_mapping, rpc_param['queue_depth'], '-d')
|
||||
check_output('iscsiadm -m discovery -t st -p {}'.format(rpc_param['target_ip']), shell=True)
|
||||
check_output('iscsiadm -m node --login', shell=True)
|
||||
name = json.loads(rpc.iscsi_get_target_nodes())[0]['name']
|
||||
@ -336,7 +338,8 @@ def verify_target_nodes_rpc_methods(rpc_py, rpc_param):
|
||||
|
||||
lun_mapping = "Malloc" + str(rpc_param['lun_total']) + ":0"
|
||||
net_mapping = portal_tag + ":" + initiator_tag
|
||||
rpc.construct_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping, net_mapping, rpc_param['queue_depth'], '-d')
|
||||
rpc.iscsi_create_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping,
|
||||
net_mapping, rpc_param['queue_depth'], '-d')
|
||||
output = rpc.iscsi_get_target_nodes()
|
||||
jsonvalues = json.loads(output)
|
||||
verify(len(jsonvalues) == 1, 1,
|
||||
@ -384,7 +387,8 @@ def verify_target_nodes_rpc_methods(rpc_py, rpc_param):
|
||||
verify(not jsonvalues, 1,
|
||||
"iscsi_get_target_nodes returned {}, expected empty".format(jsonvalues))
|
||||
|
||||
rpc.construct_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping, net_mapping, rpc_param['queue_depth'], '-d')
|
||||
rpc.iscsi_create_target_node(rpc_param['target_name'], rpc_param['alias_name'], lun_mapping,
|
||||
net_mapping, rpc_param['queue_depth'], '-d')
|
||||
|
||||
rpc.delete_portal_group(portal_tag)
|
||||
rpc.delete_initiator_group(initiator_tag)
|
||||
|
@ -65,7 +65,7 @@ echo "Create bdevs and target nodes"
|
||||
CONNECTION_NUMBER=15
|
||||
for i in $(seq 0 $CONNECTION_NUMBER); do
|
||||
RPCS+="bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc$i\n"
|
||||
RPCS+="construct_target_node Target$i Target${i}_alias "Malloc$i:0" $PORTAL_TAG:$INITIATOR_TAG 256 -d\n"
|
||||
RPCS+="iscsi_create_target_node Target$i Target${i}_alias "Malloc$i:0" $PORTAL_TAG:$INITIATOR_TAG 256 -d\n"
|
||||
done
|
||||
echo -e $RPCS | $rpc_py
|
||||
|
||||
|
@ -88,7 +88,7 @@ def clear_nvmf_subsystem(args, nvmf_config):
|
||||
def get_iscsi_destroy_method(iscsi):
|
||||
destroy_method_map = {'add_portal_group': "delete_portal_group",
|
||||
'add_initiator_group': "delete_initiator_group",
|
||||
'construct_target_node': "delete_target_node",
|
||||
'iscsi_create_target_node': "delete_target_node",
|
||||
'set_iscsi_options': None
|
||||
}
|
||||
return destroy_method_map[iscsi['method']]
|
||||
@ -102,7 +102,7 @@ def get_iscsi_name(iscsi):
|
||||
|
||||
|
||||
def get_iscsi_name_key(iscsi):
|
||||
if iscsi['method'] == 'construct_target_node':
|
||||
if iscsi['method'] == 'iscsi_create_target_node':
|
||||
return "name"
|
||||
else:
|
||||
return 'tag'
|
||||
|
@ -300,7 +300,7 @@ function create_iscsi_subsystem_config() {
|
||||
tgt_rpc bdev_malloc_create 64 1024 --name MallocForIscsi0
|
||||
tgt_rpc add_portal_group $PORTAL_TAG 127.0.0.1:$ISCSI_PORT
|
||||
tgt_rpc add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK
|
||||
tgt_rpc construct_target_node Target3 Target3_alias 'MallocForIscsi0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
tgt_rpc iscsi_create_target_node Target3 Target3_alias 'MallocForIscsi0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
|
||||
timing_exit $FUNCNAME
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user