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

Unable to create qcow2 format disks #23

Open
sudomas opened this issue Jul 16, 2021 · 17 comments
Open

Unable to create qcow2 format disks #23

sudomas opened this issue Jul 16, 2021 · 17 comments
Labels

Comments

@sudomas
Copy link

sudomas commented Jul 16, 2021

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 sudomas added the bug label Jul 16, 2021
@jorikseldeslachts
Copy link

jorikseldeslachts commented Jul 25, 2021

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"
}

@dbuenoparedes
Copy link

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.

@pupaxxo
Copy link

pupaxxo commented Dec 1, 2021

Fixed with Telmate/proxmox-api-go@062fd1a

@fldu
Copy link

fldu commented Feb 14, 2022

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

@humberto-garza
Copy link

We are also experiencing this issue with Packer 1.7.10

@Pumba98
Copy link

Pumba98 commented Mar 19, 2022

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

@Pumba98
Copy link

Pumba98 commented Mar 21, 2022

works fine now with 1.0.5, thanks

@theblop
Copy link

theblop commented Mar 23, 2022

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

@Pumba98
Copy link

Pumba98 commented Mar 23, 2022

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

@theblop
Copy link

theblop commented Mar 23, 2022

@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 │

@Pumba98
Copy link

Pumba98 commented Mar 23, 2022

@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

@f-bn
Copy link

f-bn commented Mar 26, 2022

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

@dbuenoparedes
Copy link

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

@humberto-garza
Copy link

humberto-garza commented Jun 17, 2022

@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?

@mm3906078
Copy link

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

@andrei-matei
Copy link

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

@modem7
Copy link

modem7 commented Nov 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests