Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Orchestration of OpenStack deployment POC #18

Merged
merged 8 commits into from Mar 20, 2014

Conversation

pitr-ch
Copy link
Member

@pitr-ch pitr-ch commented Mar 13, 2014

opening PR for comments and suggestions
see included doc/orchestration.md


def run
host = ::Host.find(input[:host_id])
host.setBuild or fail 'setting build flag failed'
Copy link
Member

Choose a reason for hiding this comment

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

should we use foreman exceptions here? I think its better as you'll get an error code (and translated string potentially)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@knowncitizen
Copy link
Member

This is pretty amazing.

end

# reset leaves it shutoff on libvirt
if host.power.state == 'shutoff'
Copy link
Member

Choose a reason for hiding this comment

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

nitpick, I would write

case host.power.state
when 'running'
   host.power.reset or fail 'resetting host failed'
when 'shutoff'
  host.power.start or fail 'starting host failed'
end

Copy link
Member Author

Choose a reason for hiding this comment

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

Me too :) this is to get around bug in libvirt (or somewhere) which is leaving machined 'shutoff' after restart command.

@mtaylor
Copy link
Contributor

mtaylor commented Mar 14, 2014

I have tested this end to end with provisioning and the ordering of builds works great.

@pitr-ch
Copy link
Member Author

pitr-ch commented Mar 14, 2014

@mtaylor please use PR diff for comments. Comments placed on commits are lost when rebasing or amending. Linking the commit with comments pitr-ch@85b1a5a

@mtaylor
Copy link
Contributor

mtaylor commented Mar 14, 2014

Will do, cheers.

@pitr-ch
Copy link
Member Author

pitr-ch commented Mar 18, 2014

@ohadlevy Added 2a49ae5 replacing polling with hook.

# planned in concurrence
# do not touch already installed modules
# TODO: add better way how to filter hosts (scenarios: redeploy, adding single host when scaling)
plan_action Host::Deploy, host unless host.installed_at
Copy link
Member

Choose a reason for hiding this comment

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

maybe consider using the build and or status fields in additional to the installed_at (as thats only for raw/ first time).

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 am working on it right now. I am extracting it so the array of hosts to use is inject-able by the UI or other parts.

@knowncitizen
Copy link
Member

Is this ready now?

@pitr-ch
Copy link
Member Author

pitr-ch commented Mar 19, 2014

I'll fix the hook #18 (comment) and then we could merge.

@pitr-ch
Copy link
Member Author

pitr-ch commented Mar 20, 2014

It's ready.

@pitr-ch
Copy link
Member Author

pitr-ch commented Mar 20, 2014

Acks?

@pitr-ch
Copy link
Member Author

pitr-ch commented Mar 20, 2014

acked verbally

pitr-ch pushed a commit that referenced this pull request Mar 20, 2014
Orchestration of OpenStack deployment POC
@pitr-ch pitr-ch merged commit 1f2dd43 into theforeman:master Mar 20, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants