I’m playing with the Opennebula provider for Terraform and have a question about how to resize an existing image. In the documentation I can’t find how to resize an existing image, only how to create a new image. I have tried different things, but each time the existing image will be deleted first and then recreated instead of resizing the current image.
The image is in use by the virtual machine, so I had also played around with options described here. Only this gives the same result, the image will be deleted.
Is it possible to perform a live disk resize via Terraform? And if so, how could I do this?
Thanks for helping!
 Terraform Registry
It’s related to the way the terraform handles existing parameters, I remember I had this problem a long time ago but managed to fixed by trimming down on config parameters. Can you share your existing resource?
In the end you should end up with something like this.
image_id = data.opennebula_template.template.disk.image_id
size = var.os_disk_size * 1024
target = "vda"
Thank you! This is exactly what I was looking for. I just had to add the size, then it worked for me.
image_id = opennebula_image.clone_image.id
size = 15 * 1024
target = "sda"