as explained in https://docs.rancher.com/os/running-rancheros/server/install-to-disk/ this file is copied/pasted from my Linux workstation in the RancherOS console, with the vi command. (it should be noticed that i would prefer a french keyboard, azerty instead of qwerty…but it is not insurmountable).
the problem:
after installation (sudo ros install -c cloud-config.yml -d /dev/sda) and reboot, the host has not the IP address I just set : 172.20.74.148. the IP is now 172.20.74.252, retrieved fom DHCP.
it seems to me that the cloud-config.yml file is not used… and i cannot connect to the host to see its logs…
just before installing RancherOS to disk, i tried to change its IP address, manually:
sudo ip addr add 172.20.74.148/24 dev eth0
sudo route add default gw 172.20.74.254
it was ok, but this does not solve the problem… It just means that the IP 172.20.74.148 works.
I’m having a very similar problem. I installed without setting any network configuration, so everything was assigned by DHCP. When I added configuration to the cloud-config.yml file using the following commands, and then rebooted, I was left completely unable to access my RancherOS installation:
$ sudo ros config set rancher.network.dns.nameservers "['192.168.1.210','192.168.1.211']"
$ sudo ros config set rancher.network.dns.search "['mydomain.com']"
$ sudo ros config set rancher.network.interfaces.eth0.address 192.168.1.219/24
$ sudo ros config set rancher.network.interfaces.eth0.gateway 192.168.1.254
$ sudo ros config set rancher.network.interfaces.eth0.dhcp false
$ sudo ros config validate -i /var/lib/rancher/config/cloud-config.yml
I couldn’t SSH into the machine because it had no assigned IP. I couldn’t login directly from the VM’s host machine because the password for user rancher seems to get reset every boot for no apparent reason.
I had the same issue with 1.0.4 and this is the way i solved the situation:
Booted with kernel parameter rancher.pasword=rancher
Logged in (user rancher / password rancher)
Did a sudo to root (sudo su -)
Configured all the network stuff as it was indicated above with ros config whatever (see the clauses mentioned above)
Confirmed the configuration was valid with ros config validate -i /var/lib/rancher/conf/cloud-config.yml
Rebooted into the new configuration.
NOTICE: Take the chance to add your own SSH key to the cloud-config.yml file above mentioned to allow you log in using ssh rancher@hostname without a password.
That solved the issue for me. BTW, I’m running a couple of ROS servers on a virtual infrastructure based on VMWare and I did all this initial steps from the VMWare console. In KVM based images I can do that from the virsh console.
I’ve set up an TFTP server and configured my DHCP with the right filename and TFTP server yet when my host boots up via the network, it downloads and boots into RancherOS’ installer without the cloud-init file.
Here is my iPXE config that gets pulled :
#!ipxe
# Boot a persistent RancherOS to RAM
# Location of Kernel/Initrd images
set base-url http://releases.rancher.com/os/latest
kernel ${base-url}/vmlinuz rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/xvda] -- rancher.cloud_init.datasources=[url:http://192.168.10.104/cloud-config]
initrd ${base-url}/initrd
boot
the url http://192.168.10.104/cloud-config is reachable and I can download the file from my local client so I know it’s hosted and accessible. My cloud config file is as follows :
I’ve tried allotting a static IP and network configs but nothing sticks. Even host name in CLI prompt doesn’t change. I cannot SSH into the box with my key despite it being in the cloud init file.
Here is a link to the PXE/HTTPd service being used to bootstrap installation media.
I can’t even pass in rancher.password as kernel parameters during boot. Somehow it’s booting and downloading RancherOS but no kernel parameters are being passed in for some reason. What am I missing?
I’m experiencing a similar well. ‘sudo ros install -c cloud-config.yml -d /dev/sda’ or 'sudo ros install -c /absolute/path/cloud-config.yml -d /dev/sda’
Everything set cloud-config.yml for a bare-metal install is ignored during the install process.
Considering how long this issue is an ongoing in this thread and that it’s unaddressed in the latest release demonstrates a serious lack of commitment by the developers in rancherOS. This lack of support for the community terminates utilizing rancherOS in a production environment even with paid support.
Hello thequietplace,
we had some problems too, with rancheros networking, but we got to a final step, where the right IP address and hostname (as other config parameters) were correctly set to the rancheros machine.
Here you can find our cloud-config.yml template file:
Please note: every row starts with a number of character: to make your reading easier, I substituted initial row space with a dot: this is a standard YML format.