So this is stupid


coreOS is kind of a b-tard to get running on Vultr. The coreOS Vultr example shows this neat cloud-config bootstrapping script example, but I really didn’t want to put the YAML inside the bash like they showed. I did it this way instead, where the bootstrap script uses curl to grab the config file.

#!/bin/bash

times=5
counter=0

function dlConfig {
    curl https://s3-us-west-2.amazonaws.com/mybucketnameishere/cloud-config/basic.yaml > basic.yaml
    if [ $? -ne 0 ]; then return 1; fi
}

function giveUp {
    echo "failed downloading $counter times. giving up"
    exit 1
}

dlConfig
while [ $? -ne 0 ]; do
    let counter++
    if [ $counter -eq $times ]; then giveUp; fi
    echo "failed dl cloud-config $counter times, waiting 5s then trying again"
    sleep 1
    dlConfig
done
    

sudo coreos-install -d /dev/vda -c basic.yaml
sudo reboot

Before I added the ifs and while loop, I was getting intermittent results. coreOS would install to the disk, then reboot, but wouldn’t have access because my SSH pubkey didn’t make it in. Such a pain to debug, because everything I needed to see was running on coreOS in a terminal I couldn’t access, because coreOS was in the process of installing or whatever.

It still might be intermittent. More testing is required. Vultr did have some HTTP problems the other day that were making my iPXE scripts fail. GAH Vultr, I love you for taking bitcoin, but I’m getting nowhere! (Or maybe I am. Or I’m not… I have no way of telling because your control panel gives me no logs!)

Edit: seems solid at the Chicago datacenter, but Intermittent at Seattle!

Edit: scratch that, it’s intermittent at Chicago!

Looking for VOCALOID trading cards?

Check out Sakura Blossom Trading Post