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

Memory MiB quantity value shows discrepancy in terraform plugin and Prism. #654

Closed
abhimutant opened this issue Jan 5, 2024 · 3 comments
Assignees

Comments

@abhimutant
Copy link
Collaborator

Affected Resource(s)

  • nutanix_virtual_machine

Steps to reproduce:

  1. Create vm resource with 2044 MiB of RAM
  2. Change TF file to 4096 MiB
  3. Apply the updated TF file and it works fine.
  4. Reapply the same TF file : a change is requested, current RAM value is equal to Prism info
  5. Again, reapply the TF, it works as expected.

On Analysis, seems GET API /v3/vms/<vm_uuid> shows updated value of RAM which is different from TF config. This results a change requested in the current TF config.

@abhimutant
Copy link
Collaborator Author

As per discussion with Prism team, If VM is powered ON then adding memory to VMs can only be done in 1GB increments else rounding up happens automatically. A ticket is tracked to mention this behaviour in API reference doc.

@mbilel
Copy link

mbilel commented Jan 17, 2024

Hello,

The solution does not seem to be good, I entered multiple values of 1024 for my machines, but nutanix modified them:

Value in code predicted on nutanix actually allocated by nutanix
memory_size_mib : 2048mib # =1024 x 2 2Gib 2.95Gib
memory_size_mib : 16384mib # = 1024 x 16 16Gib 16.625 Gib

Best regards,

@Golgautier
Copy link

Hello,

I did additional tests, here are the results :

TEST 1
I created a VM with TF, then updated memory values with these ones : 2000 -> 2048 -> 3072 -> 4096
Result was : 2000 -> 3024 -> 4048 -> 5072

TEST 2
I created a VM with TF, then updated memory values with these ones : 2048 -> 3072 -> 4000 -> 4096
Result was : 2048 -> 3072 -> 4096 -> 4096

My understanding :

  • You enforce 1024 multiples values for memory update in a VM and it seems to be successful
  • However :
    • It works only if starting value is also a 1024 multiple value. If not, new value is incorrect
    • VM creation can still be done with no 1024 multiple values

Note : update VM creation feature to enforce 1024 multiple value for memory could be a kind of fix, but we will still have a problem for existing VM with a memory with a non 1024 multiple value for memory.

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

3 participants