HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link

Unable to add Network connection while creating server profile #565

Closed bksaroja closed 2 years ago

bksaroja commented 3 years ago

Hi Team,

We are using POSH-HPEOneView v5.5. We get the below error, when we try to add connections to server profile:

Cannot validate argument on parameter 'RequestedBW'. The " [String]$ -eq 'Auto' -or ([Int]$ -le 20000 -and [Int]$_ -ge 0) " validation script for the argument with value "25000" did not return a result of True. Determine why the validation script failed, and then try the command again

From the error message, it looks like we cannot add a connection whose bandwidth is higher than 20GBps. Please find the details: cmdlet used : $Network_connection_attach = New-OVServerProfileConnection @params

@params = @{ name = value; ConnectionID = value; ConnectionType = value; PortId = value; RequestedBW = value; # the value is 25000 Network = value; Bootable = value; priority = value; LagName = value; Virtualfunctions = value; } Powershell library version : 5.5 Powershell version: 5.1

Incase I change the value of RequestBw to Auto I get the below error: Add-Connection : Cannot convert value "Auto" to type "System.Int32". Error: "Input string was not in a correct format."

ChrisLynchHPE commented 3 years ago

It looks like you removed the bug report text needed to document the issue. Please provide the following:

ChrisLynchHPE commented 3 years ago

If this issue is related to New-OVServerProfileConnection, that is a helper Cmdlet that creates an object to be used by New-OVServerProfileTemplate and New-OVServerProfile Cmdlets. To workaround this, just use -RequestedBW Auto, then edit the object after it is returned and set the requestedMbps property to the value you wish and is supported.

For example:

$connection1 = New-OVServerProfileConnection -Network $Network

# Adjust the requested bandwidth to a higher value than the Cmdlet currently supports. In this case, 
# set it to 25Gb, expressed in Mbps
$connection1.requestedMbps = 25000
bksaroja commented 3 years ago

Incase I change the value of RequestBw to Auto I get the below error: Add-Connection : Cannot convert value "Auto" to type "System.Int32". Error: "Input string was not in a correct format."

ChrisLynchHPE commented 3 years ago

Set -RequestedBW it to an integer

ChrisLynchHPE commented 2 years ago

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