equelin / Unity-Powershell

PowerShell module for managing EMC Unity arrays

Home Page:https://www.powershellgallery.com/packages/Unity-Powershell/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get-UnityEthernetPort throw an error when port is not in use

equelin opened this issue · comments

Please makes sure these boxes are checked before submitting your issue (put an X between the brackets).

  • Check that your Powershell version > 5.0 (Bonus point if you are using the latest version available)
  • Check that you follow the instructions for installing the module

Get-UnityEthernetPort throw an error when I/O modules are populated:

The value supplied is not valid, or the property is read-only. Change the value, and then try again.

Here we go @barnette08, follow up of the issue #33

Could you provide the result of this command ?

((Get-UnityItem -URI /api/types).Entries.content | Where-Object {$_.name -like 'ethernetPort'}).attributes

Yep, here we go:

name type


id String
health health
storageProcessor storageProcessor
needsReplacement Boolean
name String
portNumber Integer
speed EPSpeedValuesEnum
mtu Integer
connectorType ConnectorTypeEnum
bond Boolean
isLinkUp Boolean
macAddress String
isRSSCapable Boolean
isRDMACapable Boolean
requestedSpeed EPSpeedValuesEnum
parentIOModule ioModule
parentStorageProcessor storageProcessor
supportedSpeeds List
requestedMtu Integer
supportedMtus List
parent resourceRef
sfpSupportedSpeeds List
sfpSupportedProtocols List

Thank you.
Could you test the fix in the develop branch ?

Same issue, but to add context that its only not reporting the onboard ports without errors, but not any CNA (ports 4/5) or any I/O Module ports. All return with the same error:

New-Object : The value supplied is not valid, or the property is read-only. Change the value, and then try again.
At line:64 char:21

  •                 New-Object -TypeName $TypeName -Property $Result
    
  •                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [New-Object], Exception
    • FullyQualifiedErrorId : SetValueException,Microsoft.PowerShell.Commands.NewObjectCommand

Ok, it perhaps related to the parentIOModule property. Unfortunatly the documentation is not very helpful about that one (error 404).

If you have the opportunity, could you run this command ?

(Get-UnityItem -URI '/api/types/ethernetPort/instances?fields=parentIOModule').entries.content

Sure, here ya go:

spa_eth2
spa_eth3
spa_iom_0_eth0
spa_iom_0_eth1
spa_iom_0_eth2
spa_iom_0_eth3
spa_mgmt
spa_srm
spb_eth2
spb_eth3
spb_iom_0_eth0
spb_iom_0_eth1
spb_iom_0_eth2
spb_iom_0_eth3
spb_mgmt
spb_srm

I would also assume that these would be there if populated:

spa_iom_1_eth0
spa_iom_1_eth1
spa_iom_1_eth2
spa_iom_1_eth3

spb_iom_1_eth0
spb_iom_1_eth1
spb_iom_1_eth2
spb_iom_1_eth3

Something is wrong with the parentIOModule property, it seems to always be empty.

To be honnest, I'm a bit stucked with this one... Unfortunatly I don't have access to an array with I/O modules. I don't know how to fix this issue without asking you to do a lot of work by yourself !

PS: independently of this issue, @barnette08 how can I reach you more privatly, email ? twitter ? Thanks

Feel free to email me at barnette08@hotmail.com

I've done some tests on an Unity 300 (without additionals I/O modules) and I've got the same errors on the CNA ports (4 and 5). Here are the data returns for one of those ports (spa, port 5):

{
		"content": {
			"id": "spa_eth5",
			"connectorType": 2,
			"requestedSpeed": 0,
			"supportedSpeeds": [0],
			"sfpSupportedSpeeds": [10000],
			"sfpSupportedProtocols": [2],
			"health": {
				"value": 5,
				"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
				"descriptions": ["The port link is down, but not in use. No action is required."]
			},
			"needsReplacement": false,
			"name": "SP A Ethernet Port 5",
			"portNumber": 5,
			"mtu": 1500,
			"bond": false,
			"isLinkUp": false,
			"macAddress": "00:60:48:35:73:72",
			"isRSSCapable": false,
			"isRDMACapable": false,
			"requestedMtu": 0,
			"supportedMtus": [1500, 9000],
			"parent": {
				"id": "spa",
				"resource": "storageProcessor"
			},
			"storageProcessor": {
				"id": "spa"
			},
			"parentStorageProcessor": {
				"id": "spa"
			}
		}
	}

