關於軟體定義存儲ScaleIO的文章,前面我已經整理和介紹了3篇了,分別是在CentOS、VMWare、OpenStack環境下的詳細部署和使用,基本上把不同平臺的部署方法都覆蓋全了。
這是最後一篇關於ScaleIO的文章了,主要整理和介紹在命令行下,是如何對ScaleIO的各項功能進行操作的,常用的API有哪些。希望能幫助到有需要的朋友們。
一、GUI操作
ScaleIO的GUI在前面的文章中已經多次出現了,相信大家並不陌生。通過滑鼠點擊,或者右鍵可以換出相應的功能。
但是這些功能都是最基本的功能,展示,閱覽,或者簡單的維護操作是沒有問題的。對於更深入的磁碟運維操作,或者當ScaleIO出現異常,磁碟出現異常時,通常則需要通過更加專業的命令行操作來實現。
二、命令行操作
下面,我就介紹下常用的命令行指令
一、命令行登陸MDM
首先需要登錄MDM:MDM首節點執行
scli --login --username <NAME> [--password <PASSWORD>]Parameters:--username User name--password User's password. If the password is missing, the user will be prompted to enter the password
[root@localhost ~]# scli --login --username admin --password 123456
Logged in. User role is Administrator. System ID is 6abfca7530ba5c1c
二、查看命令
(1)查看Domain:
scli --query_protection_domain (--protection_domain_id <ID> | --protection_domain_name <NAME>)--protection_domain_id <ID> Protection Domain ID--protection_domain_name <NAME> Protection Domain name
[root@localhost ~]# scli --query_protection_domain --protection_domain_name default
Protection Domain default (Id: b0af2ef100000000) has 1 storage pools, 0 Fault Sets, 3 SDS nodes, 3 volumes and 3.1 TB (3160 GB) available for volume allocation
........
SDS Summary:
Total 3 SDS Nodes
3 SDS nodes have membership state 'Joined'
3 SDS nodes have connection state 'Connected'
9.8 TB (10041 GB) total capacity
6.2 TB (6323 GB) unused capacity ......
Volumes summary:
3 thick-provisioned volumes. Total size: 152.0 GB (155648 MB)
(2)查看pool:
scli --query_storage_pool (((--protection_domain_id <ID> | --protection_domain_name <NAME>) --storage_pool_name <NAME>) | --storage_pool_id <ID>)--protection_domain_id <ID> Protection Domain ID--protection_domain_name <NAME> Protection Domain name--storage_pool_id <ID> Storage Pool ID--storage_pool_name <NAME> Storage Pool name
[root@localhost ~]# scli --query_storage_pool --protection_domain_name default --storage_pool_name default
Storage Pool default (Id: 4902ff2900000000) has 3 volumes and 3.1 TB (3160 GB) available for volume allocation .......
3 thick-provisioned volumes. Total size: 152.0 GB (155648 MB)
(3)查看SDS:
scli --query_sds (--sds_id <ID> | --sds_name <NAME> | --sds_ip <IP>)--sds_id <ID> SDS ID--sds_name <NAME> SDS Name--sds_ip <IP> SDS IP address
[root@localhost ~]# scli --query_sds --sds_ip 172.17.42.12
SDS 2bbe63a100000002 Name: SDS_[172.17.42.12]
1: 172.17.42.12 Role: All (SDS and SDC)
Port: 7072 ......
3.3 TB (3349 GB) total capacity
3.2 TB (3246 GB) unused capacity
0 Bytes snapshots capacity
101.5 GB (103968 MB) in-use capacity
三、操作命令
(1)命令行安裝SDC
1.1 centos環境:
[root@localhost ~]# MDM_IP=26.47.136.250,26.47.136.249 rpm -i EMC-ScaleIO-sdc-1.32-2451.4.el6.x86_64.rpm
warning: EMC-ScaleIO-sdc-1.32-2451.4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID e4132f8f: NOKEY
Generating new UUID E83D7E3D-D51B-428F-BBA7-F28B7F8903CE
Updating file /bin/emc/scaleio/drv_cfg.txt with MDM
Updating file /bin/emc/scaleio/drv_cfg.txt with MDM (26.47.136.250,26.47.136.249)
Success loading module /bin/emc/scaleio/scini.ko
Found device special file /dev/scini
Loading MDMs from configuration file /bin/emc/scaleio/drv_cfg.txt
Successfully set UID E83D7E3D-D51B-428F-BBA7-F28B7F8903CE
Successfully processed: mdm 26.47.136.250,26.47.136.249
Executing boot_wait command. Waiting for 12 seconds
Successfully completed the boot_wait operation
Success configuring module
[ OK ]
1.2 vmware環境:
a)esxcli software acceptance set --level=PartnerSupported
b)esxcli software vib install -d sdc-1.32.343.0-esx5.5.zip其中版本號按實際情況修改。
c)esxcli system module parameters set -m scini -p "IoctlIniGuidStr=xxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxx IoctlMdmIPStr=172.17.42.12,172.17.42.13"SDC節點連接MDN主機,其中GUID串,需要訪問http://www.guidgen.com獲取
d)esxcli system module load -m scini 安裝後加載
(2)添加SDC
scli --add_sds --sds_ip <IP> [--sds_ip_role <ROLE>] ((--protection_domain_id <ID> | --protection_domain_name <NAME>) | ((((--protection_domain_id <ID> | --protection_domain_name <NAME>) --storage_pool_name <NAME>) | --storage_pool_id <ID>) --device_path <PATHS> [--device_name <NAMES>]))[--sds_name <NAME>] [--fault_set_id <ID> | --fault_set_name <NAME>][--rmcache_size_mb <SIZE>] [--enable_rmcache | --disable_rmcache] [--num_of_io_buffers <VALUE>] [--sds_port <PORT>] [--force_clean] [--test_time <TIME>] [Test Options][--i_am_sure]
scli --add_sds --sds_ip 172.17.42.13 --device_name /dev/sdb1 --sds_name sds1 --protection_domain_name domain1 --storage_pool_name Default
(3)修改默認saper大小
[root@localhost ~]# scli --mdm_ip 172.17.42.12 --modify_spare_policy --protection_domain_name default --storage_pool_name default --spare_percentage 10
Modifying the spare policy might leave some data unprotected in case of failure. Press 'y' to confirm.
Successfully modified spare policy
(4)刪除SDC
刪除sdc,需要保證sdc斷連後,才能成功刪除
[root@localhost ~]# rpm -e EMC-ScaleIO-sdc-1.32-2451.4.el6.x86_64
Success unloading module
ScaleIO-26-47-136-250:~ # scli --remove_sdc --sdc_ip 26.47.136.130
Successfully removed sdc 26.47.136.130
四、最後再簡單梳理下常用指令
Linux 手動添加client:
MDM_IP=10.32.213.135,10.32.213.136 rpm -i EMC-ScaleIO-sdc-1.30-431.3.el6.x86_64.rpm
登錄scli命令行:
scli --login --username admin --password Scaleio123
查看Domain:
scli --query_protection_domain --protection_domain_name Domain1
查看pool:
scli --query_storage_pool --protection_domain_name Domain1 --storage_pool_name pool2
查看sds:
scli --query_sds --sds_name SDS2
創建volume:
scli --add_volume --size_gb 250 --volume_name sas01 --protection_domain_name Domain1 --storage_pool_name pool1
map到SDC主機:
scli --map_volume_to_sdc --volume_name 4g_01 --sdc_ip 10.32.213.137 --allow_multi_map
unmap SDC主機:
scli --unmap_volume_from_sdc --volume_name 4g_01 --sdc_ip 10.32.213.137
刪除物理磁碟:
scli --remove_sds_device --sds_ip 10.10.10.5 --device_name /dev/sdk
刪除SDS節點:
scli --remove_sds --sds_ip 10.10.10.5
添加SDS節點:
scli --add_sds --sds_ip 10.10.10.5 --device_name /dev/sdb,/dev/sdc,/dev/sdd --sds_name sds5 --protection_domain_name domain1 --storage_pool_name Default