Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-OvUplinkSet : Support of NetworkSets when modifying an uplinkset in a LIG #512

Closed
odesaphy opened this issue Oct 27, 2020 · 12 comments
Closed
Assignees
Labels
5.00 Impacts HPE OneView 5.00 library 5.20 Impacts HPE OneView 5.20 library 5.30 Impacts HPE OneView 5.30 library 5.40 Impacts HPE OneView 5.40 library 5.50 Impacts HPE OneView 5.50 library Enhancement PendingVerification

Comments

@odesaphy
Copy link

Summary of the new feature/enhancement

Since OneView 5.00 we can add a NetworkSet to an UplinkSet when creating/modifying a LIG

Proposed technical implementation details (optional)

New parameter -AddNetworkSet

Get-OvLogicalInterconnectGroup -Name MY_VC_LIG | Set-OVUplinkSet -UplinkSetName MY_UPLINKSET -AddNetworkSet MY_NETWORKSET

New parameter -RemoveNetworkSet

Get-OvLogicalInterconnectGroup -Name MY_VC_LIG | Set-OVUplinkSet -UplinkSetName MY_UPLINKSET -RemoveNetworkSet MY_NETWORKSET
@ChrisLynchHPE ChrisLynchHPE self-assigned this Nov 9, 2020
@ChrisLynchHPE ChrisLynchHPE added 5.00 Impacts HPE OneView 5.00 library 5.20 Impacts HPE OneView 5.20 library 5.30 Impacts HPE OneView 5.30 library 5.40 Impacts HPE OneView 5.40 library labels Nov 9, 2020
@ChrisLynchHPE
Copy link
Member

This will be added to the 5.00 and newer libraries.

@odesaphy
Copy link
Author

odesaphy commented Nov 10, 2020

I've found in the Set-OVUplinkSet function there are several references to variables not used :

For example on HPEOneView.540 5.40.2559.2085 - HPEOneView.540.psm1
Line 94759 : $NetworkSetsUri
Line 94946 : $_UpdatedNetSet,

