vatesfr / terraform-provider-xenorchestra

Xen Orchestra provider for Terraform
MIT License
152 stars 32 forks source link

xoa_vm resource does not implement updates for attributes that require halting the VM #40

Closed ddelnano closed 3 years ago

ddelnano commented 4 years ago

Attributes like memory and cpu require the VM to be halted before they can be applied. Since that is more complexity than updating the simpler attributes at runtime I am going to accomplish this separate from #35

olivierlambert commented 4 years ago

In theory, it can be done live IF it's within some boundaries: can change vCPU numbers from 1 to max vCPU. Memory can be change within the dynamic range, capped by static range.

But it's complicated. I suppose it's more reasonable to do that when they are powered off.

ddelnano commented 4 years ago

Yea I still haven't fully grokked all the cpu and memory settings for VMs yet. I think that would be a great optimization (and I'll make sure to create a separate issue for it) but for now I will focus on making these updates possible and then edge cases can be made better in the future.

ddelnano commented 3 years ago

This has been addressed in #144. I implemented the online resizing of CPU and memory when possible. For updates that require the VM to be halted, terraform will stop the VM perform the full vm.set and then restart the VM.