Merge lp:~jtv/gwacl/machine-types into lp:gwacl

Proposed by Jeroen T. Vermeulen
Status: Rejected
Rejected by: Julian Edwards
Proposed branch: lp:~jtv/gwacl/machine-types
Merge into: lp:gwacl
Diff against target: 100 lines (+96/-0)
1 file modified
machinetypes.go (+96/-0)
To merge this branch: bzr merge lp:~jtv/gwacl/machine-types
Reviewer Review Type Date Requested Status
GWACL Hackers Pending
Review via email: mp+175736@code.launchpad.net

Commit message

Describe Azure machine types.

Description of the change

This is to help users select a machine type. It would be very easy to add code to automate that choice: order machine types by cost, then walk through them in that order and pick the first type that matches the request. But our immediate purpose is to implement that in Juju, which has its own generic types and code for doing this. So in the short term, this information is provided just so that it can be translated into Juju's information structures.

Jeroen

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Not quite sure how this happened but you obviously missed the fact that I was already working on this :(

I landed https://code.launchpad.net/~julian-edwards/gwacl/trunk/+merge/175732 a short while ago.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

59 + CPUCores: 0,

Not that it matters any more, but this is wrong, it's one core.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

> Not quite sure how this happened but you obviously missed the fact that I was
> already working on this :(
>
> I landed https://code.launchpad.net/~julian-edwards/gwacl/trunk/+merge/175732
> a short while ago.

Clearly that happened while I was also pretty much done with this branch. I was just doing what we agreed yesterday.

My internet connection has been incredibly unreliable, so if you said you were doing the gwacl part, I never heard it. You sent an email when I was already basically done with my branch, just before my lunch. But even if I'd seen that in time, it wouldn't have made a difference.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

> 59 + CPUCores: 0,
>
> Not that it matters any more, but this is wrong, it's one core.

See the comment in the line above, and the comment for the CPUCores field in the struct definition.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Friday 19 Jul 2013 06:51:27 you wrote:
> > 59 + CPUCores: 0,
> >
> > Not that it matters any more, but this is wrong, it's one core.
>
> See the comment in the line above, and the comment for the CPUCores field in
> the struct definition.

In the comment it says one :)

I still don't think a zero value is at all valid, you can't have no cpu cores.
The fact that it's shared is a separate property that I thought we'd said we
weren't going to model.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Friday 19 Jul 2013 06:49:23 Jeroen T. Vermeulen wrote:
> > Not quite sure how this happened but you obviously missed the fact that I
> > was already working on this :(
> >
> > I landed
> > https://code.launchpad.net/~julian-edwards/gwacl/trunk/+merge/175732 a
> > short while ago.
>
> Clearly that happened while I was also pretty much done with this branch. I
> was just doing what we agreed yesterday.
>
> My internet connection has been incredibly unreliable, so if you said you
> were doing the gwacl part, I never heard it. You sent an email when I was
> already basically done with my branch, just before my lunch. But even if
> I'd seen that in time, it wouldn't have made a difference.

I'm sorry for not making myself clearer. Feel free to change things around as
you wish.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

As you're out on public holiday today, I've taken what you did here that was different to the stuff I already landed and proposed a new diff to the stuff I already landed: https://code.launchpad.net/~julian-edwards/gwacl/augment-rolesizes/+merge/176108

Unmerged revisions

194. By Jeroen T. Vermeulen

Documentation.

193. By Jeroen T. Vermeulen

Describe Azure machine types.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'machinetypes.go'
--- machinetypes.go 1970-01-01 00:00:00 +0000
+++ machinetypes.go 2013-07-19 06:14:27 +0000
@@ -0,0 +1,96 @@
1// Copyright 2013 Canonical Ltd. This software is licensed under the
2// GNU Lesser General Public License version 3 (see the file COPYING).
3
4package gwacl
5
6// MachineType specifies a type of machine. It can be used to specify
7// requirements, but for now it is only used to describe the machine types
8// available in Azure.
9//
10// Information taken from:
11// http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx
12//
13// This struct may change if Azure adds more detailed machine types.
14type MachineType struct {
15 // CPUCores can be 0, for a shared CPU which can act like anything
16 // between 0 and 1 cores.
17 CPUCores int
18 // Memory is in MB.
19 Memory int64
20 // MaxOSDisk specifies the maximum permitted size of the OS disk.
21 // Actual OS disk size is determined by the OS image.
22 MaxOSDisk int64
23 // Cost is not actual price, just an indication of the relative prices
24 // for running different machine types. It makes sense to pick the
25 // cheapest type that matches your requirements.
26 Cost uint64
27}
28
29const (
30 // MB is the unit in which we specify sizes, so it's 1.
31 // But please include it anyway, so that units are always explicit.
32 MB = 1
33 GB = 1024*MB
34 TB = 1024*GB
35)
36
37// AzureMachineTypes describes the machine types that Azure offers at the time
38// of writing. This may be out of date, so use your own information if you
39// need more precision. In particular, we make no promises about prices!
40//
41// The keys in this map are the names for the machine types as Azure knows
42// them. The values are the specifications of those machine types as we
43// understand them.
44//
45// Costs based on:
46// http://www.windowsazure.com/en-us/pricing/details/virtual-machines/
47// We used those numbers, in tenths of US dollar-cents per hour. But the
48// prices may not be accurate, or they may change without notice. See them
49// only as a general impression of the relative cost between machine types.
50//
51// Based on Azure information as available on 2013-07-19.
52var AzureMachineTypes = map[string]MachineType{
53 "ExtraSmall": {
54 // Only one CPU, shared with other virtual machines.
55 CPUCores: 0,
56 Memory: 768*MB,
57 MaxOSDisk: 20*GB,
58 Cost: 20,
59 },
60 "Small": {
61 CPUCores: 1,
62 Memory: 1.75*GB,
63 MaxOSDisk: 70*GB,
64 Cost: 90,
65 },
66 "Medium": {
67 CPUCores: 2,
68 Memory: 3.5*GB,
69 MaxOSDisk: 135*GB,
70 Cost: 180,
71 },
72 "Large": {
73 CPUCores: 4,
74 Memory: 7*GB,
75 MaxOSDisk: 285*GB,
76 Cost: 360,
77 },
78 "ExtraLarge": {
79 CPUCores: 8,
80 Memory: 14*GB,
81 MaxOSDisk: 605*GB,
82 Cost: 720,
83 },
84 "A6": {
85 CPUCores: 4,
86 Memory: 28*GB,
87 MaxOSDisk: 285*GB,
88 Cost: 1020,
89 },
90 "A7": {
91 CPUCores: 8,
92 Memory: 56*GB,
93 MaxOSDisk: 605*GB,
94 Cost: 2040,
95 },
96}

Subscribers

People subscribed via source and target branches