VMware Cloud Community
bgalante
Contributor
Contributor
Jump to solution

Help with CLI to deploy template in Content Lib, using Custom Spec

Hello,

I'm looking to use PowerCLI to deploy Windows Templates located in a content library and to utilize a customization spec.

I'm having very basic trouble, wondering if someone could indicate what I'm doing wrong, not sure if my object names are too long or what...

When running this command, I get the error below, this spec does exist.

Get-OSCustomizationSpec -Name "Windows_2016_Datacenter_v2"

Could not find Customization Specification with name 'Windows_2016_Datacenter_v2'

And, this error, it's not finding my template...

Get-Template -Name 'TEMPLATE - Windows Server 2012 - Updated 2019.08.26'

Template with name 'TEMPLATE - Windows Server 2012 - Updated 2019.08.26' was not found using the specified filter(s).

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The regular Get-Template cmdlet doesn't work with Content Libraries.

You could use William's ContentLibrar module.
Note that the New-VMFromVMTX function in that module is only supported in VMC.{

Also note that PowerCLI 11.5 added several Content Library related cmdlets.
See New Release – PowerCLI 11.5.0

You can use Export-ContentLibraryItem te extract the template from the Content Library.

Concerning the OSCustomizationSpec, do you see it when you do a Get-OSCustomizationSpec without any parameters?
I'm not sure that you can in fact store an OSCustomizationSpec in a Content Library, I thought they were stored in the VCSA DB.


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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

The regular Get-Template cmdlet doesn't work with Content Libraries.

You could use William's ContentLibrar module.
Note that the New-VMFromVMTX function in that module is only supported in VMC.{

Also note that PowerCLI 11.5 added several Content Library related cmdlets.
See New Release – PowerCLI 11.5.0

You can use Export-ContentLibraryItem te extract the template from the Content Library.

Concerning the OSCustomizationSpec, do you see it when you do a Get-OSCustomizationSpec without any parameters?
I'm not sure that you can in fact store an OSCustomizationSpec in a Content Library, I thought they were stored in the VCSA DB.


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

bgalante
Contributor
Contributor
Jump to solution

Thank you very much for your reply,

I have 2 Vcenters in linked mode, I didn't realize I need to create the Custom Specs in both VC, so that's why it wasn't showing.

I'm running PowerCLI 11.3 so I will update that to get the Export-ContentLibraryItem command.

Thanks again for your help!

Reply
0 Kudos