Navigation Menu

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

terraform-provider-libvirt: base volume snapshot or copy #98992

Merged
merged 1 commit into from Jan 23, 2021

Conversation

lblasc
Copy link
Contributor

@lblasc lblasc commented Sep 28, 2020

Motivation for this change

When using LVM pool size field in libvirt_volume resource will be ignored because snapshot of base image is COW and cannot be resized. This patch solves this by adding extra parameter base_volume_copy, for more information see: dmacvicar/terraform-provider-libvirt#675

Part of working example (ubuntu container on nixos with libvirt):

 resource "libvirt_volume" "ubuntu_focal_image" {
  name = "ubuntu_focal_image"
  pool = "default"
  source = "/var/lib/libvirt/focal-server-cloudimg-amd64-disk-kvm.raw"
}

resource "libvirt_volume" "disk" {
  name = "u1-root"
  base_volume_id = libvirt_volume.ubuntu_focal_image.id
  base_volume_copy = true
  size = 100 * 1024 * 1024 * 1024
}
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Sep 28, 2020

Should we backport this to 20.09? When was this libvirt feature introduced?

@lblasc
Copy link
Contributor Author

lblasc commented Sep 30, 2020

This option was available in libvirt for a long time but not implemented in terraform provider. Hopefully this will get merged in upstream soon. I will do backport pull request when this get merged.

@SuperSandro2000
Copy link
Member

@lblasc please fix the merge conflict.

@lblasc lblasc force-pushed the terraform-provider-libvirt-patch branch from 8a18116 to bbdad5f Compare January 19, 2021 05:43
@lblasc
Copy link
Contributor Author

lblasc commented Jan 19, 2021

@SuperSandro2000 done

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 98992 run on x86_64-linux 1

2 packages built:
  • terraform-full
  • terraform-providers.libvirt

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @Mic92

@Mic92 Mic92 merged commit ec334a1 into NixOS:master Jan 23, 2021
@lblasc lblasc deleted the terraform-provider-libvirt-patch branch January 24, 2021 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants