0

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.

Amit Dunsky
  • 485
  • 1
  • 4
  • 10

1 Answers1

2

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.

Chad Smith
  • 1,489
  • 8
  • 8
  • Interesting approach. Thank you for the idea! Any insights about the attaching of the EBS? – Amit Dunsky Apr 29 '15 at 08:16
  • As long as you have the "DeleteOnTermination" flag set to false, you can attach the same volume upon startup of the new instance, via the CLI `aws ec2 attach-volume --instance-id --volume-id ` – Chad Smith Apr 29 '15 at 16:22