We have talked about how to setup a CoreOS cluster in my previous post: Setup CoreOS Cluster Manually with VirtualBox. However, as we setup the cluster in VirtualBox, which uses DHCP as default, the etcd2 may not work when VM’s IP changed.

So in this article I’ll tell you how to upgrade your cluster and enable the VMs use static IPs instead of DHCP.

Setup Static IP

First of all, make sure your cluster node VM uses the bridge connection type (as default), that will enable the connection between outer world, as we are not going to set IP tables.

In each node VM, create file static.network in path /etc/systemd/network/, if the directory doesn’t exist, create one.



  • Name is your network interface, you may run ifconfig to check.
  • Make sure your static IP Address is in the period of your host machine’s network, as we use bridge connection type.
  • Make sure you have the right DNS, you may copy from /etc/resolv.conf

Update ETCD2

We need to update etcd2 as the IPs changed.

First, we need a new discovery key, so

    curl https://discovery.etcd.io/new?size=3

Then, just update to the new discovery key and new IP addresses.

Last and most important, we need remove several files to make our new etcd2 settings work.

    sudo rm -rf /run/systemd/system/etcd2.service.d/

    sudo rm -rf /var/lib/etcd2

It’s done

Do these updates on each node VM, and restart them on the same time. Then you’ll find you have a new CoreOS cluster with static IPs, enjoy!