Silly question - How to copy cloud-config to esxi VM?

Hi All,

You’ll probably laugh but I’ve been struggling to copy the darn cloud-config.yml file to my VM. I have tried creating an ISO but can’t figure out how to mount it and read from it. I’ve tried the VMWare guestinfo properties with no luck.

Any suggestions? Appreciate any response.

Thanks.

on rancher
sudo vi cloud-config.yml

then press i for insert
paste in the the contents of cloud-config.yml from your PC editor ctrl+shift+v in Linux

esc esc :wq! enter

That’ll work but I can’t paste in my SSH public key…

The key is a string of characters that should be on one line. Go to the beginning of the last line of the key and press backspace. Then press home to go to the beginning of the line and press backspace again. Keep doing this until it’s just one line. Then select the whole line and switch to your VI window which should be in i mode (press i). In putty do a right mouse click. In ssh on Mint Linux right click then select paste.

The approach that I have taken is to use a mini web server in combination with wget on the RancherOS.

I have the cloud-congfig.yml on my desktop (under git), run python’s embedded web server (python -m SimpleHTTPServer ) - that will expose the current directory over the web server.

Then after booting the VM from the Rancher ISO I do

wget http://IP:8000/cloud-config.yml

And save the result to a file that is then used during install

sudo ros install -c cloud-config.yml -d /dev/sda

The above was the start - I’ve now moved on to using php and templating the cloud-config to support different configurations (including the deployment of various services (consul, rancher agent,dnsmasq - with different configs for “master” and “node”) out of the box) that are accessed using URL varaibles.

I could probably document with examples my workflow if anyone is really interested…

That sounds awesome (the bottom); if you don’t mind documenting/sharing, I would love to see your new expanded approach.

Hi,
I would be interested in your procedure documentation.
I guess you configure a network in rancheros manually, or how do you connect to your web server?

THX

RancherOS running by VMWARE hypervisor will start up a system service open-vm-tools.
I use Share Folder to copy large/long text.
After setting up a share folder.You can see the folders can be seen in ros open-vm-tools conatiner:

system-docker exec -it open-vm-tools bash
cd /mnt/hgfs/<your share folders>
ls

This may not be the ideal approach, but it works in my env.