hashicorp/packer

[Feature Request] Proxmox: Add multiple ISOs (CD/DVD Drives)

clayshek opened this issue · 8 comments

Would be helpful for Proxmox builder to have the ability to add more than one ISO file concurrently. This is possible through the Proxmox UI. Guessing this would be a matter of making changes to the config to allow iso_file(s) to be an array of objects, similar to how 'disks' or 'network_adapters' is currently handled.

The primary use case for this is in current difficulty around using the Proxmox builder to create a new Windows image, and not having a clear path on how to provide an unattended answer file for the Windows setup, as Proxmox doesn't support floppy drives. Being able to provide this file (as well as third party drivers as a 2nd use-case) in a 2nd CD drive (ISO) would be super helpful.

@clayshek @SwampDragons Has anyone found a way around this or a 'hacky' way of doing it?

I really want to deploy images like this.

@carlpett is the person to ask about Proxmox :)

@gentoo9ball I have a workaround for deploying Proxmox template images without Packer, using Ansible and the qm command line util, which gets around the Packer issue of only allowing a single CD/ISO drive. See https://github.com/clayshek/ans-pve-win-templ

I’ve looked into this a bit, and there doesn’t seem to be a super-clean way to implement with the current library we’re using. ISO-mounting devices are handled a bit special.
So it’ll either require doing a bit of refactoring of the lib and getting that upstreamed, or something creative on the Packer end.
I see the use-case though, so it is mostly a question of development time vs utility vs other features.

Thank you!!

I'm currently looking into this as it would be a useful feature for me too. I have a PoC with some hardcoded values and will try and submit a PR once I figure out the codebase a bit more.

In a nutshell, the Proxmox API doesn't support creating extra drives when the VM is created but an API exists that lets us create one after. I've added a call to that in between CreateVm and StartVm.

I have been working on this as well, but my approach is different to #9055: I'm adding config fields for an "extra ISO". This does the trick for the use case we need for unattended Windows images, but I guess it's far from ideal.

The downsides:

  • It's less flexible than the proposed PR. Can't select the specific drive (it's always "ide3"), can't add more than one additional drive.
  • It requires small changes to the proxmox-api-go library.

Since my changes are already handling ISO downloads/uploads and unmounting, I let you check them out in case you find them useful for the current PR. Myself I'm going to look into how easy it would be to allow for several additional_iso_files instead, and also apply the config after VM creation without changes to the API library.

@carlpett also related to this, some days ago I opened a PR Telmate/proxmox-api-go#75 related to a previous PR of yours for ISO upload, fixing some issues I found related to errors when dealing with big files in memory. Maybe you could take a look to see if it's worth merging, and suggest it to the maintainers if that's the case?

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.