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

Issue 40860048: provider/common: attempt all addresses in waitSSH

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by axw
Modified:
10 years, 4 months ago
Reviewers:
jameinel, mp+198867, rog
Visibility:
Public.

Description

provider/common: attempt all addresses in waitSSH We now attempt all addresses during waitSSH, and refresh the addresses periodically. Providers may return private addresses; for some clouds this is what we want to use, and for others it is not. As private addresses are relative, one may be able to connect to the private address and yet be connecting to a machine other than the intended one. For this reason, we emit the machine's nonce during cloud-init to a file (/var/lib/juju/nonce.txt), and verify it during waitSSH. The nonce verification also serves to synchronise cloud-init and sshinit. Since the file is written as the last thing cloud-init does, we can safely run sshinit once it has been verified. Fixes #1258240 Fixes #1259942 https://code.launchpad.net/~axwalk/juju-core/lp1258240-bootstrap-refresh-dnsname-take2/+merge/198867 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : provider/common: attempt all addresses in waitSSH #

Total comments: 1

Patch Set 3 : provider/common: attempt all addresses in waitSSH #

Patch Set 4 : provider/common: attempt all addresses in waitSSH #

Total comments: 1

Patch Set 5 : provider/common: attempt all addresses in waitSSH #

Patch Set 6 : provider/common: attempt all addresses in waitSSH #

Patch Set 7 : provider/common: attempt all addresses in waitSSH #

Total comments: 26

Patch Set 8 : provider/common: attempt all addresses in waitSSH #

Patch Set 9 : provider/common: attempt all addresses in waitSSH #

Patch Set 10 : provider/common: attempt all addresses in waitSSH #

Patch Set 11 : provider/common: attempt all addresses in waitSSH #

