cvv2
Contributor
Contributor

error deploying new vm (guest os 2022) with Get-ContentLibraryItem

Any one seeing this also::

Powercli version 12.7

Delpoy new vm 

Get-ContentLibraryItem –Name WS2022 | New-VM –Name vmname -datastore datastorename -ResourcePool clustername

Fails

New-VM An error occurred while trying to retrieve the content library item VM template info. For more details check the inner exception.

Deploying (existing) 2016 an 2019 content library items) works fine.

Deploying 2022 template with/in vcenter (GUI) works fine also.

In the error you see things about the guest_os, so I changed the guest os in the 2022 template to 2019.

Deploy with powercli is now working

Did I run into a bug?

 

ErrorId : ViCore.Impl.V1.Service.VmServiceImpl.DeployContentLibraryTemplate.GetVMTemplateInfoError
ErrorCategory : NotSpecified
TargetObject :
RecommendedAction :
SessionId :
ConnectionId :
Severity : Error
TargetSite : Boolean ErrorCallback(VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.VimException)
StackTrace : at VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM.ErrorCallback(VimException error)
at VMware.VimAutomation.Sdk.Util10.ErrorHandling.CustomErrorCallback.ProcessError(VimException error)
at VMware.VimAutomation.Sdk.Impl.V1.ErrorHandling.CoreErrorServiceImpl.ProcessError(VimException ex)
at VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM.DoWork(VIAutomation client, List`1 moList)
at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.DoWork(VIConnection connection, List`1 moList)
at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.BaseCmdlet.DoWorkEx(VIConnection connection, List`1 moList)
at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ConnectionDispatchHelper.ExecuteRunlist(Dictionary`2 runlist, DoWorkDelegate doWorkDelegate, UidDispatchHelper uidDispatchHelper, List`1 result)
at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ConnectionDispatchHelper.DispatchObjects(DoWorkDelegate doWorkDelegate, UidDispatchHelper uidDispatchHelper, IList`1 connectionList, Boolean isConnectionListExplicit, IList`1 moListFromCmdletParameter, String moListFromCmdletPara
meterName, Boolean isServerParameterObnOnly)
at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled()
at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled()
Message : 2-9-2022 08:16:37 New-VM An error occurred while trying to retrieve the content library item VM template info. For more details check the inner exception.
Data : {IsDistributedTerminatingError, ParameterValues}
InnerException : System.AggregateException: One or more errors occurred. (com.vmware.vapi.std.errors.internal_server_error {'messages': [com.vmware.vapi.std.localizable_message {'id': vapi.bindings.typeconverter.tovalue.struct.field.missing, 'default_message': Required field 'guest_OS' of structu
re 'com.vmware.vcenter.vm_template.library_items.info' is missing, 'args': [guest_OS, com.vmware.vcenter.vm_template.library_items.info], 'params': , 'localized':}], 'data': , 'error_type': INTERNAL_SERVER_ERROR})
---> vmware.vapi.std.errors.InternalServerError: com.vmware.vapi.std.errors.internal_server_error {'messages': [com.vmware.vapi.std.localizable_message {'id': vapi.bindings.typeconverter.tovalue.struct.field.missing, 'default_message': Required field 'guest_OS' of structure 'com
.vmware.vcenter.vm_template.library_items.info' is missing, 'args': [guest_OS, com.vmware.vcenter.vm_template.library_items.info], 'params': , 'localized':}], 'data': , 'error_type': INTERNAL_SERVER_ERROR}
at vmware.vapi.bindings.Stub.InvokeMethodAsync[R](MethodIdentifier methodId, StructValueBuilder structValueBuilder, StructType inputType, IType outputType, IEnumerable`1 errorTypes, InvocationConfig invocationConfig, Action`1 progressHandle)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at vmware.vapi.bindings.Stub.InvokeMethod[R](MethodIdentifier methodId, StructValueBuilder structValueBuilder, StructType inputType, IType outputType, IEnumerable`1 errorTypes, InvocationConfig invocationConfig, Action`1 progressHandle)
at vmware.vcenter.vm_template.LibraryItemsStub.Get(String templateLibraryItem, Action`1 _progress, InvocationConfig _invocationConfig)
at vmware.vcenter.vm_template.LibraryItemsStub.Get(String templateLibraryItem)
at VMware.VimAutomation.ViCore.Impl.V1.Cis.ApiFacade.Impl.CisVMTemplateLibraryItemsService.Get(String libraryItemId)
at VMware.VimAutomation.ViCore.Impl.V1.Service.VmServiceImpl.DeployContentLibraryTemplate(ContentLibraryItemInterop template, VMHostInterop vmhost, String name, VIContainerInterop resourcePool, FolderInterop location, StorageResourceInterop datastore, StoragePolicyInterop stor
agePolicy, String notes, OSCustomizationSpecInterop osCustomizationSpec, Int32 cpuCount, Int32 coresPerSocket, Decimal memoryMB, Int64[] diskCapacities, String[] networkNames, VirtualPortGroupBaseInterop[] portgroups)
HelpLink :
Source : VMware.VimAutomation.ViCore.Cmdlets
HResult : -2146232832

Labels (1)
0 Kudos
5 Replies
LucD
Leadership
Leadership

That looks indeed like a "feature".
I would suggest opening an SR


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

cvv2
Contributor
Contributor

Did create a SR to VMware but we do not have support for powercli scripts, SDK's or API's related issues. pointed me to vmware code.

For now I resolved it to set the right guest os after new vm is deployed with the server 2022 template on guest os 2019.

But the question now is: How to report this bug? Or getting the right people to read this 🙂

 

0 Kudos
LucD
Leadership
Leadership

If GSS told you that you need a Developer Support COntract for PowerCLI, they are wrong (an error they often make).
Point them to the Help and Support for VMware PowerCLI section in the PowerCLI User's Guide

It clearly states

You can file a technical support request under the terms of a Basic or Production Suport contract with VMware. You can get support for the following types of problems.

  • Cmdlets are not working as documented.
  • Installation problems with PowerCLI.

 


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

cvv2
Contributor
Contributor

VMware has confirmed that it is a bug in VMware vCenter, solved in VMware vCenter Server 7.0 Update 3e

0 Kudos
kennycomputer
Contributor
Contributor

Yep, this is a bug

0 Kudos