For comparaison, here are the value for a port in use (spa, port 3):

{
		"content": {
			"id": "spa_eth3",
			"speed": 10000,
			"connectorType": 1,
			"requestedSpeed": 10000,
			"supportedSpeeds": [1000, 10000, 100, 0],
			"sfpSupportedSpeeds": [],
			"sfpSupportedProtocols": [],
			"health": {
				"value": 5,
				"descriptionIds": ["ALRT_PORT_LINK_UP"],
				"descriptions": ["The port is operating normally."]
			},
			"needsReplacement": false,
			"name": "SP A Ethernet Port 3",
			"portNumber": 3,
			"mtu": 1500,
			"bond": true,
			"isLinkUp": true,
			"macAddress": "00:60:16:83:3C:0E",
			"isRSSCapable": false,
			"isRDMACapable": false,
			"requestedMtu": 0,
			"supportedMtus": [1500, 9000],
			"parent": {
				"id": "spa",
				"resource": "storageProcessor"
			},
			"storageProcessor": {
				"id": "spa"
			},
			"parentStorageProcessor": {
				"id": "spa"
			}
		}
	}

Some observations concerning the port not in use:

  • The speed property is not available for that particular port
  • The sfpSupportedProtocols value is 2 and there's no corresponding value in the SFPSpeedValuesEnum Enum.

My understanding is that something is wrong in the API and/or the associated documentation...

@barnette08 @hillkc4 Any idea of what's going on? Do you know someone that might help on that issue ?

Hi Erwan,

I should have time to take a look at this tomorrow. I'll do some traces in chrome while the GUI starts on a debug build and see what it does when gathering info on the pages that use these classes. I have access to systems with FC and Ethernet modules.

The GUI makes a request like so:

https://10.245.100.179/api/types/ethernetPort/instances?compact=true&visibility=Engineering&per_page=99999&fields=id%2Cname%2CshortName%2Chealth%2Cspeed%2CrequestedSpeed%2CsupportedSpeeds%2Cmtu%2CrequestedMtu%2CsupportedMtus%2CconnectorType%2Cbond%2CmacAddress%2CstorageProcessor%2CstorageProcessor.name%2CparentIOModule%2CparentIOModule.name%2CoperationalStatus&page=1

It gets a response like:

