VMware Cloud Community
lakey81
Enthusiast
Enthusiast

Change storage format when deploying from template

I'm guessing the answer is no but I've put together a script to deploy VMs from a csv file and one of the problems I've ran into is being unable to change the disk type to thick or thin when deploying from template.  From what I've gathered that parameter is unavailable when you use the template option with the new-vm command unlike when you do it from the GUI where you can choose to change the storage format.

Is there another way to do this without storage vmotion?  Or having a thick and a thin template?

0 Kudos
2 Replies
LucD
Leadership
Leadership

If you're on one fhe latest PowerCLI build that should be possible.

The New-VM parameterset for use with a template is

New-VM [-AdvancedOption <AdvancedOption[]>] [[-VMHost]  <VMHost>] -Name <String> [-ResourcePool <VIContainer>]  [-VApp <VApp>] [-Location <Folder>] [-Datastore  <StorageResource>] [-Template] <Template>  [-DiskStorageFormat <VirtualDiskStorageFormat>]  [-OSCustomizationSpec <OSCustomizationSpec>] [-HARestartPriority  <HARestartPriority>] [-HAIsolationResponse  <HAIsolationResponse>] [-DrsAutomationLevel  <DrsAutomationLevel>] [-Server <VIServer[]>] [-RunAsync]  [-Notes <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

The Template and DiskStorageFormat parameters can be used together


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

0 Kudos
lakey81
Enthusiast
Enthusiast

Oh sweet looks like that did work.  I must have been looking at a parameter list from an older version.

0 Kudos