代码示例(一):
from storops import UnitySystem
import pprint
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
unity = UnitySystem('192.168.xx.xx', 'admin', 'Password123')
print(unity.serial_number, unity.model)
lun = unity.get_lun()
pprint.pprint(lun.name)
print(lun.name[0],lun.description[0],lun.wwn[0],lun.size_total[0],lun.size_allocated[0])
登录EMC Unity 400存储,获取序列号,LUN列表
python unity.py
CETV3173100014 Unity 400
['VMware_DATA-00',
'VMware_DATA-01',
'Data-00',
'vote-disk-00',
'vote-disk-01',
'test 50-50-00',
'dbserver_2t-00',
'DB_Server2-00',
'VMware-00']
VMware_DATA-00 60:06:01:60:24:D0:45:00:89:49:CA:59:FE:1F:17:F3 5497558138880 5497558138880
代码示例(二):
import sys
import re
from storops import UnitySystem
import json
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
array_ip = 'IP_Address'
array_user = 'admin'
array_pass = 'Password'
unity = UnitySystem(array_ip, array_user, array_pass)
luns = unity.get_lun()
for lun in luns:
lun_id = lun.id
lun_name = lun.name
lun_wwn = lun.wwn
lun_size = lun.size_total / 1024 / 1024 / 1024
print('Lun ID: {}'.format(lun_id))
print('Lun Name: {}'.format(lun_name))
print('Lun Size (GB): {}'.format(lun_size))
print('Lun WWN: {}'.format(lun.wwn))
lun_pool = lun.pool.id
print('Lun Pool: {}'.format(lun_pool))
print()
登录EMC Unity 400存储,获取LUN详细信息
# python unity1.py
Lun ID: sv_2
Lun Name: VMware_DATA-00
Lun Size (GB): 5120.0
Lun WWN: 60:06:01:60:24:D0:45:00:89:49:CA:59:FE:1F:17:F3
Lun Pool: pool_1
Lun ID: sv_3
Lun Name: VMware_DATA-01
Lun Size (GB): 5120.0
Lun WWN: 60:06:01:60:24:D0:45:00:8A:49:CA:59:D8:C8:DE:17
Lun Pool: pool_1
Lun ID: sv_6
Lun Name: Data-00
Lun Size (GB): 500.0
Lun WWN: 60:06:01:60:5D:D0:45:00:6D:54:CE:59:CD:8F:7E:D5
Lun Pool: pool_1
Lun ID: sv_7
Lun Name: vote-disk-00
Lun Size (GB): 5.0
Lun WWN: 60:06:01:60:5D:D0:45:00:6E:54:CE:59:FF:D9:29:C0
Lun Pool: pool_1
Lun ID: sv_8
Lun Name: vote-disk-01
Lun Size (GB): 5.0
Lun WWN: 60:06:01:60:5D:D0:45:00:6E:54:CE:59:90:58:C2:6B
Lun Pool: pool_1
Lun ID: sv_14
Lun Name: test 50-50-00
Lun Size (GB): 50.0
Lun WWN: 60:06:01:60:5D:D0:45:00:68:3B:DC:59:4F:B3:7C:99
Lun Pool: pool_1
Lun ID: sv_15
Lun Name: dbserver_2t-00
Lun Size (GB): 2048.0
Lun WWN: 60:06:01:60:5D:D0:45:00:B3:FA:EE:59:11:68:9C:A8
Lun Pool: pool_1
Lun ID: sv_17
Lun Name: DB_Server2-00
Lun Size (GB): 2048.0
Lun WWN: 60:06:01:60:5D:D0:45:00:53:09:5F:5A:64:98:55:62
Lun Pool: pool_1
Lun ID: sv_19
Lun Name: VMware-00
Lun Size (GB): 6144.0
Lun WWN: 60:06:01:60:5D:D0:45:00:5D:BE:7A:5A:06:A3:E6:B4
Lun Pool: pool_1
文章评论