{
"@base": "https://10.245.100.179/api/types/ethernetPort/instances?fields=id,name,shortName,health,speed,requestedSpeed,supportedSpeeds,mtu,requestedMtu,supportedMtus,connectorType,bond,macAddress,storageProcessor.name,parentIOModule.name,operationalStatus,storageProcessor.id,parentIOModule.id,storageProcessor.id,parentIOModule.id&per_page=2000&compact=true",
"entries": [
{"content": {
"operationalStatus": [
2,
32784
],
"supportedSpeeds": [
1000,
10000,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "00:60:16:5C:06:8F",
"supportedMtus": [
1500,
9000
],
"name": "SP A Ethernet Port 2",
"id": "spa_eth2",
"requestedMtu": 0,
"shortName": "Ethernet Port 2",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32784
],
"supportedSpeeds": [
1000,
10000,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "00:60:16:5C:06:8E",
"supportedMtus": [
1500,
9000
],
"name": "SP A Ethernet Port 3",
"id": "spa_eth3",
"requestedMtu": 0,
"shortName": "Ethernet Port 3",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:A0:1C",
"supportedMtus": [
1500,
9000
],
"name": "SP A I/O Module 1 Ethernet Port 0",
"id": "spa_iom_1_eth0",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP A I/O Module 1",
"id": "spa_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 0",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:A0:1D",
"supportedMtus": [
1500,
9000
],
"name": "SP A I/O Module 1 Ethernet Port 1",
"id": "spa_iom_1_eth1",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP A I/O Module 1",
"id": "spa_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 1",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:A0:1E",
"supportedMtus": [
1500,
9000
],
"name": "SP A I/O Module 1 Ethernet Port 2",
"id": "spa_iom_1_eth2",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP A I/O Module 1",
"id": "spa_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 2",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:A0:1F",
"supportedMtus": [
1500,
9000
],
"name": "SP A I/O Module 1 Ethernet Port 3",
"id": "spa_iom_1_eth3",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP A I/O Module 1",
"id": "spa_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 3",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [32784],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "08:00:1B:FF:1B:55",
"supportedMtus": [1500],
"name": "SP A Management Port",
"id": "spa_mgmt",
"requestedMtu": 0,
"shortName": "Management Port",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [32784],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP A",
"id": "spa"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "EA:F4:62:FC:54:DC",
"supportedMtus": [1500],
"name": "SP A Sync Replication Management Port",
"id": "spa_srm",
"requestedMtu": 0,
"shortName": "Sync Replication Management Port",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32784
],
"supportedSpeeds": [
1000,
10000,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "00:60:16:5C:0A:1B",
"supportedMtus": [
1500,
9000
],
"name": "SP B Ethernet Port 2",
"id": "spb_eth2",
"requestedMtu": 0,
"shortName": "Ethernet Port 2",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32784
],
"supportedSpeeds": [
1000,
10000,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "00:60:16:5C:0A:1A",
"supportedMtus": [
1500,
9000
],
"name": "SP B Ethernet Port 3",
"id": "spb_eth3",
"requestedMtu": 0,
"shortName": "Ethernet Port 3",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:9F:E4",
"supportedMtus": [
1500,
9000
],
"name": "SP B I/O Module 1 Ethernet Port 0",
"id": "spb_iom_1_eth0",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP B I/O Module 1",
"id": "spb_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 0",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:9F:E5",
"supportedMtus": [
1500,
9000
],
"name": "SP B I/O Module 1 Ethernet Port 1",
"id": "spb_iom_1_eth1",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP B I/O Module 1",
"id": "spb_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 1",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:9F:E6",
"supportedMtus": [
1500,
9000
],
"name": "SP B I/O Module 1 Ethernet Port 2",
"id": "spb_iom_1_eth2",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP B I/O Module 1",
"id": "spb_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 2",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [
2,
32785
],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_DOWN_NOT_IN_USE"],
"value": 5,
"descriptions": ["The port link is down, but not in use. No action is required."]
},
"bond": false,
"mtu": 1500,
"macAddress": "00:60:16:6B:9F:E7",
"supportedMtus": [
1500,
9000
],
"name": "SP B I/O Module 1 Ethernet Port 3",
"id": "spb_iom_1_eth3",
"requestedMtu": 0,
"parentIOModule": {
"name": "SP B I/O Module 1",
"id": "spb_iom_1"
},
"shortName": "I/O Module 1 Ethernet Port 3",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [32784],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "00:00:00:00:00:00",
"supportedMtus": [1500],
"name": "SP B Management Port",
"id": "spb_mgmt",
"requestedMtu": 0,
"shortName": "Management Port",
"requestedSpeed": 0
}},
{"content": {
"operationalStatus": [32784],
"supportedSpeeds": [
1000,
10,
100,
0
],
"connectorType": 1,
"storageProcessor": {
"name": "SP B",
"id": "spb"
},
"health": {
"descriptionIds": ["ALRT_PORT_LINK_UP"],
"value": 5,
"descriptions": ["The port is operating normally."]
},
"bond": false,
"speed": 1000,
"mtu": 1500,
"macAddress": "52:EE:72:21:14:DB",
"supportedMtus": [1500],
"name": "SP B Sync Replication Management Port",
"id": "spb_srm",
"requestedMtu": 0,
"shortName": "Sync Replication Management Port",
"requestedSpeed": 0
}}
],
"links": [{
"rel": "self",
"href": "&page=1"
}],
"updated": "2017-06-16T14:05:36.576Z"
}

Hi Erwan,
I think I understand the issue a little better.
The issue is likely occurring because @barnette08 was testing against a version of the code which is not yet released. We likely have some changes to the set of attributes for that class. It seems like this is the error we might expect if the .ps1xml files don't match what comes back in the /api/types response.
I tried this today against the current shipping code you have access to on a system with I/O module ports that weren't in use and it works fine. Against the unreleased code it fails. I'll be giving your scripts to generate new classes and GET functions a try sometime soon. Send me an email at hillkups@outlook.com

Mail send. Thanks so much for your feedback !

Fixed in #37