Closed arnarg closed 5 years ago
You should use the rancheros style configurations. https://rancher.com/docs/os/v1.x/en/installation/networking/interfaces/
I see. Unfortunately the format of the data isn't configurable, just the values. Is there any cloud-init data source that uses the rancher style?
If you use AWS or DO, you can do this:
Fair enough.
I really don't mean to argue I'm just curious here :)
On ec2 there's also http://169.254.169.254/latest/meta-data/network/interfaces/
where cloud-init usually pulls networking information from.
I ran into the same problem and solved it for me by doing the following.
Create VM (id 1001 in this example)
vi /mnt/pve/cephfs/snippets/user-1001.yml
(swap mnt/pve/cephfs
with the desired snippets storage).
Put in the following:
#cloud-config
hostname: rancheros
manage_etc_hosts: true
ssh_authorized_keys:
- ssh-rsa YOUR-PUBLIC-KEY
- ssh-rsa ANOTHER-PUBLIC-KEY
chpasswd:
expire: False
users:
- default
package_upgrade: true
rancher:
network:
interfaces:
eth0:
address: 192.168.100.222/24
mtu: 9000
dhcp: false
Register the config in the machine: qm set 1001 --cicustom user=cephfs:snippets/user-1001.yml
Hi,
I tried to autoinstall RancherOS inside a VM in Proxmox but I have problem. Can you help me on this issue ?
I create a VM and mount rancheros-proxmox-ve iso in CDRom and via Cloud-init I create this file:
#cloud-config
rancher:
network:
interfaces:
eth0:
address: 10.10.10.5/24
gateway: 10.10.10.1
mtu: 1500
dhcp: false
dns:
nameservers:
- 178.22.122.100
- 185.51.200.2
write_files:
- path: /opt/rancher/bin/install.yml
permissions: "0700"
content: |
#cloud-config
rancher:
network:
interfaces:
eth0:
address: 10.10.10.5/24
gateway: 10.10.10.1
mtu: 1500
dhcp: false
dns:
nameservers:
- 8.8.8.8
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAu+cJj5HKIb7P9tTM9KE+9Zj5L+jWBh4KcCovonJvv9NwUPykEp4iSzATwrPr/8QtQEnsSuoZiQldt+XuAs7gOhMksrhPFNmS7C3efxwWLJvPqbXrSIBGkDFNss64bL+lhyDZvZ6jkihS+QuI9D4gKhKfcdjrgyWSe7OwAgrfsw5thZ9l2i/tG6yTjqhrPIsyUzPYtfn5QUcLuCd1+vO5J0TX0a8JZtob0bzHX4kJcCh44LWO7aA0wL7ti6BPNOEGISRk2VhyFuhCTCNZTznMplPcpqdTDEd1T0YAvS2nQNXcFGVgb0m04Abj61FRKUBBHXFZS6X5wEC98B5e5CtTvDlw== rsa-key-20190921
- path: /opt/rancher/bin/start.sh
permissions: "0700"
content: |
#!/bin/bash
echo Y | sudo ros install -f -c /opt/rancher/bin/install.yml -d /dev/sda
qm set 1001 --cicustom user=cephfs:snippets/config-1001.yml
When I boot the machine its not used the config file.
@mizbanpaytakht Try clicking on "Rebuild ISO" on the cloud-init drive in proxmox web ui. Maybe this will resolve your problem (the config might not have been absorbed into the iso fs used for cloud-init)
@mizbanpaytakht Try clicking on "Rebuild ISO" on the cloud-init drive in proxmox web ui. Maybe this will resolve your problem (the config might not have been absorbed into the iso fs used for cloud-init)
@discordier No this not fixed my problem, Maybe since I mount rancheros.iso file in CDRom cause this problem ! How can I get rancheros .img file to import it into server disk.
Don't know, I boot from the iso (first CD-ROM drive) and have my config as mentioned above in the cloud-init drive (second CD-ROM) in my VM and it boots correctly.
Did you follow above steps correctly? Did you double check paths and settings?
@discordier Which ISO did you used ? Are you working on Proxmox VE 6 ? Cloudinit create metadata and userdata from YML file and I import it but Rancher didnt use it
I use rancheros-proxmoxve-autoformat.iso and yes, I have 3 V6 proxmox nodes running one rancher VM each
RancherOS Version: (ros os version) v1.4.2
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) Proxmox/KVM
Proxmox supports cloud-init as of version 5.2. By default it uses NoCloud which doesn't seem to be supported by RancherOS but can be set to configdrive2. When I change my VM to configdrive2 RancherOS picks up everything from cloud-init except networking, it uses dhcp instead.
When I mount the configdrive it has the following.
openstack/latest/user_data:
openstack/latest/meta_data.json:
openstack/content/0000:
/var/lib/rancher/conf/cloud-config.yml
only includes: