Skip to content

Instantly share code, notes, and snippets.

@itzg
Last active November 28, 2019 10:00
Show Gist options
  • Save itzg/608cad532cb61d6b6c10 to your computer and use it in GitHub Desktop.
Save itzg/608cad532cb61d6b6c10 to your computer and use it in GitHub Desktop.
#!ipxe
# Setup shared static IP for bootstrapping
set net0/ip 10.1.173.14
set net0/netmask 255.255.255.0
set net0/gateway 10.1.173.254
ifopen net0
set channel alpha
set base-url http://10.1.173.10/coreos
kernel ${base-url}/${channel}/vmlinuz coreos.autologin coreos.configdrive=1
initrd ${base-url}/${channel}/initrd
boot
mkfs.vfat -n config-2 -I /dev/sdc
mkdir -p /media/config-drive
mount /dev/sdc /media/config-drive
mkdir -p /media/config-drive/openstack/latest
cp cloud-config.yml /media/config-drive/openstack/latest/user_data
umount /media/config-drive

NOTE mkfs.vfat is provided by the dosfstools package

Creating in vCenter

From an existing VM, such as one running Ubuntu or CentOS, edit the VM settings and add a new Hard Disk:

vSphere Web Client

I created the size with a number of MBs corresponding to the node index :), 15 MB => *.15, 16 MB => *.16, ...

Run the commands above but alter /dev/sdc to /dev/sdb if that new disk is the second one attached to the VM. In my case it was the third, so /dev/sdc for me.

Remove the new disk from that VM and then go over to the CoreOS VM instance. This time in edit VM settings, add "Existing Hard Disk". Click "Add" and navigate to the Datastore folder for the VM (above) and find the vmdk with the size used above:

vSphere Web Client

#!ipxe
# Setup shared static IP for bootstrapping
set net0/ip 10.1.173.14
set net0/netmask 255.255.255.0
set net0/gateway 10.1.173.254
ifopen net0
# Boot a persistent RancherOS to RAM
# Location of Kernel/Initrd images
set base-url http://10.1.173.10/rancheros
kernel ${base-url}/vmlinuz \
rancher.state.autoformat=[/dev/sda] \
rancher.password=rancher \
rancher.cloud_init.datasources=[configdrive:/media/config-2]
initrd ${base-url}/initrd
boot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment