Skip to content

CloningVolumeSource doesn't set volume Capacity #66

@richt-volx

Description

@richt-volx

I tried creating an image by cloning an existing volume (a qcow2 cloud-image I'd downloaded), but I wanted to resize it, so I added a capacity = element to the volume definition:

volume {
    name  = "my-new-root-volume"
    bus   = "virtio"
    pool  = "default"
    alias = "artifact"
    source {
      type   = "cloning"
      pool   = "default"
      volume = "noble-server-cloudimg-amd64.img"
    }
    capacity = "20G"
  }

This doesn't resize the volume, so the image ends up whatever the size of the source volume is.

This looks to be the same issue as #52 , I patched in a call to Driver.StorageVolResize, following the same pattern as the fix for that (6c1e562) and it now works for me.

Let me know if it would be helpful to open a PR with my fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions