From 1f0a33b00268abb570aba5f403797de339e0e67a Mon Sep 17 00:00:00 2001 From: Tina Tang Date: Fri, 18 Nov 2016 11:15:10 +0800 Subject: [PATCH] [GH-58] Link aggregation support Support Link aggregation in storops --- storops/exception.py | 5 ++ storops/unity/parser_configs.yaml | 20 +++++ storops/unity/resource/port.py | 53 +++++++++-- storops/unity/resource/system.py | 7 +- test/unity/resource/test_port.py | 64 +++++++++++++- test/unity/resource/test_system.py | 15 ++++ test/unity/rest_data/ethernetPort/index.json | 8 ++ .../rest_data/ethernetPort/not_found.json | 12 +++ .../rest_data/ethernetPort/spa_eth4.json | 59 +++++++++++++ test/unity/rest_data/ipPort/index.json | 4 + test/unity/rest_data/ipPort/spa_la_2.json | 14 +++ test/unity/rest_data/linkAggregation/all.json | 80 +++++++++++++++++ .../linkAggregation/create_spa_la_2.json | 5 ++ .../rest_data/linkAggregation/index.json | 79 +++++++++++++++++ .../rest_data/linkAggregation/modify.json | 0 .../rest_data/linkAggregation/not_found.json | 12 +++ .../port_aggregated_error.json | 12 +++ .../rest_data/linkAggregation/spa_la_2.json | 34 ++++++++ .../unity/rest_data/linkAggregation/type.json | 87 +++++++++++++++++++ test/unity/rest_mock.py | 4 +- 20 files changed, 564 insertions(+), 10 deletions(-) create mode 100755 test/unity/rest_data/ethernetPort/not_found.json create mode 100755 test/unity/rest_data/ethernetPort/spa_eth4.json create mode 100755 test/unity/rest_data/ipPort/spa_la_2.json create mode 100755 test/unity/rest_data/linkAggregation/all.json create mode 100755 test/unity/rest_data/linkAggregation/create_spa_la_2.json create mode 100755 test/unity/rest_data/linkAggregation/index.json create mode 100755 test/unity/rest_data/linkAggregation/modify.json create mode 100755 test/unity/rest_data/linkAggregation/not_found.json create mode 100755 test/unity/rest_data/linkAggregation/port_aggregated_error.json create mode 100755 test/unity/rest_data/linkAggregation/spa_la_2.json create mode 100755 test/unity/rest_data/linkAggregation/type.json diff --git a/storops/exception.py b/storops/exception.py index 489b66da..1a388edf 100644 --- a/storops/exception.py +++ b/storops/exception.py @@ -493,6 +493,11 @@ class UnityStorageResourceNameInUseError(UnityException): error_code = 108007952 +@rest_exception +class UnityEthernetPortAlreadyAggregatedError(UnityException): + error_code = 100665643 + + class NaviseccliNotAvailableError(VNXException): message = ("naviseccli not found. please make sure it's installed" " and available in path.") diff --git a/storops/unity/parser_configs.yaml b/storops/unity/parser_configs.yaml index e9c3c824..509b289f 100644 --- a/storops/unity/parser_configs.yaml +++ b/storops/unity/parser_configs.yaml @@ -1430,3 +1430,23 @@ UnityDnsServer: - label: addresses - label: origin converter: DNSServerOriginEnum + + +UnityLinkAggregation: + data_src: rest + name: linkAggregation + properties: + - label: id + - label: name + - label: shortName + - label: masterPort + converter: UnityEthernetPort + - label: ports + converter: UnityEthernetPortList + - label: mtuSize + key: mtu + - label: supportedMtus + - label: macAddress + - label: isLinkUp + - label: parentStorageProcessor + converter: UnityStorageProcessor diff --git a/storops/unity/resource/port.py b/storops/unity/resource/port.py index e8eb12a7..11c46124 100644 --- a/storops/unity/resource/port.py +++ b/storops/unity/resource/port.py @@ -17,19 +17,32 @@ import logging +from storops.lib.common import instance_cache from storops.unity.resource import UnityResource, UnityResourceList, \ UnityAttributeResource from storops.exception import UnityEthernetPortMtuSizeNotSupportError from storops.exception import UnityEthernetPortSpeedNotSupportError from storops.unity.enums import EPSpeedValuesEnum, IOLimitPolicyTypeEnum + __author__ = 'Jay Xu' LOG = logging.getLogger(__name__) class UnityIpPort(UnityResource): - pass + def set_mtu(self, mtu): + if self.is_link_aggregation(): + la = UnityLinkAggregation.get(self._cli, self.get_id()) + la.modify(mtu=mtu) + else: + eth = UnityEthernetPort.get(self._cli, self.get_id()) + eth.modify(mtu=mtu) + + @instance_cache + def is_link_aggregation(self): + port = UnityLinkAggregation.get(self._cli, self.get_id()) + return port.existed class UnityIpPortList(UnityResourceList): @@ -129,13 +142,14 @@ def get_resource_class(cls): class UnityEthernetPort(UnityResource): def modify(self, speed=None, mtu=None): speed = EPSpeedValuesEnum.parse(speed) - peer = self.get_peer() self._modify(self, speed, mtu) - self._modify(peer, speed, mtu) + peer = self.get_peer() + if peer.existed: + self._modify(peer, speed, mtu) def get_peer(self): - _peer_id = self._get_peer_id(self.get_id()) - return UnityEthernetPort(cli=self._cli, _id=_peer_id) + peer_id = self._get_peer_id(self.get_id()) + return UnityEthernetPort(cli=self._cli, _id=peer_id) def _modify(self, port, speed, mtu): if speed is not None: @@ -171,6 +185,35 @@ def get_resource_class(cls): return UnityEthernetPort +class UnityLinkAggregation(UnityResource): + @classmethod + def create(cls, cli, ports, mtu=None): + resp = cli.post(cls().resource_class, + ports=ports, + mtuSize=mtu) + resp.raise_if_err() + return cls(_id=resp.resource_id, cli=cli) + + def modify(self, mtu=None, add_ports=None, remove_ports=None): + if isinstance(add_ports, UnityEthernetPort): + add_ports = [add_ports] + if isinstance(remove_ports, UnityEthernetPort): + remove_ports = [remove_ports] + + resp = self._cli.modify(self.resource_class, + self.get_id(), + mtuSize=mtu, + addPorts=add_ports, + removePorts=remove_ports) + resp.raise_if_err() + + +class UnityLinkAggregationList(UnityResourceList): + @classmethod + def get_resource_class(cls): + return UnityLinkAggregation + + class UnityIscsiNode(UnityResource): pass diff --git a/storops/unity/resource/system.py b/storops/unity/resource/system.py index 7b760476..ca696a48 100644 --- a/storops/unity/resource/system.py +++ b/storops/unity/resource/system.py @@ -36,7 +36,7 @@ from storops.unity.resource.nfs_share import UnityNfsShareList from storops.unity.resource.pool import UnityPoolList from storops.unity.resource.port import UnityIpPortList, UnityIoLimitPolicy, \ - UnityIoLimitPolicyList + UnityIoLimitPolicyList, UnityLinkAggregationList from storops.unity.resource.snap import UnitySnapList from storops.unity.resource.sp import UnityStorageProcessorList from storops.unity.resource.port import UnityEthernetPortList, \ @@ -239,6 +239,11 @@ def clear_dns_server(self, use_dhcp=None): def info(self): return UnityBasicSystemInfo.get(cli=self._cli) + def get_link_aggregation(self, _id=None, name=None, **filters): + return self._get_unity_rsc(UnityLinkAggregationList, _id=_id, + name=name, + **filters) + class UnitySystemList(UnityResourceList): @classmethod diff --git a/test/unity/resource/test_port.py b/test/unity/resource/test_port.py index ac713463..27dbab29 100644 --- a/test/unity/resource/test_port.py +++ b/test/unity/resource/test_port.py @@ -22,13 +22,14 @@ raises, contains_string from storops.exception import UnityEthernetPortSpeedNotSupportError, \ UnityEthernetPortMtuSizeNotSupportError, UnityResourceNotFoundError, \ - UnityPolicyNameInUseError + UnityPolicyNameInUseError, UnityEthernetPortAlreadyAggregatedError from storops.unity.enums import ConnectorTypeEnum, EPSpeedValuesEnum, \ FcSpeedEnum, IOLimitPolicyStateEnum from storops.unity.resource.lun import UnityLun from storops.unity.resource.port import UnityEthernetPort, UnityIpPort, \ UnityIpPortList, UnityIscsiPortal, UnityIscsiNode, UnityFcPort, \ - UnityIoLimitRule, UnityIoLimitPolicy, UnityIoLimitPolicyList + UnityIoLimitRule, UnityIoLimitPolicy, UnityIoLimitPolicyList, \ + UnityLinkAggregation from storops.unity.resource.sp import UnityStorageProcessor from test.unity.rest_mock import t_rest, patch_rest @@ -50,6 +51,23 @@ def test_get_all(self): ports = UnityIpPortList(cli=t_rest()) assert_that(len(ports), equal_to(8)) + @patch_rest + def test_is_link_aggregation(self): + port = UnityIpPort('spa_eth3', cli=t_rest()) + assert_that(port.is_link_aggregation(), equal_to(False)) + port = UnityIpPort('spa_la_2', cli=t_rest()) + assert_that(port.is_link_aggregation(), equal_to(True)) + + @patch_rest + def test_set_mtu_on_eth_port(self): + port = UnityIpPort('spa_eth3', cli=t_rest()) + port.set_mtu(1500) + + @patch_rest + def test_set_mtu_on_link_aggregation(self): + la = UnityIpPort('spa_la_2', cli=t_rest()) + la.set_mtu(1500) + @ddt.ddt class UnityEthernetPortTest(TestCase): @@ -110,6 +128,11 @@ def do(): assert_that(do, raises(UnityEthernetPortSpeedNotSupportError)) + @patch_rest + def test_modify_when_peer_not_exist(self): + port = UnityEthernetPort(cli=t_rest(), _id='spa_eth4') + port.modify(mtu=1500) + @ddt.data({'port_id': 'spa_eth2', 'peer_id': 'spb_eth2'}, {'port_id': 'spb_eth3', @@ -243,3 +266,40 @@ def test_remove_from_storage(self): lun2 = UnityLun('sv_2025', t_rest()) resp = policy.remove_from_storage(lun1, lun2) assert_that(resp.is_ok(), equal_to(True)) + + +class UnityLinkAggregationTest(TestCase): + @patch_rest + def test_get_properties(self): + la = UnityLinkAggregation('spa_la_2', cli=t_rest()) + assert_that(la.is_link_up, equal_to(False)) + assert_that(la.mac_address, equal_to('00:60:16:5C:08:E1')) + assert_that(la.master_port.get_id(), "spa_eth2") + assert_that(la.mtu, equal_to(9000)) + assert_that( + la.parent_storage_processor, + equal_to(UnityStorageProcessor.get(t_rest(), 'spa'))) + assert_that(len(la.ports), equal_to(2)) + assert_that(la.supported_mtus, only_contains(1500, 9000)) + + @patch_rest + def test_create(self): + eth_2 = UnityEthernetPort.get(t_rest(), 'spa_eth2') + eth_3 = UnityEthernetPort.get(t_rest(), 'spa_eth3') + la = UnityLinkAggregation.create(t_rest(), [eth_2, eth_3], 9000) + assert_that(la.get_id(), equal_to('spa_la_2')) + + @patch_rest + def test_create_already_exist(self): + def do(): + eth_2 = UnityEthernetPort.get(t_rest(), 'spa_eth2') + eth_4 = UnityEthernetPort.get(t_rest(), 'spa_eth4') + UnityLinkAggregation.create(t_rest(), [eth_2, eth_4], 1500) + assert_that(do, raises(UnityEthernetPortAlreadyAggregatedError)) + + @patch_rest + def test_modify(self): + la = UnityLinkAggregation.get(t_rest(), 'spa_la_2') + la.modify(mtu=1500, + remove_ports=[UnityEthernetPort.get(t_rest(), "spa_eth2")], + add_ports=[UnityEthernetPort.get(t_rest(), "spa_eth4")]) diff --git a/test/unity/resource/test_system.py b/test/unity/resource/test_system.py index 507cb5f1..a5730565 100644 --- a/test/unity/resource/test_system.py +++ b/test/unity/resource/test_system.py @@ -489,6 +489,21 @@ def test_clear_dns_server(self): ret = t_unity().clear_dns_server() assert_that(ret, has_items('10.245.177.15', '10.245.177.16')) + @patch_rest + def test_get_link_aggregation_list(self): + la_list = t_unity().get_link_aggregation() + assert_that(len(la_list), equal_to(2)) + + @patch_rest + def test_get_link_aggregation_by_name(self): + cg = t_unity().get_link_aggregation(name='SP A Link Aggregation 2') + assert_that(cg.name, equal_to('SP A Link Aggregation 2')) + + @patch_rest + def test_get_link_aggregation_by_id(self): + cg = t_unity().get_link_aggregation(_id='spa_la_2') + assert_that(cg.id, equal_to('spa_la_2')) + class UnityDpeTest(TestCase): @patch_rest diff --git a/test/unity/rest_data/ethernetPort/index.json b/test/unity/rest_data/ethernetPort/index.json index ec510a25..1b2014f7 100755 --- a/test/unity/rest_data/ethernetPort/index.json +++ b/test/unity/rest_data/ethernetPort/index.json @@ -39,6 +39,14 @@ "speed": 100 }, "response": "success.json" + }, + { + "url": "/api/instances/ethernetPort/spa_eth4?compact=True&fields=bond,cascadeNames,connectorType,health,id,instanceId,isLinkUp,isRDMACapable,isRSSCapable,linuxDeviceName,macAddress,mtu,name,needsReplacement,operationalStatus,parent,parentIOModule,parentStorageProcessor,portNumber,requestedMtu,requestedSpeed,sfpSupportedProtocols,sfpSupportedSpeeds,shortName,speed,storageProcessor,supportedMtus,supportedSpeeds", + "response": "spa_eth4.json" + }, + { + "url": "/api/instances/ethernetPort/spb_eth4?compact=True&fields=bond,cascadeNames,connectorType,health,id,instanceId,isLinkUp,isRDMACapable,isRSSCapable,linuxDeviceName,macAddress,mtu,name,needsReplacement,operationalStatus,parent,parentIOModule,parentStorageProcessor,portNumber,requestedMtu,requestedSpeed,sfpSupportedProtocols,sfpSupportedSpeeds,shortName,speed,storageProcessor,supportedMtus,supportedSpeeds", + "response": "not_found.json" } ] } diff --git a/test/unity/rest_data/ethernetPort/not_found.json b/test/unity/rest_data/ethernetPort/not_found.json new file mode 100755 index 00000000..e055b7d5 --- /dev/null +++ b/test/unity/rest_data/ethernetPort/not_found.json @@ -0,0 +1,12 @@ +{ + "error": { + "errorCode": 131149829, + "httpStatusCode": 404, + "messages": [ + { + "en-US": "The requested resource does not exist. (Error Code:0x7d13005)" + } + ], + "created": "2016-11-21T02:28:44.743Z" + } +} diff --git a/test/unity/rest_data/ethernetPort/spa_eth4.json b/test/unity/rest_data/ethernetPort/spa_eth4.json new file mode 100755 index 00000000..722df1e9 --- /dev/null +++ b/test/unity/rest_data/ethernetPort/spa_eth4.json @@ -0,0 +1,59 @@ +{ + "content": { + "macAddress": "00:60:16:5C:07:0A", + "isRDMACapable": false, + "parentStorageProcessor": { + "id": "spa" + }, + "instanceId": "root/emc:EMC_UEM_EthernetPortLeaf%Tag=03:00:00:01", + "portNumber": 3, + "cascadeNames": [ + "Ethernet Port 4", + "SP A" + ], + "requestedMtu": 1500, + "mtu": 1500, + "connectorType": 1, + "id": "spa_eth4", + "supportedSpeeds": [ + 1000, + 10000, + 100, + 0 + ], + "supportedMtus": [ + 1500, + 9000 + ], + "storageProcessor": { + "id": "spa" + }, + "health": { + "descriptionIds": [ + "ALRT_PORT_LINK_DOWN_NOT_IN_USE" + ], + "descriptions": [ + "The port link is down, but not in use. No action is required." + ], + "value": 5 + }, + "parent": { + "resource": "storageProcessor", + "id": "spa" + }, + "needsReplacement": false, + "sfpSupportedSpeeds": [], + "sfpSupportedProtocols": [], + "operationalStatus": [ + 2, + 32785 + ], + "shortName": "Ethernet Port 4", + "requestedSpeed": 0, + "isRSSCapable": false, + "name": "SP A Ethernet Port 4", + "linuxDeviceName": "eth3", + "isLinkUp": false, + "bond": false + } +} diff --git a/test/unity/rest_data/ipPort/index.json b/test/unity/rest_data/ipPort/index.json index 0bafce0e..7bc6ca00 100644 --- a/test/unity/rest_data/ipPort/index.json +++ b/test/unity/rest_data/ipPort/index.json @@ -11,6 +11,10 @@ { "url": "/api/instances/ipPort/spa_eth2?compact=True&fields=cascadeNames,id,instanceId,isLinkUp,linuxDeviceName,macAddress,name,shortName,storageProcessor", "response": "spa_eth2.json" + }, + { + "url": "/api/instances/ipPort/spa_la_2?compact=True&fields=cascadeNames,id,instanceId,isLinkUp,linuxDeviceName,macAddress,name,shortName,storageProcessor", + "response": "spa_la_2.json" } ] } \ No newline at end of file diff --git a/test/unity/rest_data/ipPort/spa_la_2.json b/test/unity/rest_data/ipPort/spa_la_2.json new file mode 100755 index 00000000..e384b1b6 --- /dev/null +++ b/test/unity/rest_data/ipPort/spa_la_2.json @@ -0,0 +1,14 @@ +{ + "content": { + "macAddress": "00:60:16:5C:08:E1", + "name": "SP A Link Aggregation 2", + "linuxDeviceName": "bond2", + "storageProcessor": { + "id": "spa" + }, + "instanceId": "root/emc:EMC_UEM_LinkAggregationLeaf%Tag=03:00:00:00", + "isLinkUp": true, + "shortName": "Link Aggregation 2", + "id": "spa_la_2" + } +} diff --git a/test/unity/rest_data/linkAggregation/all.json b/test/unity/rest_data/linkAggregation/all.json new file mode 100755 index 00000000..deb591de --- /dev/null +++ b/test/unity/rest_data/linkAggregation/all.json @@ -0,0 +1,80 @@ +{ + "@base": "https://10.244.223.66/api/types/linkAggregation/instances?fields=id,instanceId,isLinkUp,linuxDeviceName,macAddress,mtuSize,name,parent,shortName,supportedMtus,parentStorageProcessor.id,ports.id,masterPort.id&per_page=2000&compact=true", + "updated": "2016-11-18T06:41:42.102Z", + "links": [ + { + "href": "&page=1", + "rel": "self" + } + ], + "entries": [ + { + "content": { + "supportedMtus": [ + 1500, + 9000 + ], + "macAddress": "00:60:16:5C:08:E1", + "name": "SP A Link Aggregation 2", + "linuxDeviceName": "bond2", + "parentStorageProcessor": { + "id": "spa" + }, + "instanceId": "root/emc:EMC_UEM_LinkAggregationLeaf%Tag=03:00:00:00", + "isLinkUp": false, + "masterPort": { + "id": "spa_eth2" + }, + "parent": { + "resource": "storageProcessor", + "id": "spa" + }, + "mtuSize": 9000, + "shortName": "Link Aggregation 2", + "id": "spa_la_2", + "ports": [ + { + "id": "spa_eth3" + }, + { + "id": "spa_eth2" + } + ] + } + }, + { + "content": { + "supportedMtus": [ + 1500, + 9000 + ], + "macAddress": "00:60:16:5C:0B:8F", + "name": "SP B Link Aggregation 2", + "linuxDeviceName": "bond2", + "parentStorageProcessor": { + "id": "spb" + }, + "instanceId": "root/emc:EMC_UEM_LinkAggregationLeaf%Tag=03:00:01:00", + "isLinkUp": false, + "masterPort": { + "id": "spb_eth2" + }, + "parent": { + "resource": "storageProcessor", + "id": "spb" + }, + "mtuSize": 9000, + "shortName": "Link Aggregation 2", + "id": "spb_la_2", + "ports": [ + { + "id": "spb_eth2" + }, + { + "id": "spb_eth3" + } + ] + } + } + ] +} diff --git a/test/unity/rest_data/linkAggregation/create_spa_la_2.json b/test/unity/rest_data/linkAggregation/create_spa_la_2.json new file mode 100755 index 00000000..847f0e7f --- /dev/null +++ b/test/unity/rest_data/linkAggregation/create_spa_la_2.json @@ -0,0 +1,5 @@ +{ + "content": { + "id": "spa_la_2" + } +} diff --git a/test/unity/rest_data/linkAggregation/index.json b/test/unity/rest_data/linkAggregation/index.json new file mode 100755 index 00000000..f6cd85ba --- /dev/null +++ b/test/unity/rest_data/linkAggregation/index.json @@ -0,0 +1,79 @@ +{ + "indices": [ + { + "url": "/api/types/linkAggregation?compact=True&fields=attributes.description,attributes.displayValue,attributes.initialValue,attributes.name,attributes.type,description,documentation,name,type", + "response": "type.json" + }, + { + "url": "/api/types/linkAggregation/instances?compact=True", + "body": { + "mtuSize": 9000, + "ports": [ + { + "id": "spa_eth2" + }, + { + "id": "spa_eth3" + } + ] + }, + "response": "create_spa_la_2.json" + }, + { + "url": "/api/instances/linkAggregation/spa_la_2?compact=True&fields=id,instanceId,isLinkUp,linuxDeviceName,macAddress,masterPort,mtuSize,name,parent,parentStorageProcessor,ports,shortName,supportedMtus", + "response": "spa_la_2.json" + }, + { + "url": "/api/instances/linkAggregation/spa_la_2/action/modify?compact=True", + "body": { + "mtuSize": 1500, + "removePorts": [ + { + "id": "spa_eth2" + } + ], + "addPorts": [ + { + "id": "spa_eth4" + } + ] + }, + "response": "modify.json" + }, + { + "url": "/api/types/linkAggregation/instances?compact=True&fields=id,instanceId,isLinkUp,linuxDeviceName,macAddress,masterPort,mtuSize,name,parent,parentStorageProcessor,ports,shortName,supportedMtus", + "response": "all.json" + }, + { + "url": "/api/types/linkAggregation/instances?compact=True&fields=id,instanceId,isLinkUp,linuxDeviceName,macAddress,masterPort,mtuSize,name,parent,parentStorageProcessor,ports,shortName,supportedMtus&filter=name eq \"SP A Link Aggregation 2\"", + "response": "spa_la_2.json" + }, + { + "url": "/api/instances/linkAggregation/spa_la_2/action/modify?compact=True", + "body": { + "mtuSize": 1500 + }, + "response": "modify.json" + }, + { + "url": "/api/instances/linkAggregation/spa_eth3?compact=True&fields=id,instanceId,isLinkUp,linuxDeviceName,macAddress,masterPort,mtuSize,name,parent,parentStorageProcessor,ports,shortName,supportedMtus", + "response": "not_found.json" + }, + { + "url": "/api/types/linkAggregation/instances?compact=True", + "body": { + "mtuSize": 1500, + "ports": [ + { + "id": "spa_eth2" + }, + { + "id": "spa_eth4" + } + ] + }, + "response": "port_aggregated_error.json" + } + ] + +} diff --git a/test/unity/rest_data/linkAggregation/modify.json b/test/unity/rest_data/linkAggregation/modify.json new file mode 100755 index 00000000..e69de29b diff --git a/test/unity/rest_data/linkAggregation/not_found.json b/test/unity/rest_data/linkAggregation/not_found.json new file mode 100755 index 00000000..e055b7d5 --- /dev/null +++ b/test/unity/rest_data/linkAggregation/not_found.json @@ -0,0 +1,12 @@ +{ + "error": { + "errorCode": 131149829, + "httpStatusCode": 404, + "messages": [ + { + "en-US": "The requested resource does not exist. (Error Code:0x7d13005)" + } + ], + "created": "2016-11-21T02:28:44.743Z" + } +} diff --git a/test/unity/rest_data/linkAggregation/port_aggregated_error.json b/test/unity/rest_data/linkAggregation/port_aggregated_error.json new file mode 100755 index 00000000..3944ed52 --- /dev/null +++ b/test/unity/rest_data/linkAggregation/port_aggregated_error.json @@ -0,0 +1,12 @@ +{ + "error": { + "errorCode": 100665643, + "httpStatusCode": 409, + "messages": [ + { + "en-US": "One of specified ethernet ports cannot be aggregated due it is already aggregated. (Error Code:0x600092b)" + } + ], + "created": "2016-11-21T03:21:37.134Z" + } +} diff --git a/test/unity/rest_data/linkAggregation/spa_la_2.json b/test/unity/rest_data/linkAggregation/spa_la_2.json new file mode 100755 index 00000000..310f51f5 --- /dev/null +++ b/test/unity/rest_data/linkAggregation/spa_la_2.json @@ -0,0 +1,34 @@ +{ + "content": { + "supportedMtus": [ + 1500, + 9000 + ], + "macAddress": "00:60:16:5C:08:E1", + "name": "SP A Link Aggregation 2", + "linuxDeviceName": "bond2", + "parentStorageProcessor": { + "id": "spa" + }, + "instanceId": "root/emc:EMC_UEM_LinkAggregationLeaf%Tag=03:00:00:00", + "isLinkUp": false, + "masterPort": { + "id": "spa_eth2" + }, + "parent": { + "resource": "storageProcessor", + "id": "spa" + }, + "mtuSize": 9000, + "shortName": "Link Aggregation 2", + "id": "spa_la_2", + "ports": [ + { + "id": "spa_eth3" + }, + { + "id": "spa_eth2" + } + ] + } +} diff --git a/test/unity/rest_data/linkAggregation/type.json b/test/unity/rest_data/linkAggregation/type.json new file mode 100755 index 00000000..fab1663b --- /dev/null +++ b/test/unity/rest_data/linkAggregation/type.json @@ -0,0 +1,87 @@ +{ + "content": { + "attributes": [ + { + "displayValue": "instanceId", + "type": "String", + "name": "instanceId", + "description": "Internal identifier of the linkAggregation instance. " + }, + { + "displayValue": "id", + "type": "String", + "name": "id", + "description": "Unique identifier of the linkAggregation instance. " + }, + { + "displayValue": "name", + "type": "String", + "name": "name", + "description": "Link aggregation name. " + }, + { + "displayValue": "shortName", + "type": "String", + "name": "shortName", + "description": "Short name for the link aggregation. " + }, + { + "displayValue": "masterPort", + "type": "ethernetPort", + "name": "masterPort", + "description": "Master port of the link aggregation. " + }, + { + "displayValue": "ports", + "type": "List", + "name": "ports", + "description": "List of aggregated Ethernet ports, including the master port. " + }, + { + "displayValue": "mtuSize", + "type": "Integer", + "name": "mtuSize", + "description": "Maximum transmission unit (MTU) packet size for the linked ports, in bytes. " + }, + { + "displayValue": "supportedMtus", + "type": "List", + "name": "supportedMtus", + "description": "List of MTU sizes supported by the link aggregation. " + }, + { + "displayValue": "linuxDeviceName", + "type": "String", + "name": "linuxDeviceName", + "description": "Name of linux device (bond). " + }, + { + "displayValue": "macAddress", + "type": "String", + "name": "macAddress", + "description": "MAC address of the link aggregation. " + }, + { + "displayValue": "isLinkUp", + "type": "Boolean", + "name": "isLinkUp", + "description": "Indicates whether the link aggregation has link. " + }, + { + "displayValue": "parent", + "type": "resourceRef", + "name": "parent", + "description": "Parent Storage Processor of the link aggregation. " + }, + { + "displayValue": "parentStorageProcessor", + "type": "storageProcessor", + "name": "parentStorageProcessor", + "description": "Parent SP of the link aggregation. " + } + ], + "documentation": "https://10.244.223.66/apidocs/classes/linkAggregation.html", + "name": "linkAggregation", + "description": "(Applies if link aggregation is supported.) Ethernet port link aggregation settings.

Link aggregation lets you link Ethernet ports (for example, port 0 and port 1) on a Storage Processor (SP) to a single logical port, and therefore lets you use up to four Ethernet ports on the SP. If your system has two SPs, and you link two physical ports, the same ports on both SPs are linked for redundancy. For example, if you link port 0 to port 1, the system creates one link aggregation for these ports on SPA and another link aggregation on SPB.

Note: You can aggregate only Ethernet ports belonging to the same I/O module or on-board Ethernet ports. Aggregation of ports from different I/O modules is not allowed.

Note: You can aggregate only Ethernet ports with the same MTU size.

Note: You can not add an Ethernet port to aggregation if there are iSCSI portals on it.

Link aggregation provides the following advantages:

  • Increases overall throughput, since two physical ports are linked into one logical port.
  • Provides basic load balancing across linked ports, since the network traffic is distributed across multiple physical ports.
  • Provides redundant ports so that if one port in a linked pair fails, the system does not lose connectivity.
Note: With link aggregation, both linked ports must be connected to the same switch, and the switch must be configured to use the link aggregation that uses the Link Aggregation Control Protocol (LACP). The documentation that came with your switch should provide more information about using LACP.

The Unisphere online Help provides more details on cabling the SPs to the Disk-Array Enclosures (DAEs). " + } +} diff --git a/test/unity/rest_mock.py b/test/unity/rest_mock.py index 91e14b90..1b58b706 100644 --- a/test/unity/rest_mock.py +++ b/test/unity/rest_mock.py @@ -39,12 +39,12 @@ def t_rest(): :return: unity client singleton """ - return UnityClient('10.244.223.61', 'admin', 'Password123!', verify=False) + return UnityClient('10.244.223.66', 'admin', 'Password123!', verify=False) @cache def t_unity(): - return UnitySystem('10.244.223.61', 'admin', 'Password123!', verify=False) + return UnitySystem('10.244.223.66', 'admin', 'Password123!', verify=False) class MockRestClient(ConnectorMock):