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

Issue 85220044: various: Provision machines with networks (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by dimitern
Modified:
10 years ago
Reviewers:
mp+214720, fwereade
Visibility:
Public.

Description

various: Provision machines with networks This changes a few things in the provisioner API: * AddNetworks() and AddNetworkInterfaces() are removed (both from state/api and state/apiserver); * SetInstanceInfo added (see below) Changes in state: * Machine.SetInstanceInfo replaces the SetProvisioned method and does the same job, but also accepts two lists - networks and NICs to create, which are created before calling SetProvisioned internally. This is just a quick-and-dirty fix to enable VLAN support. Later, this method will be changed to execute all steps in a single transaction. As before, existing networks/interfaces are not an error when given to SetInstanceInfo, but invalid ones cause errors and stop the provisioning. Changes in worker/provisioner: * Now, once we get the networks from StartInstance, we prepare the args and call SetInstanceInfo. * If SetInstanceInfo fails, we set StatusError on the machine, stop the instance and keep going instead of killing the provisioner task (added test for that). Changes in provider/maas: * After lots of live testing, the procedure for getting networks for the instance, lists of connected MACs for each network and the discovered NICs of the instance, is completed and works. Some changes to the internals were needed to make sure it works with a live MAAS. * Fixed a small typo in the log message "picked arbitrary tools...". Changes in provider/dummy: * Now the dummy provider prepares []environs.NetworkInfo when IncludeNetworks are given to StartInstance, and returns it. As a special case, network names with "bad-" prefix cause the dummy provider to generate invalid NetworkInfo so we can test failures on SetInstanceInfo. Although this CL is got big, it's the penultimate step to have MAAS networks/VLANs support - the only thing left is to setup the discovered network interfaces as needed with cloudinit scripts, which will be done in a follow-up. But before that, as requested bug #1304905 will be fixed (s/NetworkName/NetworkId/ and add network tags througout). https://code.launchpad.net/~dimitern/juju-core/393-provisioner-allow-adding-networks/+merge/214720 Requires: https://code.launchpad.net/~dimitern/juju-core/392-api-provisioner-allow-adding-existing-networks-nics/+merge/214712 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : various: Provision machines with networks #

Total comments: 24

Patch Set 3 : various: Provision machines with networks #

Total comments: 10

Patch Set 4 : various: Provision machines with networks #

Total comments: 3

Patch Set 5 : various: Provision machines with networks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+635 lines, -490 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M provider/dummy/environs.go View 1 2 2 chunks +18 lines, -2 lines 0 comments Download
M provider/maas/environ.go View 1 2 6 chunks +97 lines, -77 lines 0 comments Download
M provider/maas/environ_whitebox_test.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/api/params/internal.go View 1 2 3 3 chunks +54 lines, -40 lines 0 comments Download
M state/api/provisioner/machine.go View 1 2 3 2 chunks +12 lines, -37 lines 0 comments Download
M state/api/provisioner/provisioner.go View 1 1 chunk +0 lines, -23 lines 0 comments Download
M state/api/provisioner/provisioner_test.go View 1 2 3 7 chunks +72 lines, -99 lines 0 comments Download
M state/apiserver/provisioner/provisioner.go View 1 2 3 4 3 chunks +34 lines, -41 lines 0 comments Download
M state/apiserver/provisioner/provisioner_test.go View 1 2 3 4 2 chunks +116 lines, -126 lines 0 comments Download
M state/machine.go View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
M state/machine_test.go View 1 2 2 chunks +36 lines, -0 lines 0 comments Download
M state/networks.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M worker/provisioner/provisioner_task.go View 1 2 5 chunks +53 lines, -23 lines 0 comments Download
M worker/provisioner/provisioner_test.go View 1 2 3 4 8 chunks +104 lines, -20 lines 0 comments Download

Messages

Total messages: 8
dimitern
Please take a look.
10 years ago (2014-04-08 11:17:44 UTC) #1
dimitern
Please take a look.
10 years ago (2014-04-08 16:52:23 UTC) #2
fwereade
Mostly naming quibbles, but one concern with the logic in provisioner_task https://codereview.appspot.com/85220044/diff/20001/provider/maas/environ.go File provider/maas/environ.go (right): ...
10 years ago (2014-04-09 07:52:00 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/85220044/diff/20001/provider/maas/environ.go File provider/maas/environ.go (right): https://codereview.appspot.com/85220044/diff/20001/provider/maas/environ.go#newcode402 provider/maas/environ.go:402: // and drop incomplete records. ...
10 years ago (2014-04-09 10:45:20 UTC) #4
fwereade
Looking very solid, last couple of comments. https://codereview.appspot.com/85220044/diff/20001/state/apiserver/provisioner/provisioner_test.go File state/apiserver/provisioner/provisioner_test.go (right): https://codereview.appspot.com/85220044/diff/20001/state/apiserver/provisioner/provisioner_test.go#newcode802 state/apiserver/provisioner/provisioner_test.go:802: func (s ...
10 years ago (2014-04-09 13:22:59 UTC) #5
dimitern
Please take a look. https://codereview.appspot.com/85220044/diff/20001/state/apiserver/provisioner/provisioner_test.go File state/apiserver/provisioner/provisioner_test.go (right): https://codereview.appspot.com/85220044/diff/20001/state/apiserver/provisioner/provisioner_test.go#newcode802 state/apiserver/provisioner/provisioner_test.go:802: func (s *withoutStateServerSuite) TestSetProvisionedWithNetworks(c *gc.C) ...
10 years ago (2014-04-09 15:11:42 UTC) #6
fwereade
LGTM with some error tweak like below. ...and, wait. I think we need a copy/paste ...
10 years ago (2014-04-09 15:42:23 UTC) #7
dimitern
10 years ago (2014-04-09 16:13:31 UTC) #8
Please take a look.

https://codereview.appspot.com/85220044/diff/60001/state/apiserver/provisione...
File state/apiserver/provisioner/provisioner.go (right):

https://codereview.appspot.com/85220044/diff/60001/state/apiserver/provisione...
state/apiserver/provisioner/provisioner.go:482: "provisioning %q with networks
%v, interfaces %v failed: %v",
On 2014/04/09 15:42:23, fwereade wrote:
> but provisioning succeeded -- we just didn't manage to update state. that's in
> the error, but the problem the user cares about feels more like, maybe,
"aborted
> instance %s: %v"?
> 
> I'd just like to be really clear that provisioning was fine but juju fucked
up.

Depends on what do you call "provisioning" - the process of starting an instance
(provider parlance) or setting its instance id (more juju specific). Changed the
error as you suggested.

https://codereview.appspot.com/85220044/diff/60001/state/apiserver/provisione...
File state/apiserver/provisioner/provisioner_test.go (left):

https://codereview.appspot.com/85220044/diff/60001/state/apiserver/provisione...
state/apiserver/provisioner/provisioner_test.go:928: func (s
*withoutStateServerSuite) TestSetProvisioned(c *gc.C) {
I added this back as you asked - it doesn't show because it wasn't changed from
the base :)
Sign in to reply to this message.

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