I have an Ubuntu 14.04 based NFS server AMI wrapped with a Launch Configuration and an Auto Scaling Group of just a single instance (min/max/req). This is just to make sure that if the server goes down, a new one will automatically replace it. The shared directories are located on an attached EBS volume. I need to make sure that when a server goes down for whatever reason, and a new one comes up, it will have the same Internal IP and will attach the EBS to it, so it can keep on serving the NFS clients. I figure the best approach would be using cloud-init. Any ideas on how to attached the EBS and set an internal IP would be appreciated!
Thank you in advance! Amit.
You cannot specify the private IP in an Auto Scaling Group, but there is a way to accomplish the same goal. Use a userdata script to attach the same EIP to the instance upon launch. You can then use the public DNS of the EIP as the remote host for your NFS clients.
When the NFS clients use DNS to perform a lookup on the public DNS of the NFS server, they will be returned the private IP of the instance.