1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add QoS support for purefa_facts module and fix to support vVols (#42919)

This commit is contained in:
Simon Dodsley 2018-08-28 06:36:52 -04:00 committed by John R Barker
parent 9bf12ee1c0
commit 86b72d1c8c

View file

@ -281,6 +281,7 @@ ansible_facts:
"subnet": {}
"volumes": {
"ansible_data": {
"bandwidth": null,
"hosts": [
[
"host1",
@ -288,7 +289,8 @@ ansible_facts:
]
],
"serial": "43BE47C12334399B000114A6",
"size": 1099511627776
"size": 1099511627776,
"source": null
}
}
'''
@ -450,8 +452,25 @@ def generate_vol_dict(array):
for vol in range(0, len(vols)):
volume = vols[vol]['name']
volume_facts[volume] = {
'source': vols[vol]['source'],
'size': vols[vol]['size'],
'serial': vols[vol]['serial'],
'hosts': [],
'bandwidth': ""
}
api_version = array._list_available_rest_versions()
if AC_REQUIRED_API_VERSION in api_version:
qvols = array.list_volumes(qos=True)
for qvol in range(0, len(qvols)):
volume = qvols[qvol]['name']
qos = qvols[qvol]['bandwidth_limit']
volume_facts[volume]['bandwidth'] = qos
vvols = array.list_volumes(protocol_endpoint=True)
for vvol in range(0, len(vvols)):
volume = vvols[vvol]['name']
volume_facts[volume] = {
'source': vols[vol]['source'],
'serial': vols[vol]['serial'],
'hosts': []
}
cvols = array.list_volumes(connect=True)