VMware Cloud Community
ezhill
Contributor
Contributor
Jump to solution

New-ContentLibraryItem URI OVA Import fails

Hey Community members,

 

Hoping someone can help with an issue I am having while creating a Content Library Item from a URI.

 

 

SgwOvaUrl = "https://d28e23pnuuv0hr.cloudfront.net/aws-storage-gateway-latest.ova"

New-ContentLibraryItem -ContentLibrary $ContentLibParams.ContentLibrary -Name $ContentLibParams.Name -Uri $SgwOvaUrl -FileName "aws-storage-gateway-latest.ova" -DisableOvfCertificateChecks

 

 

It seems the DisableOvfCertificateChecks doesn't appear to work.  

 

Output

 

ErrorRecord                 : 31/03/2021 11:55:17	New-ContentLibraryItem		Error occurred while pulling the file from the remote server. For more details check
                              the inner exception.
WasThrownFromThrowStatement : False
TargetSite                  : System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable)
StackTrace                  :    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
                                 at System.Management.Automation.Runspaces.Pipeline.Invoke()
                                 at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions
                              options)
Message                     : The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:
                              31/03/2021 11:55:17	New-ContentLibraryItem		Error occurred while pulling the file from the remote server. For more details check
                              the inner exception.
Data                        : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException              :
HelpLink                    :
Source                      : System.Management.Automation
HResult                     : -2146233087

 

 

vSphere Client Error

 

The import of library item 31f007e1-9a66-4276-ae8e-324a07c5cbcb has failed. Reason: Error transferring file aws-storage-gateway-latest.ova from https://d28e23pnuuv0hr.cloudfront.net/aws-storage-gateway-latest.ova. Reason: Server not trusted: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

 

 

Workaround but would prefer not to use

 

Invoke-WebRequest -Uri $SgwOvaUrl -OutFile "../../../Downloads/sgw.ova"

New-ContentLibraryItem -ContentLibrary $ContentLibParams.ContentLibrary -Name $ContentLibParams.Name -Files "../../../Downloads/sgw.ova" -DisableOvfCertificateChecks

 

 

Hope it's just me and can be easily resolved, thanks.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you already try adding the SslThumbPrint parameter on the New-ContentLibraryItem cmdlet?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try adding the SslThumbPrint parameter on the New-ContentLibraryItem cmdlet?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ezhill
Contributor
Contributor
Jump to solution

Hey Luc,

Thanks for replying.

I have gone ahead and tested the parameter suggested which appears to at least import the files.  I have another issue where it doesn't seem to recognise the Item Type but this is another issue I will have to workaround.  The source files could be the cause.

 

Any ideas on how to pull the SSL thumbprint using Powershell?  

0 Kudos
LucD
Leadership
Leadership
Jump to solution

William's Get-SSLThumbprint.ps1 does that


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

ezhill
Contributor
Contributor
Jump to solution

Thanks for your help.

0 Kudos