-
Notifications
You must be signed in to change notification settings - Fork 32
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
Make 'sizes'in MiB, GiB, TiB #203
Comments
Two possibilitys:
The Xen-orchestra apis expect bytes, so it was the natural choice.
Neither HCL [0] nor terraform [1] implement support for those directly. So for supporting different measurements i see three ways:
something like this: data "convert_size" "10GiB" {
count = 10
unit = "GiB"
}
data "convert_size" "8GiB" {
count = 8
unit = "GiB"
}
resource "xenorchestra_vm" "vm" {
memory_max = data.convert_size.8GiB.bytes
disk {
size = data.convert_size.10GiB.bytes
}
} |
It seems that Hashicorp sentinel supports something similar to this. Unfortunately that is only an enterprise feature. I would prefer the data source or similar route because I don't think introducing a backwards incompatible change or additional resource arguments is worth the inconvenience. I also believe that this data source doesn't need to be contained within this provider since it's more generic than that. Another interim solution would be to define local variables and reference those to do the multiplication for you.
I tried searching terraform's issue tracker to see if it was possible for a provider to export "constants" or something similar to the locals above. I'd like to research if the community is doing anything there as well. |
Yeah I understand the points of you guys. But look at it from a persons perspective. I for instance have to continually grab an calculator to see for example how much 1024 MiB is in bytes. While in for instance vSphere or Telmate I can define the amount in MiB (even this would be a huge improvement). It's just time consuming to continually look for how many bytes a certain amount of KiB, MiB, GiB or TiB is, if you know where I am coming from. |
Currently I am setting up the sizes of my memory and disk(s), and when I used the terraform provider for lets say vSphere. I had to adjust the sizes in either MiB, GiB or TiB. But in Xenorchestra I have to put everything in 'Bytes'. Why is that?
Is there a way to add support for MiB, GiB and TiB?
The text was updated successfully, but these errors were encountered: