@@ -261,6 +261,25 @@ def __init__(self):
261
261
sub_command = self .add_sub_command (subparser , 'dump-lvstore' ,'Dump lvstore data' )
262
262
sub_command .add_argument ("id" , help = 'UUID of storage node' ).completer = self ._completer_get_sn_list
263
263
264
+
265
+ # S3 bdev for tiering
266
+
267
+ sub_command = self .add_sub_command (subparser , 's3-bdev-create' , 'Create a local S3 bdev for tiering (otherwise can connect to an existing remote one over fabric)' )
268
+ sub_command .add_argument ("id" , help = 'UUID of storage node' ).completer = self ._completer_get_sn_list
269
+ sub_command .add_argument ("--name" , 'S3 bdev name' , type = str )
270
+ sub_command .add_argument ("--bdb-lcpu-mask" , 'S3 bdev SPDK thread mask' , type = int , default = 0 )
271
+ sub_command .add_argument ("--s3-lcpu-mask" , 'S3 bdev worker pthread mask' , type = int , default = 0 )
272
+ sub_command .add_argument ("--s3-thread-pool-size" , 'S3 bdev worker pthread pool size' , type = int , default = 32 )
273
+
274
+ sub_command = self .add_sub_command (subparser , 's3-bdev-delete' , 'Delete a local S3 bdev' )
275
+ sub_command .add_argument ("id" , help = 'UUID of storage node' ).completer = self ._completer_get_sn_list
276
+ sub_command .add_argument ("--name" , 'S3 bdev name' , type = str )
277
+
278
+ sub_command = self .add_sub_command (subparser , 's3-bdev-add-bucket-name' , 'Register a bucket name in the local S3 bdev if a bucket was newly added to the S3 endpoint' )
279
+ sub_command .add_argument ("id" , help = 'UUID of storage node' ).completer = self ._completer_get_sn_list
280
+ sub_command .add_argument ("--name" , 'S3 bdev name' , type = str )
281
+ sub_command .add_argument ("--bucket-name" , 'S3 bucket name' , type = str )
282
+
264
283
# check lvol
265
284
#
266
285
# ----------------- cluster -----------------
@@ -342,6 +361,11 @@ def __init__(self):
342
361
sub_command .add_argument ("--support-storage-tiering" , help = "Whether to support storage tiering" , type = bool , default = False )
343
362
sub_command .add_argument ("--disaster-recovery" , help = "AZ disaster recovery mode" , type = bool , default = False )
344
363
364
+ # toggle disaster recovery status
365
+ sub_command = self .add_sub_command (subparser , 'toggle-disaster-recovery-status' , 'Toggle AZ disaster recovery status' )
366
+ sub_command .add_argument ("cluster_id" , help = 'the cluster UUID' ).completer = self ._completer_get_cluster_list
367
+ sub_command .add_argument ("--disaster-recovery" , help = "AZ disaster recovery status" , type = bool )
368
+
345
369
# Activate cluster
346
370
sub_command = self .add_sub_command (subparser , 'activate' , 'Create distribs and raid0 bdevs on all the storage node and move the cluster to active state' )
347
371
sub_command .add_argument ("cluster_id" , help = 'the cluster UUID' ).completer = self ._completer_get_cluster_list
@@ -474,7 +498,7 @@ def __init__(self):
474
498
sub_command .add_argument ("--force-fetch" , help = "fetches are forced" , type = bool , default = False )
475
499
sub_command .add_argument ("--sync-fetch" , help = "reads require synchronous fetches" , type = bool , default = True )
476
500
sub_command .add_argument ("--pure-flush-or-evict" , help = "pure flush or evict" , type = bool , default = False )
477
- sub_command .add_argumetn ("--not-evict-blob-md" , help = "what to do with blob md" , type = int , default = 0 )
501
+ sub_command .add_argument ("--not-evict-blob-md" , help = "what to do with blob md" , type = int , default = 0 )
478
502
sub_command .add_argument ("--namespace" , help = 'Set LVol namespace for k8s clients' )
479
503
sub_command .add_argument ("--uid" , help = 'Set LVol UUID' )
480
504
sub_command .add_argument ("--pvc_name" , help = 'Set LVol PVC name for k8s clients' )
@@ -503,7 +527,27 @@ def __init__(self):
503
527
sub_command .add_argument ("--clear-method" , help = "any valid clear method" , type = int )
504
528
sub_command .add_argument ("--id-of-blob-to-recover" , help = "id of the original snapshot blob" , type = int )
505
529
506
- # snapshot restore
530
+ # set lvol tiering modes
531
+ sub_command = self .add_sub_command (subparser , 'set-tiering-modes' , 'Set tiering modes of an lvol' )
532
+ sub_command .add_argument ("--is-tiered" , help = "sends tiered I/O" , type = bool )
533
+ sub_command .add_argument ("--force-fetch" , help = "fetches are forced" , type = bool )
534
+ sub_command .add_argument ("--sync-fetch" , help = "reads require synchronous fetches" , type = bool )
535
+ sub_command .add_argument ("--pure-flush-or-evict" , help = "pure flush or evict" , type = bool )
536
+ #sub_command.add_argument("--not-evict-blob-md", help="what to do with blob md", type=int)
537
+
538
+ # update page list capacities
539
+ sub_command = self .add_sub_command (subparser , 'set-distr-cache-capacities' , 'Set storage tiering page list capacities of a distrib' )
540
+ sub_command .add_argument ("--lvol-uuid" , help = "lvol uuid" , type = str )
541
+ sub_command .add_argument ("--distr-name" , help = "distrib bdev name" , type = str )
542
+ sub_command .add_argument ("--ghost-capacity" , help = "ghost queue capacity" , type = str )
543
+ sub_command .add_argument ("--fifo-main-capacity" , help = "main fifo queue capacity" , type = str )
544
+ sub_command .add_argument ("--fifo-small-capacity" , help = "small fifo queue capacity" , type = str )
545
+
546
+ # update secondary I/O timeout value
547
+ sub_command = self .add_sub_command (subparser , 'set-distr-secondary-io-timeout' , 'Set secondary stg I/O timeout in us for a distrib' )
548
+ sub_command .add_arugment ("--lvol-uuid" , help = "lvol uuid" , type = str )
549
+ sub_command .add_argument ("--distr-name" , help = "distrib bdev name" , type = str )
550
+ sub_command .add_argument ("--secondary-io-timeout-us" , help = "secondary stg I/O timeout in us" , type = int )
507
551
508
552
# set lvol params
509
553
sub_command = self .add_sub_command (subparser , 'qos-set' , 'Change qos settings for an active logical volume' )
@@ -593,8 +637,7 @@ def __init__(self):
593
637
sub_command = self .add_sub_command (subparser , 'inflate' , 'Inflate a logical volume' ,
594
638
usage = 'All unallocated clusters are allocated and copied from the parent or zero filled if not allocated in the parent. '
595
639
'Then all dependencies on the parent are removed.' )
596
- sub_command .add_argument ("lvol_id" , help = 'cloned lvol id' )
597
-
640
+ sub_command .add_argument ("lvol_id" , help = 'cloned lvol id' )
598
641
# mgmt-node ops
599
642
subparser = self .add_command ('mgmt' , 'Management node commands' )
600
643
@@ -987,6 +1030,18 @@ def run(self):
987
1030
elif sub_command == "info-spdk" :
988
1031
node_id = args .id
989
1032
ret = storage_ops .get_spdk_info (node_id )
1033
+
1034
+ elif sub_command == "s3-bdev-create" :
1035
+ node_id = args .id
1036
+ ret = storage_ops .s3_bdev_create (node_id , args .name , args .bdb_lcpu_mask , args .s3_lcpu_mask , args .s3_thread_pool_size )
1037
+
1038
+ elif sub_command == "s3-bdev-delete" :
1039
+ node_id = args .id
1040
+ ret = storage_ops .s3_bdev_delete (node_id , args .name )
1041
+
1042
+ elif sub_command == "s3-bdev-add-bucket-name" :
1043
+ node_id = args .id
1044
+ ret = storage_ops .s3_bdev_add_bucket_name (node_id , args .name , args .bucket_name )
990
1045
991
1046
elif sub_command == "get" :
992
1047
ret = storage_ops .get (args .id )
@@ -1018,6 +1073,8 @@ def run(self):
1018
1073
ret = self .cluster_create (args )
1019
1074
elif sub_command == 'add' :
1020
1075
ret = self .cluster_add (args )
1076
+ elif sub_command == 'toggle-disaster-recovery-status' :
1077
+ ret = self .cluster_toggle_disaster_recovery_status (args )
1021
1078
elif sub_command == 'activate' :
1022
1079
cluster_id = args .cluster_id
1023
1080
ret = cluster_ops .cluster_activate (cluster_id , args .force , args .force_lvstore_create )
@@ -1135,6 +1192,14 @@ def run(self):
1135
1192
elif sub_command == 'recover-snapshot' :
1136
1193
ret = lvol_controller .restore_snapshot (args .lvs_name , args .orig_name , args .orig_uuid ,
1137
1194
args .clear_method , args .id_of_blob_to_recover )
1195
+ elif sub_command == 'set-tiering-modes' :
1196
+ ret = lvol_controller .set_tiering_modes (args .lvol_uuid , args .is_tiered , args .force_fetch , args .sync_fetch ,
1197
+ args .pure_flush_or_evict , True )
1198
+ elif sub_command == 'set-distr-cache-capacities' :
1199
+ ret = lvol_controller .set_distr_cache_capacities (args .lvol_uuid , args .distr_name ,
1200
+ args .ghost_capacity , args .fifo_main_capacity , args .fifo_small_capacity )
1201
+ elif sub_command == 'set-distr-secondary-io-timeout' :
1202
+ ret = lvol_controller .set_distr_timeout_us (args .lvol_uuid , args .distr_name , args .secondary_io_timeout_us )
1138
1203
elif sub_command == "qos-set" :
1139
1204
ret = lvol_controller .set_lvol (
1140
1205
args .id , args .max_rw_iops , args .max_rw_mbytes ,
@@ -1381,6 +1446,9 @@ def cluster_add(self, args):
1381
1446
qpair_count , max_queue_size , inflight_io_threshold , enable_qos , strict_node_anti_affinity ,
1382
1447
support_storage_tiering , disaster_recovery )
1383
1448
1449
+ def cluster_toggle_disaster_recovery_status (self , args ):
1450
+ cluster_id = args .cluster_id
1451
+ disaster_recovery = args .disaster_recovery
1384
1452
1385
1453
def cluster_create (self , args ):
1386
1454
page_size_in_blocks = args .page_size
0 commit comments