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

Issue 11433044: Azure provider: create virtual network.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rvb
Modified:
10 years, 9 months ago
Reviewers:
jtv.canonical, mp+175315
Visibility:
Public.

Description

Azure provider: create virtual network. Each azure environment must be associated with an affinity group and a virtual network used for direct machine-to-machine communication. This branch adds all the utilities to create and delete the environment's affinity group and virtual network. The Bootstrap() method is still being refactored and is thus left untested for now. Branches to remove the environment's affinity group and virtual network (when the environment is destroyed) and use the private address for machine-to-machine communication will follow. https://code.launchpad.net/~rvb/juju-core/create-vnet/+merge/175315 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -16 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 6 chunks +101 lines, -9 lines 12 comments Download
M environs/azure/environ_test.go View 9 chunks +111 lines, -7 lines 0 comments Download

Messages

Total messages: 3
rvb
Please take a look.
10 years, 9 months ago (2013-07-17 15:17:09 UTC) #1
jtv.canonical
LGTM but I have some notes and suggestions. As you expect. https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go File environs/azure/environ.go (right): ...
10 years, 9 months ago (2013-07-18 07:51:29 UTC) #2
rvb
10 years, 9 months ago (2013-07-18 08:24:51 UTC) #3
Thanks for the review!

https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go
File environs/azure/environ.go (right):

https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go#newc...
environs/azure/environ.go:158: return env.getEnvPrefix() + "-ag"
On 2013/07/18 07:51:29, jtv.canonical wrote:
> 
> In getAffinityGroupName, do we know that dashes are OK in affinity-group
names? 
> The Azure documentation I looked at didn't say anything about what was
allowed. 
> Probably fine, but...

Yes, it's fine, I tested it.

https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go#newc...
environs/azure/environ.go:167: affinityGroupName := env.getAffinityGroupName()
On 2013/07/18 07:51:29, jtv.canonical wrote:
> 
> In createAffinityGroup, unless there's Azure terminology you really have to
> stick to, the variable affinityGroupName could be just "name."  Easier to
read,
> I think, and the context is explicit enough.

Hum, I'd rather keep very explicit variables names.

https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go#newc...
environs/azure/environ.go:180: return
azure.DeleteAffinityGroup(&gwacl.DeleteAffinityGroupRequest{
On 2013/07/18 07:51:29, jtv.canonical wrote:
> 
> Do we know what happens if we destroy an affinity group twice?  I suppose it
> might happen if Bootstrap creates the group successfully, defers its cleanup
in
> the event of an error, moves on, fails somewhere else, and then tries to
destroy
> the whole environment.

It breaks.  That's a bug in gwacl. I'll report it.

https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go#newc...
environs/azure/environ.go:187: return env.getEnvPrefix() + "-vnet"
On 2013/07/18 07:51:29, jtv.canonical wrote:
> 
> In getVirtualNetworkName, the same just-making-sure question: are dashes OK in
> virtual-network names?

Yes, it's okay.

https://codereview.appspot.com/11433044/diff/1/environs/azure/environ.go#newc...
environs/azure/environ.go:190: func (env *azureEnviron) createVirtualNetwork()
error {
On 2013/07/18 07:51:29, jtv.canonical wrote:
> 
> In createVirtualNetwork, just on general principle (and nothing important),
I'd
> prefer it if you did your data gathering before grabbing a
releaseManagementAPI.
>  It shortens the span of code where the matching "defer" lurks in the
> background, as well as the lifetime of the variable, and so it very slightly
> reduces the cognitive load on engineers working on this method.

Okay.
Sign in to reply to this message.

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