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

Unable to create qcow2 format disks

Open sudomas opened this issue 4 years ago • 17 comments

Packer creates the VM always with raw disks only, no matter what disk format is defined in disks block. Here's my disk configuration.

disks { storage_pool = var.isoStore storage_pool_type = "directory" type = "virtio" disk_size = var.diskSize cache_mode = "none" format = "qcow2" }

It creates VM with a raw disk always. I tried changing the disk type to iscsi, format to qcow etc. but that did not help.

I use the Packer version 1.7.3 on Ubuntu 20.04 and trying to create a template of Ubuntu 20.04.

sudomas avatar Jul 16 '21 01:07 sudomas

I have the same issue on Ubuntu 20.04 with Packer 1.7.4, using the following configuration block:

disks {
  type              = "virtio"
  disk_size         = "10G"
  storage_pool      = "local"
  storage_pool_type = "directory"
  format            = "qcow2"
}

jorikseldeslachts avatar Jul 25 '21 12:07 jorikseldeslachts

Same issue here with Packer 1.7.6, I'm building a VM based off of a Peakflow ISO image with the following disk settings:

  disks {
    disk_size         = "120G"
    storage_pool      = "gluster-volume"
    storage_pool_type = "directory"
    type              = "scsi"
    format            = "qcow2"
  }

The only workaround I found is to live change the disk format while the OS is installing, before Packer converts it to a template. I tried with storage_pool_type zfspool and lvm getting the same result.

dbuenoparedes avatar Oct 13 '21 14:10 dbuenoparedes

Fixed with https://github.com/Telmate/proxmox-api-go/commit/062fd1a6ab103ed125fed4b9a27b88f9efcb4e43

pupaxxo avatar Dec 01 '21 08:12 pupaxxo

Hello, is there any plan to bump github.com/Telmate/proxmox-api-go to v0.0.0-20220129131641-6909b62b8cf0 (I'm not aware at all about your release model)? Sounds like the fix is working

fldu avatar Feb 14 '22 12:02 fldu

We are also experiencing this issue with Packer 1.7.10

humberto-garza avatar Mar 01 '22 23:03 humberto-garza

#60 fixed this. Could you release a new version please? @azr

Pumba98 avatar Mar 19 '22 21:03 Pumba98

works fine now with 1.0.5, thanks

Pumba98 avatar Mar 21 '22 17:03 Pumba98

@Pumba98 Are you sure? I upgraded to 1.0.5 and it still ignores the format value and produces only raw disks...

theblop avatar Mar 23 '22 09:03 theblop

yes, I am @theblop . I changed the version in my required_plugins to >= 1.0.5 and run packer init. Before the files were .raw now they are .qcow2 and it fixed my problems after cloning them with terraform

Pumba98 avatar Mar 23 '22 09:03 Pumba98

@Pumba98 that's weird... I upgraded too and I still get a raw disk...

packer {
  required_plugins {
    proxmox = {
      version = ">= 1.0.5"
      source = "github.com/hashicorp/proxmox"
    }
}

source "proxmox-iso" "vm" {
  ...
  vm_id = 99999
  disks {
    disk_size         = "80G"
    format            = "qcow2"
    storage_pool      = var.proxmox.storage_pool
    storage_pool_type = var.proxmox.storage_pool_type
    type              = "scsi"
  }
  ...
}

After the build I get a raw image:

root@ebsifactory:~# pvesh get /nodes/proxmox/qemu/99999/config
...
│ scsi0       │ storage:99999/base-99999-disk-0.raw,iothread=0,size=80G │

theblop avatar Mar 23 '22 10:03 theblop

@theblop sorry, I have no idea what could be wrong. Double check with packer plugins installed (new in packer 1.8) that you got the right proxmox plugin version. Everything else lgtm

Pumba98 avatar Mar 23 '22 11:03 Pumba98

Can confirm it works on my side (Packer 1.8.0). Great !

image

root@baikonour:~# qemu-img info /mnt/pve/vmfs/images/1000/vm-1000-disk-0.qcow2
image: /mnt/pve/vmfs/images/1000/vm-1000-disk-0.qcow2
file format: qcow2
virtual size: 32 GiB (34359738368 bytes)
disk size: 65.3 MiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false

f-bn avatar Mar 26 '22 17:03 f-bn

I'm still experiencing the same issue even with plugin version 1.0.5:

  • Packer config file:
packer {
  required_plugins {
    proxmox = {
      version = ">= 1.0.5"
      source  = "github.com/hashicorp/proxmox"
    }
  }
}


...
  disks {
    disk_size         = "120G"
    storage_pool      = "efs"
    storage_pool_type = "directory"
    type              = "scsi"
    format            = "qcow2"
  }
...
  • Packer and plugin version:
$ packer plugins installed
/home/dbuenoparedes/.packer.d/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.0.5_x5.0_linux_amd64
$ packer version
Packer v1.8.0
  • Proxmox VM disk info:
# pvesh get /nodes/cop-compute-pve2/qemu/9500/config | grep scsi
│ boot        │ order=scsi0;ide2;net0                                   │
│ scsi0       │ efs:9500/base-9500-disk-0.raw,iothread=0,size=120G      │
│ scsihw      │ virtio-scsi-pci                                         │
# qemu-img info /mnt/efs/images/9500/base-9500-disk-0.raw 
image: /mnt/efs/images/9500/base-9500-disk-0.raw
file format: raw
virtual size: 120 GiB (128849018880 bytes)
disk size: 579 MiB

dbuenoparedes avatar Apr 08 '22 16:04 dbuenoparedes

@ruskofd, could you confirm that packer 1.8.0 does work for you? I tested 1.8.0 and the issue was still there But I confirmed that with 1.8.1 the problem is fixed! @dbuenoparedes, could you confirm this?

humberto-garza avatar Jun 17 '22 19:06 humberto-garza

my packer version is 1.8.2 and I have the same issue

  • Packer config file:
disks {
   disk_size = "20G"
   format = "qcow2"
   storage_pool = "Backup"
   storage_pool_type = "lvm"
   type = "virtio"
}
  • Proxmox storage.cfg
lvmthin: Backup
        thinpool Backup
        vgname Backup
        content images,rootdir
        nodes pve

The same config works with raw just don't work with qcow2

mm3906078 avatar Jul 15 '22 09:07 mm3906078

Same issue for me, I am using Packer 1.8.3 and proxmox 1.0.8.

andrei-matei avatar Aug 27 '22 17:08 andrei-matei

No issues currently for me:

  • Packer config file:
    disks {
        disk_size = "15G"
        format = "qcow2"
        storage_pool = "Proxmox"
        storage_pool_type = "directory"
        type = "scsi"
        cache_mode = "writethrough"
        io_thread = true
    }
  • Proxmox storage.cfg
dir: Proxmox
        path /mnt/prox
        content images,snippets,rootdir,vztmpl,iso
        prune-backups keep-all=1
        shared 0
$ packer plugins installed
homedir/.config/packer/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v1.0.8_x5.0_linux_amd64
$ packer version
Packer v1.8.4

modem7 avatar Nov 25 '22 23:11 modem7