Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(546)

Issue 9662048: Implement a add-machine command (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 12 months ago by wallyworld
Modified:
10 years, 11 months ago
Reviewers:
mp+165518, thumper, fwereade
Visibility:
Public.

Description

Implement a add-machine command add-machine will add a new machine record to the environment which results in a new empty machine being spun up. Optional constraints can be supplied, which are merged with the existing environ constraints and assigned to the machine. The machine is created with JobHostUnits running on it, so it is ready to accept new units. https://code.launchpad.net/~wallyworld/juju-core/create-machine-command/+merge/165518 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : Implement a create-machine command #

Total comments: 13

Patch Set 3 : Implement a create-machine command #

Total comments: 11

Patch Set 4 : Implement a add-machine command #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -17 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A cmd/juju/addmachine.go View 1 2 3 1 chunk +60 lines, -0 lines 0 comments Download
A cmd/juju/addmachine_test.go View 1 2 1 chunk +55 lines, -0 lines 0 comments Download
M cmd/juju/imagemetadata.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/main.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M cmd/juju/main_test.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M cmd/jujud/bootstrap.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/machine_test.go View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M state/state.go View 1 2 3 2 chunks +15 lines, -6 lines 0 comments Download
M state/state_test.go View 1 2 3 1 chunk +24 lines, -4 lines 0 comments Download
M state/statecmd/deploy.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M state/statecmd/deploy_test.go View 1 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 11
wallyworld
Please take a look.
10 years, 12 months ago (2013-05-24 02:19:23 UTC) #1
thumper
https://codereview.appspot.com/9662048/diff/1/cmd/juju/createmachine.go File cmd/juju/createmachine.go (right): https://codereview.appspot.com/9662048/diff/1/cmd/juju/createmachine.go#newcode25 cmd/juju/createmachine.go:25: Args: "<machine> ...", Well, doesn't really take args yet. ...
10 years, 12 months ago (2013-05-27 02:34:26 UTC) #2
wallyworld
Please take a look. https://codereview.appspot.com/9662048/diff/1/cmd/juju/createmachine.go File cmd/juju/createmachine.go (right): https://codereview.appspot.com/9662048/diff/1/cmd/juju/createmachine.go#newcode25 cmd/juju/createmachine.go:25: Args: "<machine> ...", On 2013/05/27 ...
10 years, 12 months ago (2013-05-27 03:02:42 UTC) #3
thumper
LGTM after fixing the two call sites you forgot. https://codereview.appspot.com/9662048/diff/6001/cmd/juju/destroymachine_test.go File cmd/juju/destroymachine_test.go (right): https://codereview.appspot.com/9662048/diff/6001/cmd/juju/destroymachine_test.go#newcode67 cmd/juju/destroymachine_test.go:67: ...
10 years, 12 months ago (2013-05-27 04:19:03 UTC) #4
wallyworld
On 2013/05/27 04:19:03, thumper wrote: > LGTM after fixing the two call sites you forgot. ...
10 years, 12 months ago (2013-05-27 04:20:32 UTC) #5
fwereade
I'm not sure about a few of these. Ping me when you're on please, I ...
10 years, 11 months ago (2013-05-27 19:47:35 UTC) #6
wallyworld
Please take a look. https://codereview.appspot.com/9662048/diff/6001/cmd/juju/createmachine.go File cmd/juju/createmachine.go (right): https://codereview.appspot.com/9662048/diff/6001/cmd/juju/createmachine.go#newcode24 cmd/juju/createmachine.go:24: Name: "create-machine", On 2013/05/27 19:47:35, ...
10 years, 11 months ago (2013-05-28 02:08:31 UTC) #7
thumper
https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (right): https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go#newcode34 cmd/juju/addmachine.go:34: f.StringVar(&c.Series, "series", "", "the Ubuntu series") Hmm... this isn't ...
10 years, 11 months ago (2013-05-29 04:08:58 UTC) #8
wallyworld
https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (right): https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go#newcode34 cmd/juju/addmachine.go:34: f.StringVar(&c.Series, "series", "", "the Ubuntu series") On 2013/05/29 04:08:58, ...
10 years, 11 months ago (2013-05-29 05:43:54 UTC) #9
fwereade
LGTM; I'll leave InjectMachine up to your judgment. https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (right): https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go#newcode34 cmd/juju/addmachine.go:34: f.StringVar(&c.Series, ...
10 years, 11 months ago (2013-05-30 13:51:24 UTC) #10
wallyworld
10 years, 11 months ago (2013-05-31 00:15:01 UTC) #11
*** Submitted:

Implement a add-machine command

add-machine will add a new machine record to the environment which results
in a new empty machine being spun up. Optional constraints can be supplied,
which are merged with the existing environ constraints and assigned to the
machine. The machine is created with JobHostUnits running on it, so it is
ready to accept new units.

R=thumper, fwereade
CC=
https://codereview.appspot.com/9662048

https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go
File cmd/juju/addmachine.go (right):

https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go#newc...
cmd/juju/addmachine.go:34: f.StringVar(&c.Series, "series", "", "the Ubuntu
series")
On 2013/05/30 13:51:24, fwereade wrote:
> On 2013/05/29 05:43:54, wallyworld wrote:
> > On 2013/05/29 04:08:58, thumper wrote:
> > > Hmm... this isn't always going the be the Ubuntu series.  Is this
duplicated
> > at
> > > the other call sites that allow specifying --series?  I'm wondering if at
> some
> > > stage in the future we fix it as we will hopefully have both other linux
> > series
> > > and potentially win8 etc.
> > 
> > Yeah, I couldn't think of a good description for it. What does series even
> mean
> > in a non-Ubuntu context. Suggestions welcome. Perhaps "the operating system
> > version"? But then we would need to change the arg name too? Does --version
> make
> > sense? The current majority of users know what series means. Decisions,
> > decisions.
> 
> Call it the charm series perhaps? That's the source of the whole concept,
after
> all. I don't love the name either, but it's pretty well ingrained and I'd
prefer
> to stay consistent than to start messing around with alternative terminology
at
> this stage.

I'll rename the description to "the charm series" as suggested.

https://codereview.appspot.com/9662048/diff/16001/cmd/juju/addmachine.go#newc...
cmd/juju/addmachine.go:52: }
On 2013/05/30 13:51:24, fwereade wrote:
> Put this code inside the `series == ""` block, that's the only time we need
the
> env conf.

Done.

https://codereview.appspot.com/9662048/diff/16001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/9662048/diff/16001/state/state.go#newcode221
state/state.go:221: return st.addMachine(series, constraints.Value{},
instanceId, BootstrapNonce, jobs)
On 2013/05/30 13:51:24, fwereade wrote:
> This is ~fine so long as it's always called *after* setting env constraints...
> which, in practice, it is. But it'd probably be nicer if we passed them in
> explicitly in jujud bootstrap-state...

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b