Problems provisioning Host on vsphere

I have actually solved it the problem was that when using docker-machine with the vshpere driver, vsphere connects to the open-vm-tools in order to transfer userdata.tar(ssh keys, etc.). This connections is using the username:pass docker:tcuser which had to be created in the container running open-vm-tools. (I had to hack some other details related to docker-machine expecting boot2docker and not rancher), but it is working now. Kind of…

The Host can be created (even from the Rancher web interface) and container can run etc., but the disk is not formatted…
Here is what I found out:
A magic string is added to the partition from docker-machine for several drivers, but not for vsphere. RancherOS (as well as boot2docker) looks for this string to format the right disk. It is not found, so no disk is formatted

So now I’m trying to hack it so that it formats the correct disk, similar what boot2docker does here:
https://github.com/boot2docker/boot2docker/blob/master/rootfs/rootfs/etc/rc.d/automount
, but it fails with the following errors:

It comes from init.go where it tries to set the configuration on which disk to format. Somehow it seems /var/lib/rancher/conf is empty at this moment…
On boot2docker this part works fine…
To reproduce just add

boot2DockerEnvironment = true
cfg.Rancher.State.Dev = “LABEL=B2D_STATE”
cfg.Rancher.State.Autoformat = string{“/dev/sda”}

to line 270 of init/init.go

I’m using Tag 0.7.1 as I had issues creating a working iso on master (even for boot2docker)

Any hints that could help me solve it would be appreciated.

Once it’s working I’ll happily share the modifications/images. For the issue at hand it is just not relevant and it still needs some cleaning up, as it it still is a proof of concept.