I take create an AMI image from a Linux running instance [ centos ]. It has only private IP. Some of the random instance while restoring in a different VPC, retains the old IP or we just couldn't reach it.
Source AMI server has:
[centos@ip-xxxx ~]$ cat /etc/sysconfig/network
# Created by cloud-init on instance boot automatically, do not edit.
#
NETWORKING=yes
[centos@ip-xxxx ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[centos@ip-xxxx ~]$ cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
search ec2.internal
nameserver xxxx
Has anyone faced this? Why is it happening? I couldn't find any pattern. Similar servers from same VPC when I restore the AMI, some works, some doesn't randomnly. Its so confusing! Any help appreciated. Thanks.