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

[WIP] Install gather support for baremetal platform #104

Closed
wants to merge 2 commits into from

Conversation

stbenjam
Copy link
Member

@stbenjam stbenjam commented Jun 13, 2019

fixes #79

This adds support to the 'gather' command for baremetal. The bootstrap
node's IP address is retrieved via libvirt's DHCP records. The master's
IP's are retrieved using Ironic introspection data, that is stored in
the terraform state's introspection data source (added in
terraform-provider-ironic v0.1.4)

How to test this:

  • Kick off an install with this PR checked out, ensuring you set KNI_INSTALL_FROM_GIT=true env variable
  • When the installer reaches the point where it's waiting for the bootstrap API to come up, hit control + C to abort
  • Run the gather command:
[root@dell-r730-021 dev-scripts]# ~/go/src/github.com/openshift-metalkube/kni-installer/bin/kni-install gather bootstrap --dir ocp
INFO Use the following commands to gather logs from the cluster 
INFO ssh -A core@192.168.111.38 '/usr/local/bin/installer-gather.sh 172.22.0.97 172.22.0.10 172.22.0.14' 
INFO scp core@192.168.111.38:~/log-bundle.tar.gz . 

This release includes support for gathering data from introspection, and
storing it in the tfstate.
This adds support to the 'gather' command for baremetal. The bootstrap
node's IP address is retrieved via libvirt's DHCP records.  The master's
IP's are retrieved using Ironic introspection data, that is stored in
the terraform state's introspection data source (added in
terraform-provider-ironic v0.1.4)

// BootstrapIP returns the ip address for bootstrap host. Baremetal relies on a libvirt bootstrap node, that gets it's
// IP from DHCP.
func BootstrapIP(tfs *terraform.State, config *types.InstallConfig) (string, error) {
Copy link
Member Author

@stbenjam stbenjam Jun 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all bit complex, since we have to retrieve the lease information from libvirt. The libvirt platform generates the IP's: https://github.com/openshift/installer/blob/master/pkg/tfvars/libvirt/libvirt.go, maybe we could use that approach instead.

We're also affected by openshift-metal3/dev-scripts#512 here

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we need the BootstrapIP for? I'm wondering if we can use the static IP configured for the provisioning network in #100 instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug gathering gets logs from bootstrap if install fails while bootstrap is still up, I think it also uses it as a bastion host to get to the masters in that case as well.

But we can definitely use the static IP instead of this.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've run into issues getting ironic to work reliably on the boostrap VM, but I may try breaking #100 into two or three PRs, then we can enable the provisioning nic so that this PR can use it, then potentially host the images to allow fixing #58, and finally switch the ironic endpoint over to the bootstrap VM.

@stbenjam let me know if the above decoupling of PRs would be helpful, if so I'll rebase and open some additional PRs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense. I don't think we need install gather to open the first PR to openshift/installer but we do need it eventually.

Could we move the masters to static IP's as well? Or do you think the approach of getting them out of ironic introspection data is reliable?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we'll need to switch the masters to static IPs to enable self-hosted ironic where we'll need to run dnsmasq and the other ironic bits on a master to deploy the workers - ref discussion on metal3-io/metal3-docs#39

I'm not yet sure what the best way to inject that configuration is though, e.g we could use ignition, something run via the BMO or perhaps the MCO, and there's the nmstate operator to investigate too.

@stbenjam stbenjam changed the title Gather Install gather support for baremetal platform Jun 13, 2019
@stbenjam stbenjam added the CI label Jun 13, 2019
@derekhiggins
Copy link
Collaborator

Build SUCCESS, see build http://10.8.144.11:8080/job/dev-tools/746/

@stbenjam stbenjam changed the title Install gather support for baremetal platform [WIP] Install gather support for baremetal platform Jun 20, 2019
@stbenjam
Copy link
Member Author

Marking this WIP again, as it sounds like we can just use static IP's

@stbenjam
Copy link
Member Author

I'm going to close this, we can open a PR to enable gather when we're using static ip's.

@stbenjam stbenjam closed this Jul 10, 2019
@hardys
Copy link

hardys commented Jul 10, 2019

I'm going to close this, we can open a PR to enable gather when we're using static ip's.

Note that openshift/installer#1941 landed yesterday, I'm testing locally with the new RHCOS version and plan to update #100 soon, so that should hopefully provide the static provisioning IP needed for the bootstrap VM.

@stbenjam
Copy link
Member Author

I'm going to close this, we can open a PR to enable gather when we're using static ip's.

Note that openshift/installer#1941 landed yesterday, I'm testing locally with the new RHCOS version and plan to update #100 soon, so that should hopefully provide the static provisioning IP needed for the bootstrap VM.

We're going to move to static IP's for masters on the provisioning network as well, aren't we? Or do we let DHCP handle it and just get the data from introspection for install-gather?

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

Successfully merging this pull request may close these issues.

Add baremetal support for install gather
3 participants