Server Management - Remote Server Management

Adding Network to a Logical Interconnect Group

 
SOLVED
Go to solution
JonasPonas
Advisor

Adding Network to a Logical Interconnect Group

Hello everyone,

I am using module - HPOneView\4.10 https://github.com/HewlettPackard/POSH-HPEOneView

I am trying to add network to a Logical Interconnect Group. But i cant make it work.

I tried following this explanation https://github.com/HewlettPackard/POSH-HPEOneView/issues/45

But when executing last line i get error: Exception calling "Add" with "1" argument(s): "Collection was of a fixed size."

#Get the LIG Resource
$Lig = Get-HPOVLogicalInterconnectGroup 'My LIG Policy' -ApplianceConnection $ApplianceConnection

#Display the 'Prod Uplink Set 1_A' Uplink Set resource
$Lig.uplinkSets | ? name -eq 'Prod Uplink Set 1_A'

#Get MyNewVLAN_A network resource
$NewNetwork = Get-HPOVNetwork 'MyNewVLAN_A' -ApplianceConnection $ApplianceConnection

#Add it to the 'Prod Uplink Set 1_A'
($Lig.uplinkSets | ? name -eq 'Prod Uplink Set 1_A').networkUris.Add($NewNetwork.uri)

 Any help is appreciated. Even doing in another way, but I need to add Network to Logical Interconnect Group.

3 REPLIES 3
JonasPonas
Advisor

Re: Adding Network to a Logical Interconnect Group

Also tried this way: 

$LI = "Enclosure-LI"
$UplinkSetName = "UplinkSet1"
$NewNetwork = Get-HPOVNetwork "Name"  #Get the Network resource
$lig = Get-HPOVLogicalInterconnectGroup "LIG NAME" #Get the Logical Interconnect Resource
$lig.uplinkSets | ? { $_.name -eq $UplinkSetName } #Show the existing network URIs from the Uplink Set
($lig.uplinkSets | ? { $_.name -eq $UplinkSetName }).networkUris += $NewNetwork.uri #Add NewNetwork to the networkUris Array
$lig.uplinkSets | ? { $_.name -eq $UplinkSetName } #Show the updated array value
Set-HPOVResource $lig | Wait-HPOVTaskComplete
Update-HPOVLogicalInterconnect $LI

Get the error: The property 'networkUris' cannot be found on this object. Verify that the property exists and can be set. 

But i check th ($lig.uplinkSets | ? { $_.name -eq $UplinkSetName }).networkUris and it exists and is not empty.

JonasPonas
Advisor

Re: Adding Network to a Logical Interconnect Group

I added to the array but i can't update Logical Interconnect Group. Tried sending 

1.

 Set-HPOVResource $LogicalInterconnectGroup.uri | Wait-HPOVTaskComplete

2.

$resp = Send-HPOVRequest $lig.uri PUT $lig -Hostname $ApplianceConnection

 

JonasPonas
Advisor
Solution

Re: Adding Network to a Logical Interconnect Group

After more tries this one worked out fine and updated Logical Interconnect Group

Set-HPOVResource $LogicalInterconnectGroup | Wait-HPOVTaskComplete