Multiple VM template - 1 agent + 1 user_data or ...?
Hi. Love Coder.
All public templates appear to assume provisioning only 1 compute thing.
I'm writing a Template that can provision a cluster of VMs but I'm getting an error when I try to create equal count of coder agents ("duplicate agent name: agent"). resource coder_agent is missing a
name
attribute so it can't be created in a loop/count.
* Is there a reference for deploying multiple VMs?
* Does each aws_instance
need a unique coder_agent and unique user_data?
Any guidance would be great. tyvm.
5 Replies
<#1339871639327870996>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
I don't think you can create agents from a loop due to the way it's done because the resource name has to be unique, and even if you could, it would still be tough to identify which agent belongs to which VM.
Is there a reference for deploying multiple VMs?I don't think so, no
Does each aws_instance need a unique coder_agent and unique user_data?It all depends on what you want to achieve, the
coder_agent
is necessary if you want each VM to show up in the UI.
for the user_data, assuming you're talking about cloud-init, reusing should be fine but you'll end up with duplicate hostnames@Phorcys That aligns with my late night trial-and-error debugging sessions.
Thank you for the thoughtful reply!
I'm closing this issue, please reopen it if you need help!
@Phorcys closed the thread.