Unified diffs Side-by-side diffs Delta from patch set Stats (+488 lines, -171 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M cloudinit/cloudinit_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cloudinit/options.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cloudinit/sshinit/configure.go View 1 1 chunk +0 lines, -11 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 chunk +1 line, -1 line 0 comments Download
M container/kvm/instance.go View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M container/lxc/instance.go View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M container/lxc/lxc_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M environs/cloudinit/cloudinit.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +17 lines, -0 lines 0 comments Download
M environs/cloudinit/cloudinit_test.go View 1 2 3 5 chunks +7 lines, -3 lines 0 comments Download
M environs/cloudinit_test.go View 1 1 chunk +5 lines, -1 line 0 comments Download
M instance/instance.go View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M provider/azure/instance.go View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M provider/common/bootstrap.go View 1 2 3 4 5 6 7 5 chunks +209 lines, -59 lines 0 comments Download
M provider/common/bootstrap_test.go View 1 2 3 4 5 5 chunks +95 lines, -37 lines 0 comments Download
M provider/common/export_test.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M provider/dummy/environs.go View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M provider/ec2/ec2.go View 1 2 3 4 5 6 7 8 9 1 chunk +37 lines, -17 lines 0 comments Download
M provider/ec2/local_test.go View 1 1 chunk +4 lines, -0 lines 0 comments Download
M provider/joyent/instance.go View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M provider/local/instance.go View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M provider/maas/environ.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M provider/maas/environ_whitebox_test.go View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M provider/maas/instance.go View 1 2 3 4 5 6 7 7 chunks +22 lines, -7 lines 0 comments Download
M provider/maas/instance_test.go View 1 2 9 chunks +10 lines, -10 lines 0 comments Download
M provider/null/instance.go View 1 2 2 chunks +15 lines, -11 lines 0 comments Download
M provider/openstack/provider.go View 1 2 3 4 5 6 7 5 chunks +27 lines, -8 lines 0 comments Download

Messages

Total messages: 19
axw
Please take a look.
10 years, 4 months ago (2013-12-13 04:13:23 UTC) #1
axw
On 2013/12/13 04:13:23, axw wrote: > Please take a look. Hm, actually, I think this ...
10 years, 4 months ago (2013-12-13 04:25:05 UTC) #2
axw
On 2013/12/13 04:25:05, axw wrote: > On 2013/12/13 04:13:23, axw wrote: > > Please take ...
10 years, 4 months ago (2013-12-13 10:19:32 UTC) #3
jameinel
https://codereview.appspot.com/40860048/diff/1/provider/common/bootstrap.go File provider/common/bootstrap.go (right): https://codereview.appspot.com/40860048/diff/1/provider/common/bootstrap.go#newcode121 provider/common/bootstrap.go:121: func (i *refreshingInstance) DNSName() (string, error) { Doing this ...
10 years, 4 months ago (2013-12-15 12:36:37 UTC) #4
axw
Please take a look. https://codereview.appspot.com/40860048/diff/1/provider/common/bootstrap.go File provider/common/bootstrap.go (right): https://codereview.appspot.com/40860048/diff/1/provider/common/bootstrap.go#newcode121 provider/common/bootstrap.go:121: func (i *refreshingInstance) DNSName() (string, ...
10 years, 4 months ago (2013-12-16 07:30:32 UTC) #5
axw
https://codereview.appspot.com/40860048/diff/20001/provider/common/bootstrap.go File provider/common/bootstrap.go (right): https://codereview.appspot.com/40860048/diff/20001/provider/common/bootstrap.go#newcode161 provider/common/bootstrap.go:161: `, nonceFile, utils.ShQuote(machineConfig.MachineNonce)) The bootstrap machine's nonce is static, ...
10 years, 4 months ago (2013-12-16 07:41:53 UTC) #6
axw
Please take a look.
10 years, 4 months ago (2013-12-16 09:56:56 UTC) #7
axw
On 2013/12/16 09:56:56, axw wrote: > Please take a look. I had intended to branch ...
10 years, 4 months ago (2013-12-16 09:58:58 UTC) #8
axw
Please take a look.
10 years, 4 months ago (2013-12-17 12:16:38 UTC) #9
axw
Please take a look.
10 years, 4 months ago (2013-12-18 01:01:01 UTC) #10
axw
Please take a look.
10 years, 4 months ago (2013-12-18 03:18:08 UTC) #11
axw
Please take a look.
10 years, 4 months ago (2013-12-18 03:36:31 UTC) #12
rog
Looks great in general, with some comments and suggestions below. https://codereview.appspot.com/40860048/diff/60001/provider/common/bootstrap.go File provider/common/bootstrap.go (right): https://codereview.appspot.com/40860048/diff/60001/provider/common/bootstrap.go#newcode320 ...
10 years, 4 months ago (2013-12-18 09:01:04 UTC) #13
axw
Please take a look. https://codereview.appspot.com/40860048/diff/120001/environs/cloudinit/cloudinit.go File environs/cloudinit/cloudinit.go (right): https://codereview.appspot.com/40860048/diff/120001/environs/cloudinit/cloudinit.go#newcode163 environs/cloudinit/cloudinit.go:163: c.AddFile(path.Join(cfg.DataDir, NonceFile), cfg.MachineNonce, 0644) On ...
10 years, 4 months ago (2013-12-18 10:22:10 UTC) #14
axw
Please take a look.
10 years, 4 months ago (2013-12-18 10:34:04 UTC) #15
rog
LGTM, thanks, except I'd like to know a bit more about the AddFile vs AddRunCmd ...
10 years, 4 months ago (2013-12-18 12:49:08 UTC) #16
axw
On 2013/12/18 12:49:08, rog wrote: > LGTM, thanks, except I'd like to know a bit ...
10 years, 4 months ago (2013-12-18 14:16:20 UTC) #17
axw
Please take a look.
10 years, 4 months ago (2013-12-18 14:19:34 UTC) #18
axw
10 years, 4 months ago (2013-12-18 15:19:16 UTC) #19
Please take a look.

https://codereview.appspot.com/40860048/diff/120001/environs/cloudinit/cloudi...
File environs/cloudinit/cloudinit.go (right):

https://codereview.appspot.com/40860048/diff/120001/environs/cloudinit/cloudi...
environs/cloudinit/cloudinit.go:163: c.AddFile(path.Join(cfg.DataDir,
NonceFile), cfg.MachineNonce, 0644)
On 2013/12/18 12:49:09, rog wrote:
> On 2013/12/18 10:22:10, axw wrote:
> > On 2013/12/18 09:01:05, rog wrote:
> > > Is this really the last thing that happens in cloudinit?
> > > What if there are some scripts in the cloudinit.Config?
> > 
> > It really is. ConfigureBasic is the only thing called to set up cloud-init
for
> > the bootstrap node.
> > 
> > > I think this should probably be an added script.
> > 
> > Added where though? All of the providers call environs.ComposeUserData, and
so
> > there's no nice place to do that.
> 
> I was thinking that instead of this AddFile we'd just
> call c.AddRunCmd(scriptToCreateMachineNonceFile).
> 
> If we do things as above and one of the providers uses the additionalScripts
> argument to ComposeUserData, won't we
> write the nonce file before running any of those scripts?
> 
> But I'm probably misunderstanding the issues around this.

As discussed on IRC, I've made this explicitly use AddScripts (which generates
multiple runcmds) in place of AddFile, in the event AddFile gets changed.
Sign in to reply to this message.

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