Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CD Files are removed from PVE yet configuration keeps temporary path in template #298

Open
micsport13 opened this issue Oct 31, 2024 · 0 comments · May be fixed by #299
Open

CD Files are removed from PVE yet configuration keeps temporary path in template #298

micsport13 opened this issue Oct 31, 2024 · 0 comments · May be fixed by #299
Labels

Comments

@micsport13
Copy link

Overview of the Issue

When specifying additional iso files in the additional_iso_files block, even if the settings unmount = false is set, it removes the iso file that was created during the build. In my packer file, I have the following block:

additional_iso_files {
    iso_storage_pool = "${var.storage_pool}"
    cd_files = ["http/user-data", "http/meta-data"]
    cd_label = "cidata"
    unmount = false
  }

On startup of Packer, it creates a temporary iso file composed of these 2 cloud init files. The CD-ROM on the template is set to the temporary iso file path. However, at the end of the build, the temporary iso file is removed but the path to the file is left in the template. I would expect that with unmount false that it would keep the iso file it created and leave it mounted to the template. As a result, the template cannot start (or rather VMs that clone it cannot) because this file is no longer present on the PVE host. I may be missing something/doing something unorthodox with using a cloud-init iso mounted instead of just using a cloud init drive, but was wondering if there is a way to keep the temporary iso (or preferably create a permanent iso with a name I specify) in the PVE host so that clones that have that drive mounted have access to that iso.

Reproduction Steps

  1. Create a proxmox-iso template
  2. Add an additional iso file with the cd_files and cd_label configuration options
  3. Set unmount to false within the additional_iso_files block
  4. Build the Packer image on the PVE host
  5. In the Web UI, it should show a CD-ROM drive with reference to the file path of the temporary iso but the temporary iso has been deleted at the end of the packer build.

Plugin and Packer version

Packer v1.11.2
Packer Proxmox Plugin v1.2.0

Simplified Packer Buildfile

source "proxmox-iso" "arch-template" {
proxmox_url = <proxmox_url>
username = <proxmox_username>
token = <token>
node = <node_name>
vm_name = <vm_name>
cores = 4
memory = 4096
ssh_username = <ssh_username>
ssh_password = <ssh_password>

ssh_pty = true
ssh_timeout = "15m"

boot_iso {
    type = "ide"
    iso_url = <iso_url> # I used an Arch Linux iso but I'm guessing the distro doesn't matter in this case
    iso_checksum = <checksum>
    iso_storage_pool =  <target_iso_pool>
    unmount = true
    keep_cdrom_device = false
    iso_download_pve = true
  }
additional_iso_files {
    iso_storage_pool = <storage_pool>
    cd_files = ["http/user-data", "http/meta-data"]
    cd_label = "cidata"
    unmount = false
}

boot_command = [ <boot_commands> ] # Dependent on distro iso file
}

Operating system and Environment details

PVE Version 8.2.7
Host OS Uname - 6.11.5-arch1-1

Log Fragments and crash.log files

==> proxmox-iso.arch-template: Creating CD disk...
    proxmox-iso.arch-template: xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.
    proxmox-iso.arch-template: Drive current: -outdev 'stdio:/tmp/<sensitive>1594587563.iso'
    proxmox-iso.arch-template: Media current: stdio file, overwriteable
    proxmox-iso.arch-template: Media status : is blank
    proxmox-iso.arch-template: Media summary: 0 sessions, 0 data blocks, 0 data, 15.6g free
    proxmox-iso.arch-template: xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
    proxmox-iso.arch-template: Added to ISO image: directory '/'='/tmp/<sensitive>_to_cdrom2274146392'
    proxmox-iso.arch-template: xorriso : UPDATE :       2 files added in 1 seconds
    proxmox-iso.arch-template: xorriso : UPDATE :       2 files added in 1 seconds
    proxmox-iso.arch-template: ISO image produced: 184 sectors
    proxmox-iso.arch-template: Written to medium : 184 sectors at LBA 0
    proxmox-iso.arch-template: Writing to 'stdio:/tmp/<sensitive>1594587563.iso' completed successfully.
    proxmox-iso.arch-template: Done copying paths from CD_dirs
    proxmox-iso.arch-template: Uploaded ISO to lvm:iso/<sensitive>1594587563.iso # < -Temporary Iso File
... Build output ...
==> proxmox-iso.arch-template: Stopping VM
==> proxmox-iso.arch-template: Converting VM to template
    proxmox-iso.arch-template: Deleted generated ISO from lvm:iso/<sensitive>1594587563.iso # < -Temporary Iso File deleted
Build 'proxmox-iso.arch-template' finished after 5 minutes 59 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant