Openstack - statefull - fully automated


#1

Hi Folks,

the Goal is: provision fully automated a stateful RancherOS in Openstack, which registers automatically against an existing Rancher-Server.

Currently we are using a little modified RancherOS-ISO Image as Disk for Openstack, append a 70GB ephemeral Disk (as Mountpoint for ‘/var/lib/docker’) and start it fully automated with a cloud-config, so that it automatically registers as new Agent to an existing Rancher-Server. This works just fine.

The only modification to the ISO is the datasource for the cloud-config, because we cannot use the config-store-Method from OpenStack (because Cloudforms doesn’t support it, yet…):
------------------------ >8 -------------------------
$ git clone https://github.com/rancher/os.git
$ cd os
$ sed -i ‘s#configdrive:/media/config-2#url:http://169.254.169.254/latest/user-data#’ os-config.tpl.yml
$ make
------------------------ >8 -------------------------

The Problem is, that it doesn’t have a state-partition, so when agents reboot, they register as new Agent at the Rancher-Server and weird things happen.

What is the preferred solution for our Issue?

  • Is it possible to create an Openstack RancherOS-Image with a state partition?
  • Do I need to do a ‘ros install’ and reboot (Cloudforms uses the ISO as disk-Image, not as “floppy disk”)? How can this happen fully automated?
  • Can I create this partition via Cloud-Config and RancherOS can use it from first start? I tried that with ‘disk_setup’ but had no success. No partition appear. Is there a way to debug the cloud-init execution?

Sorry for the bunch of questions, but I invest several hours (days) with no luck.

Thanks and kind regards,
larsux