Could Consul be used to trigger an operation when a new FSX service gets registered?

I’m not sure if this might be a use case for consul terraform sync, but one thing I’m trying to solve is using FSX for a VFX rendering cluster, and triggering a mount command on arrival of a new service.

When I spin up a new FSX endpoint with Teraform, it will have some dynamic private IP. I’m guessing I can somehow register that as a service as well with consul (even though its not the node itself that I’d be running consul services register from), but that should be the easy part I hope.

…what I would like to do is that when the render nodes see the new FSX storage service has arrived via consul, to trigger a mount command, so they could all properly mount the storage from the newly registered DNS name.

This is an annoying problem with FSX using dynamic IP’s, because linux doesn’t realy mount by DNS name. Once you trigger a mount of /etc/fstab, any DNS name seems to get baked as the IP available at that time. Hence, when an FSX service arrives, any render nodes are going to have to mount again, they wont have a valid IP address for FSX form last time the mount existed and disappeared.

Can consul solve this problem?

Hi @queglay! Thanks for this question. I think you are in the right direction about using Consul-Terraform-Sync as a solution.

I would recommend to take a look to see Terraform’s Provider for FSX to see if it includes the ability to mount a filesystem. I believe it’s this one. Then move to getting Consul setup and then Consul-Terraform-Sync.

Here is some documentation for CTS and some getting started tutorials that can help.

1 Like