packer-builder-vsphere icon indicating copy to clipboard operation
packer-builder-vsphere copied to clipboard

Add configuration_parameters_post

Open agowa opened this issue 6 years ago • 7 comments

Please add a configuration option to change the vmx configuration parameters after the provisioners have been run and before post-processors execute. This would allow us to have 4 cores and 16gb of ram while building the image, but not in the final template. Similar to what vmx_data_post does for the vmware provisioner.

agowa avatar Sep 29 '18 18:09 agowa

+1 in my case I need to set disk.EnableUUID this is a mandatory parameter to use vsphere kubernetes volumes

segator avatar Oct 10 '18 19:10 segator

@agowa338

This would allow us to have 4 cores and 16gb of ram while building the image, but not in the final template.

Don't you find such low-level customization dangerous?

We usually split images into several layers, and such customizations are performed by vsphere-clone builder on last layer.

mkuzmin avatar Oct 17 '18 07:10 mkuzmin

@segator

I need to set disk.EnableUUID

Can it be done at VM creation?

mkuzmin avatar Oct 17 '18 07:10 mkuzmin

@agowa338

This would allow us to have 4 cores and 16gb of ram while building the image, but not in the final template.

Don't you find such low-level customization dangerous?

Why should it be? We're doing it all the time in production manually thorough the web interface.

agowa avatar Oct 23 '18 18:10 agowa

@segator

I need to set disk.EnableUUID

Can it be done at VM creation?

This may not be possible, as vmware would generate unique uuids for the disk and after the template is deployed every vm would have the same disk uuids, making them non unique. Basically after setting "disk.EnableUUID" you don't want to do anything else that could update the vm configuration (as far as I know, only powering on after setting this configuration item will actually assign a uuid to the disk)

agowa avatar Oct 23 '18 18:10 agowa

My case for this (that I use with packer's vmware-iso) is to set an IOPS limit in the final template (I want unlimited IOPS during the build for speed).

Using another builder step duplicates a lot of configuration (how would that work? I got an error that the source template doesn't exist (because it hasn't been built yet!)) - I guess a post provisioner would avoid that, but it seems very specific to have a provisioner just to set the VMX config.

My guess is that adding configuration_parameters_post would be a fairly simple patch (if it were desired, that is)? I could have a go.

andrewpwade avatar Apr 25 '19 10:04 andrewpwade

This has been open a while I noticed there may be a way to provide extra options to ovftool, is that the recommended way to set these options? (disk.EnableUUID) ?

TJM avatar Apr 06 '20 18:04 TJM