Replace <Instance_ID>
with the unique ID of your Instance, e.g. 0500ebd2-d70d-49af-a969-3ac09b6f7fff
.
Fix unreachable Ubuntu Focal Instance when it has two public IP adresses
When using an Ubuntu 20.04 Focal Instance with more than one routed IP address, the Instance will become unreachable after a reboot. This may happen when you attach a second routed IPv4 or IPv6 IP address to the Instance.
The version of systemd-networkd
used in Ubuntu Focal does not support the definition of a default route which is not part of the subnet of the network interface. The on-link: true
option must be added to the netplan profile.
A modified cloud-init
package named cloud-init_24.2-0ubuntu1~20.04.1+scaleway
has been added to Scaleway’s stable PPA to work around this situation.
Your Instance has not been rebooted
- Add Scaleway’s stable PPA
add-apt-repository ppa:scaleway/stable
- Add the modified cloud-init package
apt -y install cloud-init
- Re-initialize cloud-init to fix the netplan profile
cloud-init cleancloud-init init --localcloud-init init
From this point on, your Instance may be safely rebooted and you will no longer lose connectivity.
Your Instance has rebooted and is no longer reachable
Rescue mode allows you to boot your Instance into a temporary operating system, running from the Instance’s RAM. Rescue mode is often used to diagnose and resolve issues such as faulty kernel configurations, networking issues, firewall configurations, and more.
- Switch the Instance’s
boot-type
torescue
and reboot your Instance into rescue mode using the CLI:
scw instance server stop <Instance_ID># Wait for the instance to be stopped.scw instance server update <Instance_ID> boot-type=rescuescw instance server start <Instance_ID>
- Once the Instance is rebooted, log into your Instance using SSH and set up the environment to be able to chroot into it:
cat /proc/partitionsmajor minor #blocks name7 0 65480 loop07 1 89120 loop17 2 39760 loop2252 0 19531250 vda252 1 19417569 vda1252 14 4096 vda14252 15 108544 vda158 0 9765625 sda8 1 3240943 sda18 14 4096 sda148 15 108544 sda15
Then mount the partitions and get into the chroot
:
mount /dev/vda1 /mntmount -o bind /sys /mnt/sysmount -o bind /proc /mnt/procmount -o bind /dev /mnt/devmount -o bind /run /mnt/runchroot /mnt
- Fix the DNS resolution file in the chroot
rm -f /etc/resolv.confln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
- Once in the
chroot
install the modified cloud-init package
add-apt-repository ppa:scaleway/stableapt -y install cloud-init
- Re-initialize cloud-init to fix the netplan profile
cloud-init clean && cloud-init init --local && cloud-init init
- Get out of the
chroot
and remove the mounts
umount /mnt/sys /mnt/proc /mnt/dev /mnt/run /mnt
- Stop the Instance, switch back the Instance’s
boot_type
tolocal
, and reboot the Instance:
scw instance server stop <Instance_ID># Wait for the instance to be stoppedscw instance server update <Instance_ID> boot-type=localscw instance server start <Instance_ID>
Once rebooted, your Instance will be reachable again.
This modification will be valid for up until Ubuntu publishes a new version, i.e. cloud-init 24.3. You can use the following commands to hold the newly installed version so it does not get updated when the new version comes in.
- Put a hold on the newly installed cloud-init
apt-mark hold cloud-initcloud-init set on hold.