Open cwaazywabbit opened 2 years ago
~Using a 32-bit number for the volume size (go int
type) was rather unfortunate. This is also preventing me for using this variable at all, which makes this whole thing quite useless.~
~Are you guys open to switching it to a int64
in PR? Any objections for that? Or change the unit to Megabytes (this would be a breaking change I guess)?~
~PS This seems to be a terraform rabbit hole. There is a Float
number, but I'm starting to think that we should instead switch to a String
and convert it internally to the underline uint64
type. And I also think we should let the user specify the unit, e.g. '60g' for 60 Gigabytes. What do you think @dmacvicar?~
PS Scrape all my comment... at https://github.com/dmacvicar/terraform-provider-libvirt/blob/68c9bb05fd229efd70db0fe8cd0c1faef9c6e64f/libvirt/resource_libvirt_volume.go#L166-L169 its actually using a platform-dependent int
. With 64-bit Go, this is actually a 64-bit number, so this is no longer problem. Sorry for the noise.
I was able with the trick in the description of the issue to increase an image to a size bigger than an int. I see this issue as fixed.
Hi @SchoolGuy, could you elaborate a bit?
System Information
Linux distribution
Debian
Terraform version
Terraform v1.1.7
Provider and libvirt versions
Checklist
[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[X] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
Description of Issue/Question
Setup
Steps to Reproduce Issue
Any value for disk
libvirt_volume.ubuntu-20_04-resized.size
that is larger than 1.99GB=2147483647 bytes (integer max size) throws the following exemplary error:Error: size: must be a whole number, got 2.147483648e+10
The error is gone when reducing to 2147483647 and lower. I believe it's related to this line: https://github.com/dmacvicar/terraform-provider-libvirt/blob/main/libvirt/resource_libvirt_volume.go#L34
Additional information:
Do you have SELinux or Apparmor/Firewall enabled? Some special configuration? no