@ChrisLynchHPE ChrisLynchHPE added the 5.50 Impacts HPE OneView 5.50 library label Nov 10, 2020
ChrisLynchHPE added a commit that referenced this issue Nov 12, 2020
- Fixed New-HPOVSnmpV3User where paraeter validation logic was incorrect when providing the -AuthPassword parameter with -SecurityLevel to 'AuthOnly'.
- Fixed issue with Install-HPOVUpdate not hanlding error conditions from the API correctly.
- [#509] Fixed New-HPOVServerProfileTemplate and New-HPOVServerProfile where each Cmdlet would not handle TargetAddress parameter correctly.
- [#511] Enhanced New-HPOVServerProfileLogicalDisk to support permanent logical JBODs when assigned to server profile templates and server profiles.
- Enhanced Install-HPOVLogicalInterconnectFirmware to support Orchestrated firmware installation for HPE Synergy Virtual Connect fabrics.
- Enhanced Install-HPOVLogicalInterconnectFirmware to support HPE Synergy Orchestrated activation, and HPE SAS logical interconnect type.
- [#512] Enhanced Set-HPOVUplinkSet by adding -AddNetworkSet and -RemoveNetworkSet parameters.
- [#513] Enhanced New-HPOVServerProfileConnection to support Unassigned network connections.
- [#514] Enhanced ConvertTo-HPOVPowerShellScript to handle unassign network connections.
- [#515] Enhanced New-HPOVNetwork to include the ability to create bulk Ethernet networks and associate with one or more existing Network Sets.
- [#517] Enhanced Wait-HPOVTaskComplete to only display 'Appliance is rebooting' message once, if the appliance requires a reboot for a task (ex. Set-HPOVApplianceCurrentSecurityMode).
ChrisLynchHPE added a commit that referenced this issue Nov 12, 2020
- Fixed New-HPOVSnmpV3User where paraeter validation logic was incorrect when providing the -AuthPassword parameter with -SecurityLevel to AuthOnly.
- Fixed issue with Install-HPOVUpdate not hanlding error conditions from the API correctly.
- [#509] Fixed New-HPOVServerProfileTemplate and New-HPOVServerProfile where each Cmdlet would not handle TargetAddress parameter correctly.
- [#511] Enhanced New-HPOVServerProfileLogicalDisk to support permanent logical JBODs when assigned to server profile templates and server profiles.
- Enhanced Install-HPOVLogicalInterconnectFirmware to support Orchestrated firmware installation for HPE Synergy Virtual Connect fabrics.
- [#514] Enhanced ConvertTo-HPOVPowerShellScript to handle unassign network connections.
- [#513] Enhanced New-HPOVServerProfileConnection to support Unassigned network connections.
- Enhanced Install-HPOVLogicalInterconnectFirmware to support HPE Synergy Orchestrated activation, and HPE SAS logical interconnect type.
- [#515] Enhanced New-HPOVNetwork to include the ability to create bulk Ethernet networks and associate with one or more existing Network Sets.
- [#512] Enhanced Set-HPOVUplinkSet by adding -AddNetworkSet and -RemoveNetworkSet parameters.
ChrisLynchHPE added a commit that referenced this issue Nov 18, 2020
…gy Orchestrated activation, and HPE SAS logical interconnect type.

- Added Test-OVRemoteSupportEvent Cmdlet to initiate an HPE OneView Remote Suport test case event.
- Enhanced New-OVApplianceTrustedCertificate to build and install the certificate chain of a provided public SSL certificate or host.  The PowerShell client OS must have the certificate chain trusted in the operating systems trust store in order to properly build the certificate chain.
- [#512] Enhanced Set-HPOVUplinkSet by adding -AddNetworkSet and -RemoveNetworkSet parameters.
- [#515] Enhanced New-OVNetwork to allow assigning bulk networks to network sets with the -VlanRange and -NetworkSet paramters.
- [#516] Fixed Get-OVLoginMessage and Set-OVLoginMessage mishandling of an internal variable resulting in an unable to transform class exception.
- [#519] Enhanced Set-OVApplianceBackupConfig to fetch remote servers public SCP/SFTP key.
- [#520] Fixed internal Upload-File function where uploaded hotfixes would not report their filesize.
ChrisLynchHPE added a commit that referenced this issue Nov 19, 2020
… required.

- Fixed New-OVSnmpV3User where paraeter validation logic was incorrect when providing the -AuthPassword parameter with -SecurityLevel to AuthOnly.
- Fixed issue with Install-OVUpdate not handling error conditions from the API correctly.
- [#509] Fixed New-OVServerProfileTemplate and New-OVServerProfile where each Cmdlet would not handle TargetAddress parameter correctly.
- [#511] Enhanced New-OVServerProfileLogicalDisk to support permanent logical JBODs when assigned to server profile templates and server profiles.
- Enhanced Install-OVLogicalInterconnectFirmware to support Orchestrated firmware installation for HPE Synergy Virtual Connect fabrics.
- Enhanced Install-OVLogicalInterconnectFirmware to support HPE Synergy Orchestrated activation, and HPE SAS logical interconnect type.
- [#512] Enhanced Set-OVUplinkSet by adding -AddNetworkSet and -RemoveNetworkSet parameters.
- [#514] Enhanced ConvertTo-OVPowerShellScript to handle unassign network connections.
- [#513] Enhanced New-OVServerProfileConnection to support Unassigned network connections.
- [#515] Enhanced New-OVNetwork to allow assigning bulk networks to network sets with the -VlanRange and -NetworkSet paramters.
- [#516] Fixed Get-OVLoginMessage and Set-OVLoginMessage mishandling of an internal variable resulting in an unable to transform class exception.
- [#519] Enhanced Set-OVApplianceBackupConfig to fetch remote servers public SCP/SFTP key.
- [#520] Fixed internal Upload-File function where uploaded hotfixes would not report their filesize.
- Added Test-OVRemoteSupportEvent Cmdlet to initiate an HPE OneView Remote Suport test case event.
- Enhanced New-OVApplianceTrustedCertificate to build and install the certificate chain of a provided public SSL certificate or host.  The PowerShell client OS must have the certificate chain trusted in the operating systems trust store in order to properly build the certificate chain.
ChrisLynchHPE added a commit that referenced this issue Nov 20, 2020
…gy Orchestrated activation, and HPE SAS logical interconnect type.

- Added Test-OVRemoteSupportEvent Cmdlet to initiate an HPE OneView Remote Suport test case event.
- Enhanced New-OVApplianceTrustedCertificate to build and install the certificate chain of a provided public SSL certificate or host.  The PowerShell client OS must have the certificate chain trusted in the operating systems trust store in order to properly build the certificate chain.
- [#512] Enhanced Set-HPOVUplinkSet by adding -AddNetworkSet and -RemoveNetworkSet parameters.
- [#515] Enhanced New-OVNetwork to allow assigning bulk networks to network sets with the -VlanRange and -NetworkSet paramters.
- [#516] Fixed Get-OVLoginMessage and Set-OVLoginMessage mishandling of an internal variable resulting in an unable to transform class exception.
- [#519] Enhanced Set-OVApplianceBackupConfig to fetch remote servers public SCP/SFTP key.
- [#520] Fixed internal Upload-File function where uploaded hotfixes would not report their filesize.
- [#521] Fixed a casting issue within Get-OVApplianceServiceConsoleAccess when service console is disabled.
- [#523] Enhanced Get-OVServer to allow searching for server hardware serial number.
@ChrisLynchHPE
Copy link
Member

This is now addressed in the following releases:

Please validate prior to closing this issue.

@odesaphy
Copy link
Author

odesaphy commented Apr 16, 2021

Only the NetworkSet uri is added to the UplinkSet.networkSetUris

UplinkSet.networkUris is not updated with the uris of the networks in the networkset

and so we have this error code : CRM_NETWORKSET_NETWORKS_IS_NOT_FOUND_IN_UPLINKSET_IN_LIG

@ChrisLynchHPE
Copy link
Member

Hmmm.... The API behavior was changed in newer releases. Which library release are you using?

@odesaphy
Copy link
Author

odesaphy commented Apr 16, 2021

I've used latest 5.50 library connected to 6.0 dcs

From the rest API reference LIG
networkUris :
A set of network set URIs assigned to the uplink set. The list can be empty but not null. NOTE: When adding a network set, also add its constituent networks to networkUris. When removing a network set, also remove its constituent networks from networkUris, unless they are to remain configured in the uplink set.

ChrisLynchHPE referenced this issue May 10, 2021
- Deprecated Invoke-OVVcmMigration as the functionality was removed from HPE OneView 5.40.
- [#564] Fixed Set-OVSmtpConfig to send a properly formatted request to the appliance    REST API to disable email alert filters.
- Added -UseMXRecordLookup to Set-OVSmtpConfig Cmdlet to allow for DNS MX record lookup to be used instead of specifying an SMTP server with the -Server parameter.
- Enhanced Get-OVServer to return expanded server hardware inventory. This now fully populates the subResources property with available inventory data.
- [#5] Fixed Set-OVUplinkSet to add and remove associated networks when adding/removing network set(s).
- Added Windows Server 2019 and Ubuntu values for HostOStype parameter within New-OVServerProfile, New-OVServerProfileTemplate and New-OVServerProfileAttachVolume Cmdlets.
- [#569] Refactored detection of duplicate JSON pattern in API response, mainly with FW baselines/SPPs.

Signed-off-by: Chris Lynch <chris.lynch@hpe.com>
ChrisLynchHPE added a commit that referenced this issue May 10, 2021
…when adding/removing network set(s).

- Fixing new version branch changing default parameter values that were inadvertently being discovered as version string.

Signed-off-by: Chris Lynch <chris.lynch@hpe.com>
ChrisLynchHPE added a commit that referenced this issue May 26, 2021
…rom HPE OneView 5.40.

* [#564] Fixed Set-OVSmtpConfig to send a properly formatted request to the appliance REST API to disable email alert filters.
* Added -UseMXRecordLookup to Set-OVSmtpConfig Cmdlet to allow for DNS MX record lookup to be used instead of specifying an SMTP server with the -Server parameter.
* Enhanced Get-OVServer to return expanded server hardware inventory. This now fully populates the subResources property with available inventory data.
* [#512] Fixed Set-OVUplinkSet to add and remove associated networks when adding/removing network set(s).
* Added Windows Server 2019 and Ubuntu values for HostOStype parameter within New-OVServerProfile, New-OVServerProfileTemplate and New-OVServerProfileAttachVolume Cmdlets.
* [#569] Refactored detection of duplicate JSON pattern in API response, mainly with FW baselines/SPPs.
* Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.

Signed-off-by: Chris Lynch <chris.lynch@hpe.com>
ChrisLynchHPE added a commit that referenced this issue May 26, 2021
…S MX record lookup to be used instead of specifying an SMTP server with the -Server parameter.

* Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.
* [#564] Fixed Set-OVSmtpConfig to send a properly formatted request to the appliance REST API to disable email alert filters.
* Added -UseMXRecordLookup to Set-OVSmtpConfig Cmdlet to allow for DNS MX record lookup to be used instead of specifying an SMTP server with the -Server parameter.
* Enhanced Get-OVServer to return expanded server hardware inventory. This now fully populates the subResources property with available inventory data.
* [#512] Fixed Set-OVUplinkSet to add and remove associated networks when adding/removing network set(s).
* Added Windows Server 2019 and Ubuntu values for HostOStype parameter within New-OVServerProfile, New-OVServerProfileTemplate and New-OVServerProfileAttachVolume Cmdlets.
* [#569] Refactored detection of duplicate JSON pattern in API response, mainly with FW baselines/SPPs.
* Fixing new version branch changing default parameter values that were inadvertently being discovered as version string.

Signed-off-by: Chris Lynch <chris.lynch@hpe.com>
@odesaphy
Copy link
Author

odesaphy commented Jun 3, 2021

I've tested with HPEOneView 6.10.2778.2020

And it's not working.

The error is in the ForEach loop adding network uris (from the networkset) in $_UpdatedNetworkUris

In the following loop $_net is a uri and so adding $_net.uri to the array doesn't work.

ForEach ($_net in $_NetSetToAdd.networkUris)
                    {
                        if (-not $_UpdatedNetworkUris.Contains($_net.uri))
                        {
                            [void]$_UpdatedNetworkUris.Add($_net.uri)
                        }
                    }

Fix :

ForEach ($_netUri in $_NetSetToAdd.networkUris)
                    {
                        if (-not $_UpdatedNetworkUris.Contains($_netUri ))
                        {
                            [void]$_UpdatedNetworkUris.Add($_netUri)
                        }
                    }

ChrisLynchHPE added a commit that referenced this issue Oct 4, 2021
- Enhanced New-OVExternalRepository to validate provided certificate is expired.
- [#572] Fixed issue with ConvertTo-OVPowerShellScript incorrectly handling profile connection types and getting the assigned network details causing an error.
- [#512] Fixed regression in Set-OVUplinkSet.
- Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.
ChrisLynchHPE added a commit that referenced this issue Oct 4, 2021
- [#572] Fixed issue with ConvertTo-OVPowerShellScript incorrectly handling profile connection types and getting the assigned network details causing an error.
- [#512] Fixed regression in Set-OVUplinkSet.
- Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.
ChrisLynchHPE added a commit that referenced this issue Oct 8, 2021
…rom HPE OneView 5.40.

* [#564] Fixed Set-OVSmtpConfig to send a properly formatted request to the appliance REST API to disable email alert filters.
* Added -UseMXRecordLookup to Set-OVSmtpConfig Cmdlet to allow for DNS MX record lookup to be used instead of specifying an SMTP server with the -Server parameter.
* Enhanced Get-OVServer to return expanded server hardware inventory. This now fully populates the subResources property with available inventory data.
* [#512] Fixed Set-OVUplinkSet to add and remove associated networks when adding/removing network set(s).
* Added Windows Server 2019 and Ubuntu values for HostOStype parameter within New-OVServerProfile, New-OVServerProfileTemplate and New-OVServerProfileAttachVolume Cmdlets.
* [#569] Refactored detection of duplicate JSON pattern in API response, mainly with FW baselines/SPPs.
* Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.
* [#572] Fixed issue with ConvertTo-OVPowerShellScript incorrectly handling profile connection types and getting the assigned network details causing an error.
* [#512] Fixed regression in Set-OVUplinkSet.
* Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.
ChrisLynchHPE added a commit that referenced this issue Oct 12, 2021
…ndling profile connection types and getting the assigned network details causing an error.

* [#512] Fixed regression in Set-OVUplinkSet.
* Refactored Show-OVLogicalInterconnectMacTable to return properly formatted object, instead of Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData from Format-Table.
* Enhanced Invoke-OVUpdate to handle an issue with the update progress tracker API.
@odesaphy
Copy link
Author

odesaphy commented Nov 15, 2021

I've tested successfully the AddNetworkSet usecase with HPEOneView.630 library (6.30.2913.2047)

The RemoveNetworkSet usecase is not working
Get-OvLogicalInterconnectGroup -Name MY_VC_LIG | Set-OVUplinkSet -UplinkSetName MY_UPLINKSET -RemoveNetworkSet MY_NETWORKSET
Only NetworkSet is removed but the networks in the network set are not removed from the UplinkSet

@ChrisLynchHPE
Copy link
Member

This is fixed in Release 6.30.3188.1900 and in PowerShell Gallery.

Please verify before this issue is closed.

@odesaphy
Copy link
Author

In the "ForEach ($_netUriToRemove in $_NetSetToRemove.networkUris)" loop there is a lookup via index for net to netset association

If the result count is > 0 then the network is not removed from the uplinkset (not removed from $_UpdatedNetworkUris)
but as we looping through the networks of a networkset the result count of NETWORKSET_TO_NETWORK will be always >= 1

So if result count is > 1 (network is also part of other(s) networkset(s) we do not remove it from the uplinkset

Proposition :

Change

if ($_IndexResults.count -gt 0)
{
    "[{0}] Network is associated with {1} exsiting network set(s).  Will not remove." -f $MyInvocation.InvocationName.ToString().ToUpper(), $_IndexResults.count | Write-Verbose
}
else
{
    "[{0}] Removing network from uplink set." -f $MyInvocation.InvocationName.ToString().ToUpper() | Write-Verbose
    [void]$_UpdatedNetworkUris.Remove($_netUriToRemove)
}

To

if ($_IndexResults.count -gt 1)
{
    "[{0}] Network is associated with {1} exsiting network set(s).  Will not remove." -f $MyInvocation.InvocationName.ToString().ToUpper(), $_IndexResults.count | Write-Verbose
}
else
{
    "[{0}] Removing network from uplink set." -f $MyInvocation.InvocationName.ToString().ToUpper() | Write-Verbose
    [void]$_UpdatedNetworkUris.Remove($_netUriToRemove)
}

@ChrisLynchHPE
Copy link
Member

What you are proposing isn't correct. You can assign multiple network set resources to a single uplink set, where a network can be assigned to one or more of those network sets. The logic here is to ensure that the networks within the network set being removed aren't removed by accident when there are multiple network sets assigned.

After looking at this further, the evaluation logic here isn't quite right either, as it is only looking to see if the network is a member of more than 1 network set, but then doesn't evaluate if the network set is also assigned to the uplink set. Once that is added, then the logic flow here should then work.

ChrisLynchHPE added a commit that referenced this issue Aug 3, 2022
- [#610] Fixed Get-OVServerProfileConnectionList to support unassigned network connections
- [#512] Updated removing network set logic to appropriately handle removing associated networks, except when the associated network is assigned to another network set.
- Added NFSPath parameter to New-OVExternalRepository to support RMC firmware updates.
- Refactored Set-OVExternalRepository to use PATCH API call.
- Added -FirmwareInstallationPolicy switch to New-OVServerProfile and New-OVServerProfileTemplate Cmdlets.
- Removed 'Brocade', 'BNA', and 'Brocade Network Advisor' from the -Type parameter in Add-OVSanManager Cmdlet as Brocade SAN Network Advisor is no longer supported with HPE OneView.
- The HPE OneView 6.60 release is an LTS release for HPE BladeSystem customers.  Associated Cmdlets to manage HPE BladeSystem c-Class resources are deprecated and will be removed in the following release.  This will not impact HPE Synergy customers.  Deprecated Cmdlets will display a warning message.

Signed-off-by: Chris Lynch <chris.lynch@hpe.com>
@ChrisLynchHPE
Copy link
Member

ChrisLynchHPE commented Nov 14, 2022

This is fixed in Release 6.60.3227.2799, published in the PowerShell Gallery.

Closing due to no further activity. If you wish, feel free to re-open to discuss further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.00 Impacts HPE OneView 5.00 library 5.20 Impacts HPE OneView 5.20 library 5.30 Impacts HPE OneView 5.30 library 5.40 Impacts HPE OneView 5.40 library 5.50 Impacts HPE OneView 5.50 library Enhancement PendingVerification
Projects
None yet
Development

No branches or pull requests

2 participants