tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
572 stars 99 forks source link

IPMI network allocations API with pool support #513

Closed byxorna closed 7 years ago

byxorna commented 7 years ago

We have a bit of an odd IPMI network topology, and I have been wanting to add an endpoint to allow IPMI details to be generated separate from asset creation. This diff enables multiple OOB networks to be managed, and gives users the flexibility to generate IPMI details based on information collected at induction time. For example, one could imagine an induction process in Genesis that:

Ive updated collins-shell and collins-client with this functionality as well.

cc @michaeljs1990 @defect @roymarantz @alex-laties @vhp @qx-xp

Fixes #512, docs in #514

michaeljs1990 commented 7 years ago

Just to keep everything in the PR. I had an oob (lol i couldn't help myself) conversation with gabe that since you can generate IPMI at asset creation time it would be cool if you could also pass it a pool to allocate from since you could have gotten LLDP info before asset creation.

I have also run into the issue of people manually creating an asset for JBODs that need to go into a specific pool and then they message me later to correctly allocate the ip address for it.

byxorna commented 7 years ago

@michaeljs1990 ive updated diff to support #create!('tag', ipmi_pool: "FOO"), as well as the documentation update that goes along with it. Tests are broken for a few reasons:

  1. i bumped the gem dependencies for collins-shell (as it requires the latest collins-client), but that version doesnt exist in rubygems yet
  2. flaky scala solr tests bailed :( idk how to tell travis to rerun though...

@defect review appreciated!

michaeljs1990 commented 7 years ago

Was messing around with the docker build and I believe I ran into the 500 error you were talking about. I dug into it a bit and tracked it down to app/collins/util/Tattler.scala:83 which I believe is trying to grab a single asset to use for logging. Since it's currently not set I think it's returning whatever is set as the multicollins asset in the config and trying to log to that.. which also doesn't exist as an asset in collins.

# production.conf
features {
  syslogAsset = tumblrtag1
}

Needs to be set so we can use the super special logger. I should make a task for documenting this and then maybe just having it log to a central place eventually. The error is also a little vague since you can have it set but to a non valid asset and it will throw neither features.syslogAsset or multicollins.thisInstance were specified

byxorna commented 7 years ago

@michaeljs1990 so, i think this is a race in startup with solr initial indexing; ive seen this before, and the tumblrtag1 asset (inserted here https://github.com/tumblr/collins/blob/master/conf/evolutions/collins/2.sql#L61 by evolutions) is not always indexed by solr. Manually hitting /admin/solr to reindex assets sorts the problem out. We should make a new issue to debug if the issue I already had open in #403 is different.

byxorna commented 7 years ago

@roymarantz @defect thumbs bump?

byxorna commented 7 years ago

@roymarantz @defect second bump! I would like to land this soon, along with the already approved #514 :)