Restarting CoreOS missing files

1.3k views Asked by At

Trying to evaluate CoreOS. It really looks like it is an interesting product and I was trying to see about simply starting up networking. I got a static configuration to work by doing the following:

Create a static network file in the /etc/systemd/network/ folder.

It is my understanding that the important parts of the file name I drop into this directory are the number at the beginning of the file for cases when I have multiple network files this will help to determine which file is applied first and the ".network" suffix to declare that this is a network configuration file

The contents of /etc/systemd/network/10-static.network is as follows (yes, this is a very simple configuration):

[Network]
Address=192.168.1.102/24
Gateway=192.168.1.2

I then tried starting the service: sudo systemctl start systemd-networkd

This actually worked and assigned a static ip address that was visible when running ifconfig.

Here is my problem. I rebooted the CoreOS virtual machine and noticed that the networking was no longer set on reboot. When I check the /etc/systemd/network/ folder it is empty and my configuration file apparently disappeared on reboot.

Does anyone know why this would have happened?

Thanks in advance for any help on this!

2

There are 2 answers

1
Rob On

Files on disk shouldn't disappear on you like that. Did you happen to PXE-boot this VM or somehow use a file system in RAM?

A better way to do this config is with cloud-config, which CoreOS uses to configure machines at boot. It's intended to provide a repeatable way to set up networking, mount disks and things like that. The steps that you completed manually can be done with cloud-config like this: https://coreos.com/docs/cluster-management/setup/network-config-with-networkd/

More info about cloud-config in general: https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/

0
松丸頒泰 On

You must remove ISO image, coreOS maybe reboot same ISO image. If you remove ISO image, coresystem can reboot from new system.

I experienced the same situation before.