You should only need to change the ips and hostnames in /etc/hosts and in the hostname in the hadoop configs. The latter one here will need to be done via the ambari web ui. If not done in the abmari web ui the configurations will be overwritten each time ambari is started. You will also need to change this hostname in the ui each time you restart the instances. This bit about the hostname can be made unnecessary by changing the value in /etc/sysconfig/network. Just make sure that hostname -f gives you the FQDN that ambari is looking for. However there is nothing that can be done about the ips, these will always change upon restarting the instances, it is possible to write a script that sets the ips in /etc/hosts and is run on startup which will make that part easier.