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

post-processor: create disk image without a backing file #44

Open
rgl opened this issue Dec 11, 2021 · 0 comments
Open

post-processor: create disk image without a backing file #44

rgl opened this issue Dec 11, 2021 · 0 comments

Comments

@rgl
Copy link
Contributor

rgl commented Dec 11, 2021

Description

When using a backing file like:

source "qemu" "packer-qemu-ansible-debian-example" {
  ...
  disk_image = true
  use_backing_file = true
  iso_url = "/home/rgl/.vagrant.d/boxes/debian-11-amd64/0/libvirt/box.img"
}

build {
  ...
  post-processor "vagrant" {
    output = "packer-qemu-ansible-debian-example.box"
  }
}

The disk image inside the generated vagrant box is using a backing file:

$ qemu-img info ~/.vagrant.d/boxes/packer-qemu-ansible-debian-example/0/libvirt/box.img 
image: /home/rgl/.vagrant.d/boxes/packer-qemu-ansible-debian-example/0/libvirt/box.img
file format: qcow2
virtual size: 60 GiB (64424509440 bytes)
disk size: 139 MiB
cluster_size: 65536
backing file: /home/rgl/.vagrant.d/boxes/debian-11-amd64/0/libvirt/box.img
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

This makes the box depend on that backing file, which is not what I would expect. I was expecting an stand-alone disk inside the box file.

Creating a stand-alone disk is a matter of executing qemu-img (instead of just copying the img) with something alike:

qemu-img convert -O qcow2 with-backing-file.img standalone.img

What do you think? Would a PR with this be acceptable?

aaronknister pushed a commit to aaronknister/packer-plugin-vagrant that referenced this issue Mar 16, 2022
Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/zclconf/go-cty/releases)
- [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md)
- [Commits](zclconf/go-cty@v1.9.1...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/zclconf/go-cty
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant