Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.

Add script to prepare bare metal nodes information #19

Closed
markmc opened this issue Aug 12, 2019 · 8 comments
Closed

Add script to prepare bare metal nodes information #19

markmc opened this issue Aug 12, 2019 · 8 comments

Comments

@markmc
Copy link
Member

markmc commented Aug 12, 2019

As per https://github.com/openshift/installer/blob/master/docs/user/metal/install_ipi.md we need information like the following in install-config.yml with information about the bare metal nodes:

    hosts:
      - name: openshift-master-0
        role: master
        bmc:
          address: ipmi://192.168.111.1:6230
          username: admin
          password: password
        bootMACAddress: 00:11:07:4e:f6:68
        hardwareProfile: default
@markmc
Copy link
Member Author

markmc commented Aug 12, 2019

https://github.com/schmaustech/kni-preflight is an example of an existing script to help with this

The script uses this ansible module - https://docs.ansible.com/ansible/latest/modules/redfish_facts_module.html

Note that check_dhcp is an ELF binary - not clear where it comes from

@russellb
Copy link
Member

Note that check_dhcp is an ELF binary - not clear where it comes from

It appears to be a build of this: https://github.com/nagios-plugins/nagios-plugins/blob/master/plugins-root/check_dhcp.c

@dhellmann
Copy link
Contributor

That script feels more complicated than I would have expected. I thought we didn't need the bootMACAddress for real hardware because the inspection process would discover it. Maybe that's only if we use the auto-discovery feature, though?

@schmaustech
Copy link
Contributor

schmaustech commented Aug 20, 2019

The kni-preflight script is doing more then just grabbing MAC addresses as it is also validating that the DHCP server is going to pass out a IP address for that MAC address via check check_dhcp. It also checks DNS and validates that the api,ns1 and *.apps VIPS are setup in DNS. The complexity of it arises because I was told to use Ansible. Personally I can grab the MACs via Python as that was what I used in kni-wipe: https://github.com/schmaustech/kni-wipe

@schmaustech
Copy link
Contributor

schmaustech commented Aug 22, 2019

So I went ahead and added the ability for my kni-preflight to generate a install-config.yaml file based on the sample I found here: https://github.com/openshift/installer/blob/master/docs/user/metal/install_ipi.md. I have tested it on a hardware setup in Westford and produced the following output which is derived from data kni-preflight was already discovering:

[rna@worker-0 kni-preflight]$ cat install-config.yaml 
apiVersion: v1beta4
baseDomain: cloud.lab.eng.bos.redhat.com
metadata:
  name: rna1
networking:
  machineCIDR: 10.19.1.128/25
compute:
- name: worker
  replicas: 0
controlPlane:
  name: master
  replicas: 3
  platform:
    baremetal: {}
platform:
  baremetal:
    apiVIP: 10.19.1.249
    ingressVIP: 10.19.1.248
    dnsVIP: 10.19.1.247
    hosts:
      - name: master-0
        role: master
        bmc:
          address: ipmi://172.22.0.231
          username: root
          password: calvin
        bootMACAddress: 98:03:9B:61:88:40
        hardwareProfile: default
      - name: master-2
        role: master
        bmc:
          address: ipmi://172.22.0.233
          username: root
          password: calvin
        bootMACAddress: 98:03:9B:61:6E:D8
        hardwareProfile: default
      - name: master-1
        role: master
        bmc:
          address: ipmi://172.22.0.232
          username: root
          password: calvin
        bootMACAddress: 98:03:9B:61:88:10
        hardwareProfile: default
pullSecret: ...
sshKey: ...

@schmaustech
Copy link
Contributor

Note that check_dhcp is an ELF binary - not clear where it comes from

It appears to be a build of this: https://github.com/nagios-plugins/nagios-plugins/blob/master/plugins-root/check_dhcp.c

You are correct we used the check_dhcp.c code.

@schmaustech
Copy link
Contributor

check_dhcp has been replaced by check_dhcp.py now

@sreichar
Copy link
Collaborator

sreichar commented Sep 9, 2019

preflight does this for the appliance. Preflight was merged with #92

non-appliance will have to stay manual for now

@sreichar sreichar closed this as completed Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants