Error allocating a new virtual machine template

i’m relatively new to open nebula and am not sure if there’s something wrong with how i’m defining the template via the open nebula terraform provider or if the issue is networking somehow.

this is on an existing install of open nebula 5.8.5. i have terraform defined to create a couple of disk images, a template, and then a vm from the template.

the virtual network in question has 251 total addresses with roughly 10 open leases right now.

when i define an ip in the template/vm, instantiating the vm yields the above error and nothing else. that’s all that’s logged in one.log. schedulers.log only says Cannot schedule VM, there is no suitable host. i haven’t found any other details about why the allocation fails.

if i don’t define a static ip for the nic, the vm instantiates with some non-held lease in the range. i thought at first it was in sequence, but it doesn’t appear to be. first try, it got .20 in the range, which is actually used by some other host but wasn’t a held lease for some reason. next time, it got .46, which isn’t used by anything. i just want to provision via terraform and ensure the vm gets the ip it needs, because dns already points to this ip.

oh, i just remember another detail. after destroying just the vm (if it even instantiated), trying to instantiate a new vm from this template manually in the web ui fails with the same ip/mac allocation error even though there are free leases in this range.

is this an issue with the virtual network config or the template or the terraform provider? it feels like network config somehow, but i can’t imagine what’s wrong.

turns out the ip in question was held, but i didn’t see it. the list of available addresses wasn’t sorted in order for some reason, and i missed it every time. it just didn’t look like it was even in the lease range in the ui. oh well… works fine now.