packer-plugin-proxmox icon indicating copy to clipboard operation
packer-plugin-proxmox copied to clipboard

CD/DVD drive assign scsi instead of ide

Open oscar-vlugt opened this issue 1 year ago • 4 comments

I am trying to use packer on a proxmox cluster running on Raspberry PIs which don't have any IDE support. Normally I would just manually create a virtual machine and then remove the cd/dvd drive and assign SCSI to circumvent the following error:

kvm: -device ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=101: Bus 'ide.1' not found

Huge fan of Packer, and want to roll it out for my ARM images. Is there any possibility for me to add to my pkr.hcl file to set CD/DVD upon creation to use the Bus SCSI instead of IDE?

My packer file contains :

    # Proxmox Connection Settings
    proxmox_url              = "${var.proxmox_api_url}"
    username                 = "${var.proxmox_api_token_id}"
    token                    = "${var.proxmox_api_token_secret}"
    insecure_skip_tls_verify = true
    # Packer VM Configuration
    bios = "ovmf"
    boot_command      = [
        "<esc> auto preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/Debian-11.x/preseed.cfg<enter>"
    ]
    boot_wait                = "3s"
    cores                    = 2
    cpu_type                 = "host"
    disks {
        disk_size    = "4G"
        format       = "qcow2"
        storage_pool = "local"
        type         = "virtio"
    }
    http_directory           = "http"
    http_port_min            = "8000"
    http_port_max            = "8000"
    http_bind_address        = "0.0.0.0"
    iso_file                 = "local:iso/debian-11.6.0-arm64-netinst.iso"
    memory                   = 2048
    network_adapters {
        bridge = "vmbr0"
        model  = "virtio"
    }
    node                     = "pve002"
    onboot                   = true
    qemu_agent               = true
    scsi_controller          = "virtio-scsi-pci"
    sockets                  = 1
    ssh_username             = "root"
    ssh_password             = "*"
    ssh_timeout              = "3600s"
    template_description     = "Debian 11.x, generated on ${timestamp()}"
    template_name            = "TMPL-Debian11.x"
    unmount_iso              = true
    vm_name                  = "TMPL-Debian11.x"
    vm_id                    = 9980
}

build {
    sources = [
        "source.proxmox-iso.debian"
    ]
}

oscar-vlugt avatar Apr 14 '23 09:04 oscar-vlugt