Is it possible to set disk.enableUUID in the vmx_data when building a vmware-iso?

77 views
Skip to first unread message

Steven Stratis

unread,
Feb 22, 2019, 5:50:52 PM2/22/19
to Packer
I'm building out VMware iso images successfully but need to be able to set a certain flag in the template, which is disk.enableUUID=1

Is it possible to do this in Packer? Maybe using something in the vmx_data?  This flag is needed for disk identification from the vSphere Cloud Provider in Kubernetes.
I'm currently able to set it manually from the command line using govc... 

govc vm.change -vm Ubuntu1804Template -c 4 -m 4096 -e="disk.enableUUID=1"

It would be great to be able to do this while building it up in Packer though.

Thanks for any help!


Rickard von Essen

unread,
Feb 23, 2019, 1:22:06 AM2/23/19
to packe...@googlegroups.com
The simplest way to learn about this is just to issue your manual command and after that inspect the VMX file and see if it's there. If it is you can add the same thing to vmx_post. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/312d7595-6fa1-443f-9c92-11dcda487d0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pandit Mali

unread,
Feb 23, 2019, 12:14:05 PM2/23/19
to packe...@googlegroups.com
Hi Rickard,

I have .ps1(GPO's, BGInfo, TLS scripts) files with me which is included our company standard policy's, by applying the .ps1 files how do I need to build the Golden image using Packer .
I have created image in Azure with below Json file but I dont know how to apply the .ps1 files.
 

{

"builders": [{ "type": "azure-arm", "client_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "client_secret": "ppppppp-pppp-pppp-pppp-ppppppppppp", "tenant_id": "zzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz", "subscription_id": "yyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyy", "managed_image_resource_group_name": "myPackerGroup", "managed_image_name": "myPackerImage", "os_type": "Windows", "image_publisher": "MicrosoftWindowsServer", "image_offer": "WindowsServer", "image_sku": "2016-Datacenter", "communicator": "winrm", "winrm_use_ssl": true, "winrm_insecure": true, "winrm_timeout": "3m", "winrm_username": "packer", "azure_tags": { "dept": "Engineering", "task": "Image deployment" }, "location": "East US", "vm_size": "Standard_DS2_v2" }], "provisioners": [{ "type": "powershell", "inline": [ "Add-WindowsFeature Web-Server", "& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit", "while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }" ] }] }




I am unable give path for .ps1 files which is available with me, the below highlighted place, Please help me how to proceed further.  

image.png



Thanks and Regards,
Pandit Mali


For more options, visit https://groups.google.com/d/optout.


--
Thanks & Regards

Pandit Mali
Reply all
Reply to author
Forward
0 new messages