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

Issue 11166043: Azure provider: utilities to start a VM.

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

Description

Azure provider: utilities to start a VM. This branch adds the utilities required to actually start an Azure Virtual Machine in the provider's internalStartInstance() method. The utilities introduced here are all unit-tested but the change to internalStartInstance() is not. internalStartInstance() isn't called from anywhere yet because the methods Bootstrap() and StartInstance() are being refactored by thumper. So internalStartInstance() is really just a draft right now. Still lots of TODOs in these utilities but I've tested that this is sane by manually adding the methods Bootstrap and StartInstance and I was able to get a machine started by running "juju bootstrap". https://code.launchpad.net/~rvb/juju-core/create-vm/+merge/174216 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -13 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 4 chunks +88 lines, -12 lines 3 comments Download
M environs/azure/environ_test.go View 4 chunks +80 lines, -1 line 0 comments Download

Messages

Total messages: 5
rvb
Please take a look.
10 years, 10 months ago (2013-07-11 14:26:54 UTC) #1
dimitern
LGTM with minor suggestions. https://codereview.appspot.com/11166043/diff/1/environs/azure/environ.go File environs/azure/environ.go (right): https://codereview.appspot.com/11166043/diff/1/environs/azure/environ.go#newcode323 environs/azure/environ.go:323: return nil, fmt.Errorf("could not get ...
10 years, 10 months ago (2013-07-11 20:51:20 UTC) #2
jtv.canonical
I'm doing this review in the Launchpad style, because I find the Rietveld point-and-nag style ...
10 years, 10 months ago (2013-07-12 03:36:19 UTC) #3
rvb
On 2013/07/11 20:51:20, dimitern wrote: > LGTM with minor suggestions. > > https://codereview.appspot.com/11166043/diff/1/environs/azure/environ.go > File ...
10 years, 10 months ago (2013-07-12 06:53:11 UTC) #4
rvb
10 years, 10 months ago (2013-07-12 07:29:07 UTC) #5
Thanks for the thorough review!

>  * In environ.go you describe DeploymentSlot as a configuration item.  I
> disagree.
> 
> The only advantage we get from the choice between staging and production is an
> opportunity to streamline and optimize the code because we get to pick our own
> random DNS names — but Production is already the right choice for that, and
the
> optimization only stays simple if we *don't* add a Staging option.

Hum, you might be right… I'm not entirely sure… but we won't be fixing that soon
that's sure.

>  * Just a thought, but does it make sense to name newOSVirtualDisk so close to
> the gwacl?
> 
> This isn't just a factory for a gwacl object any more — it does significant
> creative work, and happens to return a gwacl object.  And Microsoft probably
> won't let us create physical disks for our Azure VMs, so why not newOSDisk?

Okay.

>  * Also in newOSVirtualDisk: you might want to make sourceImageName a
parameter.

Done.

>  * newRole has several critical interface conditions that should be part of
its
> documentation.

Okay, done.

> How about:
> 
>     // The ordering of these configuration sets is significant for the tests.
> 
> Also, please break up such long lines in comments!

Done.

>  * A question: are roles really things we should create for every instance?
> 
> It's still not very clear to me what Microsoft had in mind when they defined
> roles, or why they matter.  But my impression is that they correspond more or
> less to a hardware profile, along the lines of “m1.small” (although to confuse
> us, the Azure documentation also seems to use the term Role to mean
> RoleInstance).  Would it make sense at some point to keep the actual Roles
> static and reusable?  Or is this a total non-issue?

I think this all stems from the confusion between Roles and RoleInstances
indeed.  But the Role here represents the VM itself so yes, we clearly have to
create one of them for each and every instance we create.

>  * In newDeployment, again, I'd make the virtual network name a parameter.

Good point, done.

>  * In environ_test.go, buildAzureServiceResponses is confusingly named.  Maybe
> add a "Get"?

Does not sound confusing to me but okay…

>  * In TestGetInstance you go through an awkward
> HostedServiceDescriptor/HostedService initialization dance.
> 
> Isn't that what makeAzureService is for?

Well, yes but a change in gwacl forced us to do the initialization differently
still.

>  * TestNewDeployment checks at the very end that exactly 1 request has been
> made.
> 
> I think the other checks are more or less meaningless if that isn't the case. 
> If no requests have been made, your test will crash at the first test.  If
more
> than request has been made, it's possible that you've been inspecting the
wrong
> request.
> 
> So I'd put this length check at the top of the checks, and make it an
assertion.

We're not checking requests here, just that the created deployment has 1 role. 
Nothing more, nothing less.

Thanks again for the review!
Sign in to reply to this message.

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