Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

iPXE boot not always load cloud-init if there are more than one interace run dhcp #2144

Closed
liyimeng opened this issue Oct 30, 2017 · 6 comments

Comments

@liyimeng
Copy link

RancherOS Version: (ros os version)
v.1.1.0
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)

As suggested with Sven in #1790 I open this issue.

This happens If you have more than one interface on your machine. To reproduce, create a KVM VM with two interfaces, pxe boot from one of the interface. In case you also have another dhcp server running on another interface, it is almost 100% fails.
I guess this is a timing issue, related to #2141

@niusmallnan niusmallnan self-assigned this Dec 22, 2017
@niusmallnan niusmallnan added this to the v1.1.3 milestone Dec 22, 2017
@strowi
Copy link

strowi commented Jan 16, 2018

any news on this? Seems im running into the same problem..

@niusmallnan
Copy link
Contributor

@strowi Can you show me your iPXE file? I'm working on this.

@strowi
Copy link

strowi commented Jan 17, 2018

@niusmallnan here it is ;)

KERNEL boot/rancher-1.1.3-vmlinuz rancher.state.formatzero=true rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda] rancher.cloud_init.datasources=[url:http://10.10.0.10/rancher/cloud-config.yml] rancher.autologin=tty1 rancher.debug=true
INITRD boot/rancher-1.1.3-initrd
ssh_authorized_keys:
  - ssh-rsa ....

rancher:
  state:
    fstype: auto
    dev: LABEL=RANCHER_STATE
    autoformat:
    - /dev/sda
    formatzero: true

  sysctl:
    fs.inotify.max_user_watches: 16184
    net.ipv4.tcp_tw_reuse: 1

  console: ubuntu

But it might be related to a slow dhcp, the logfile dosn't show the dhcp-config, but the nameservers from google.
The request for the cloud-config.yml never reaches the webserver hosting it.
But after some time network is present.

@niusmallnan
Copy link
Contributor

@strowi
There is a workaround, if there are two NICs are open DHCP. There should be only one for IPXE boot. So can be configured like this.

IPXE file:

KERNEL boot/rancher-1.1.3-vmlinuz rancher.network.interfaces.eth0.dhcp=true rancher.state.formatzero=true rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda] rancher.cloud_init.datasources=[url:http://10.10.0.10/rancher/cloud-config.yml] rancher.autologin=tty1 rancher.debug=true
INITRD boot/rancher-1.1.3-initrd

Cloud-config:

ssh_authorized_keys:
  - ssh-rsa ....

rancher:
  state:
    fstype: auto
    dev: LABEL=RANCHER_STATE
    autoformat:
    - /dev/sda
    formatzero: true

  sysctl:
    fs.inotify.max_user_watches: 16184
    net.ipv4.tcp_tw_reuse: 1

  network:
    interfaces:
      eth0:
        dhcp: true
      eth1:
        dhcp: true

  console: ubuntu

It can work fine on my test setup.

@strowi
Copy link

strowi commented Jan 20, 2018

@niusmallnan thanks for the workaround. It does work fine in our network.

Just in case it might help you fixing this for everyone..
Additionally, i did some more testing in our network, wondering why dhcp was so slow. After checking the dhcp/router/interconnect etc..
It came down to the switch/port activating fastlink on that port seems to have done the trick. Machine gets an ip in < 5secs.

thx again!

@kingsd041
Copy link
Contributor

Tested with RancherOS v1.2.0-rc2
Fixed, closed it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants