hashicorp / packer-plugin-proxmox

Packer plugin for Proxmox Builder
https://www.packer.io/docs/builders/proxmox
Mozilla Public License 2.0
143 stars 65 forks source link

Add shutdown_command like vsphere-iso #271

Open arogarth opened 2 weeks ago

arogarth commented 2 weeks ago

There is a closed issue for this. But building Windows Templates are hard to generalize.

Running sysprep with "/quit" and let packer shutdown the vm via winrm will reset winrm settings and user credentials - so there are "Failed Login" messages in Event Logs and winrm cannot connect.

If setting communicator to "none" will try to shutdown the VM during installation process.

There seems to be no way to sysprep and generalize the VM using proxmox-iso.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

A written overview of the feature.

Use Case(s)

Build Windows Server Templates with generlize.

arogarth commented 2 weeks ago

OK, I got it... Running a provisioner after actvating winrm works...

{
    "provisioners": [
        {
            "type": "powershell",
            "inline": [
                "& \"$($ENV:SystemRoot)\\System32\\Sysprep\\sysprep.exe\" /mode:vm /generalize /quit /oobe"
            ]
        }
    ]