I'm currently trying to "clone" a working Ubuntu 18 instance. Essentially I just want to make multiple instances from a single preconfigured Ubuntu 18.04 instance. The preconfigured Ubuntu instance is using Google's stock Ubuntu 18.04 LTS image and is fully functional and reachable.
I have attempted to clone it in two ways:
- Creating an image from the bootdisk of the preconfigured Ubuntu instance to use while creating a new Ubuntu instance.
- Creating a snapshot of the preconfigured Ubuntu instance to use when creating a new Ubuntu instance.
When deploying the new instance via either one of these methods, the new instance seems to have lost all means of connectivity. The deployment looks to be successful; I can see the internal IP being assigned to nic0 in GCE. It's internal IP, unlike the preconfigured Ubuntu instance, cannot be pinged and SSH doesn't work.
Upon connecting via Serial0 and running ifconfig
I tell that there seems to be no networkinterface except for lo
. This makes me think that when creating the new instance from an image or snapshot it does not create the networkinterface, even though I am assigning and internal IP and ephemeral IP.
The Serial0 logs also generates these logs in the following order:
[ 2.077602] virtio_net virtio1 ens4: renamed from eth0
[[0;32m OK [0m] Started Raise network interfaces.
[[0;32m OK [0m] Started Network Service.
Starting Wait for Network to be Configured...
Starting Network Name Resolution...
[[0;32m OK [0m] Started Wait for Network to be Configured.
Starting Initial cloud-init job (metadata service crawler)...
[[0;32m OK [0m] Started Network Name Resolution.
[[0;32m OK [0m] Reached target Host and Network Name Lookups.
[ 16.249051] cloud-init[1068]: Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~18.04.1 running 'init' at Sat, 23 May 2020 18:42:35 +0000. Up 16.12 seconds.
[ 16.272622] cloud-init[1068]: ci-info: +++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++
[ 16.292596] cloud-init[1068]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
[ 16.312622] cloud-init[1068]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
[ 16.332577] cloud-init[1068]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
[ 16.352578] cloud-init[1068]: ci-info: | ens4 | False | . | . | . | 42:01:0a:01:00:15 |
[ 16.373422] cloud-init[1068]: ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . |
[ 16.392574] cloud-init[1068]: ci-info: | lo | True | ::1/128 | . | host | . |
[ 16.412605] cloud-init[1068]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
May 23 18:42:38 ubuntu-gui kernel: [ 2.077602] virtio_net virtio1 ens4: renamed from eth0
Ens4 seems down in Serial0, and eth0 is not present at all. Both ifup ens4
and ifup eth0
return "Uknown interface".
All other instances in the same network have connectivity and SSH, I'm quite sure it's not a firewall problem. Is there a way I can make sure all instances using the image will have working interfaces that actually get their IP-address from GCE?
Thanks in advance!
Edit 1:
While trying to troubleshoot, I found that somehow the new instance does detect the network interface. Although it looks like there is no way to enable them AFAIK.
ykoolhout@ubuntu-gui:~$ sudo ethtool ens4
Settings for ens4:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: no
ykoolhout@ubuntu-gui:~$ sudo ifup ens4
Unknown interface ens4
Edit 2:
It seems the way Google preconfigures it's VM's gets broken when installing the Ubuntu-GUI via apt-get install ubuntu-desktop
. The VM still works, but when making a machine image of it and creating a new instance from that machine image will make the new instance break Google's guest environment. New followup question posted here.