Instance not accessible after shanpshot backup and restore due to DHCP  [SOLVED]

Locked
User avatar
hexacube
Posts: 18
Joined: Mon 27. Jul 2020, 09:48
Location: India
Contact:

Instance not accessible after shanpshot backup and restore due to DHCP

Post by hexacube »

Problem:
A good working keyhelp instance after backup and restore using snapshot feature in GCP VM or AWS EC2 will become inaccessible in all ports like SSH (22), HTTP (80), HTTPS (443) etc.,

This is due to the restriction in DHCP which makes the instance to be accessible through original internal IP address assigned during instance creation.

Solution:
This can be solved by following the steps mentioned below. Do this in fresh / good working keyhelp installation before backup / migration.

1. Login as root user and run following commands

sudo su
cd ~
sudo nano /etc/netplan/50-cloud-init.yaml

2. Remove existing & paste the following

network:
ethernets:
ens4:
dhcp4: true
optional: true
version: 2

3. Save the file and run the following commands.

sudo netplan apply
sudo netplan try

4. Press ENTER and accept, then run the following

sudo netplan ip leases ens4

--------------------------------------------

Now do a snapshot backup and create new instance from backup. The instance will be accesible in all ports and keyhelp will work fine just like the original instance.

This will be useful for people who needs to wish to migrate or restore instances from backups between same or different cloud providers. Thought of sharing this solution. Took me 3 days to identify the issue.

The panel was awesome. Thanks to keyhelp dev team. Kindly fix this bug in future releases too. Thank You.
User avatar
george
Posts: 87
Joined: Fri 3. Jan 2020, 05:53
Location: AUSTRALIA

Re: Instance not accessible after shanpshot backup and restore due to DHCP  [SOLVED]

Post by george »

Hello Hexacube,
this setup will be different, for different providers.

Thanks for the tip, it is definitely worth noting for migrations. ;)
Locked