microsoft/SDN

SDN load balancer not working

edwinscheurwater opened this issue · 1 comments

run the SDN express and load balancer is not configured correctly and showed failed

Did some testing and discovered that SDNexpress.ps1 fails in sections 3
write-SDNExpressLog "STAGE 3: Host Configuration"

foreach ($h in $ConfigData.hypervhosts) {

    Add-SDNExpressHost -ComputerName $h -RestName $ConfigData.RestName -HostPASubnetPrefix $ConfigData.PASubnet -NCHostCert $NCHostCert -Credential $Credential -VirtualSwitchName $ConfigData.SwitchName
}

in SDNexpressmodule i removed the | out-null to see more data on screen

[20200319-13:34:04] Certdata contains 799 bytes.
Cannot convert argument "inArray", with value: "System.Object[]", for "ToBase64String" to type "System.Byte[]": "Cannot convert the "C:\Users\Administrator.CLOUDCOE\AppData\Local\Temp\tmp7B5C.tmp" value of type
"Deserialized.System.IO.FileInfo" to type "System.Byte"."
At C:\SDNExpress\scripts\SDNExpressModule.psm1:1082 char:5

  • $ServerProperties.Certificate = [System.Convert]::ToBase64String( ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodException
    • FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

[20200319-13:34:04] New server object.
New-NetworkControllerServer : Cannot process argument transformation on parameter 'ResourceId'. Cannot convert value to type System.String.
At C:\SDNExpress\scripts\SDNExpressModule.psm1:1085 char:75

  • ... rollerServer -ConnectionURI $uri -ResourceId $VirtualSwitchId -Proper ...
  •                                              ~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [New-NetworkControllerServer], ParameterBindingArgumentTransformationException
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,New-NetworkControllerServer

I think that the load balancers are not working correctly since certificate has issue and new-networkcontroller is using as resource id SDNswitch ID and not the HCInode server ID

I'm receiving a similar issue, also at the exact same location, and my output is similar to yours. I ran -verbose to see the output, here it is.

VERBOSE: [20200708-17:23:57] SLBM VIP is 192.168.33.1
VERBOSE: [20200708-17:24:31] Create and return host certificate.
Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [Get-Acl], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetAclCommand
    + PSComputerName        : <redacted>

You cannot call a method on a null-valued expression.
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
    + PSComputerName        : <redacted>

Cannot bind argument to parameter 'Path' because it is null.
    + CategoryInfo          : InvalidData: (:) [Set-Acl], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetAclComma
   nd
    + PSComputerName        : <redacted>

Cannot convert 'System.Object[]' to the type 'Microsoft.CertificateServices.Commands.Certificate' required by
parameter 'Cert'. Specified method is not supported.
    + CategoryInfo          : InvalidArgument: (:) [Export-Certificate], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.CertificateServices.Commands.ExportCertificateCommand
    + PSComputerName        : <redacted>

Cannot find path 'C:\Users\<redacted>\AppData\Local\Temp\tmpA470.tmp' because it does not exist.
    + CategoryInfo          : ObjectNotFound: (C:\Users\<redacted>...emp\tmpA470.tmp:String) [Get-Content], ItemNotFoundEx
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
    + PSComputerName        : <redacted>

Cannot find path 'C:\Users\<redacted>\AppData\Local\Temp\tmpA470.tmp' because it does not exist.
    + CategoryInfo          : ObjectNotFound: (C:\Users\<redacted>...emp\tmpA470.tmp:String) [Remove-Item], ItemNotFoundEx
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
    + PSComputerName        : <redacted>

VERBOSE: [20200708-17:24:33] Install NC host cert into Root store on host.
VERBOSE: [20200708-17:24:34] Restart NC Host Agent and enable VFP.
VERBOSE: [20200708-17:24:37] Configure and start SLB Host Agent.
VERBOSE: [20200708-17:24:40] Prepare server object.
VERBOSE: [20200708-17:24:47] Certdata contains 0 bytes.
C:\Users\<redacted>\Downloads\SDN-master\SDN-master\SDNExpress\scripts\SDNExpress.ps1 : Exception calling
"ToBase64String" with "1" argument(s): "Value cannot be null.
Parameter name: inArray"
At line:1 char:1
+ .\SDNExpress.ps1 -ConfigurationDataFile sdnexport.psd1 -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [SDNExpress.ps1], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException,SDNExpress.ps1

The cert data definitely exists and there were no errors prior to this.