Merge lp:~julian-edwards/gwacl/augment-rolesizes into lp:gwacl

Proposed by Julian Edwards on 2013-07-22
Status: Merged
Approved by: Julian Edwards on 2013-07-23
Approved revision: 196
Merged at revision: 198
Proposed branch: lp:~julian-edwards/gwacl/augment-rolesizes
Merge into: lp:gwacl
Diff against target: 141 lines (+60/-24)
2 files modified
rolesizes.go (+44/-24)
rolesizes_test.go (+16/-0)
To merge this branch: bzr merge lp:~julian-edwards/gwacl/augment-rolesizes
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) 2013-07-22 Approve on 2013-07-23
Review via email: mp+176108@code.launchpad.net

Commit message

Add more comments, better units and an extra map of role names to role sizes, with thanks to jtv for his ideas.

Description of the change

Taking inspiration from https://code.launchpad.net/~jtv/gwacl/machine-types/+merge/175736 which unfortunately was done at the same time as something I did for this, I've enhanced what I already landed with jtv's ideas.

To post a comment you must log in.
Jeroen T. Vermeulen (jtv) wrote :

Thanks for integrating this. It may seem strange that I used thousandths of US dollars in my branch, but that's also what Juju's EC2 provider does. EC2's pricing structure makes use of the extra precision, and Microsoft may find they'll want to tweak their pricing more.

I think it's still worth saying in so many words that we make no guarantees with these cost indications and that we'll happily let them go out of date if no updates are required for our purposes. Otherwise, your statement that the information is correct (do we even really know that?) as of a given date may reasonably be construed as a promise to keep the list updated.

review: Approve
Julian Edwards (julian-edwards) wrote :

On 23/07/13 12:44, Jeroen T. Vermeulen wrote:
> Review: Approve
>
> Thanks for integrating this. It may seem strange that I used thousandths of US dollars in my branch, but that's also what Juju's EC2 provider does. EC2's pricing structure makes use of the extra precision, and Microsoft may find they'll want to tweak their pricing more.
>
> I think it's still worth saying in so many words that we make no guarantees with these cost indications and that we'll happily let them go out of date if no updates are required for our purposes. Otherwise, your statement that the information is correct (do we even really know that?) as of a given date may reasonably be construed as a promise to keep the list updated.
>

Normally saying something like that means you know it's correct as of a
certain date but you make no guarantees it's correct at a later date.
It just means you checked it on that date.

Thanks for the review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'rolesizes.go'
--- rolesizes.go 2013-07-19 05:37:56 +0000
+++ rolesizes.go 2013-07-22 03:52:27 +0000
@@ -10,72 +10,92 @@
10// http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx and10// http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx and
11// pricing from here:11// pricing from here:
12// http://www.windowsazure.com/en-us/pricing/details/virtual-machines/12// http://www.windowsazure.com/en-us/pricing/details/virtual-machines/
13// and is correct as of 2013-07-22.
14//
15// The Disk Space values are only the maxumim permitted; actual space is
16// determined by the OS image being used.
13type RoleSize struct {17type RoleSize struct {
14 Name string18 Name string
15 CpuCores uint6419 CpuCores uint64
16 Mem uint64 // In MB20 Mem uint64 // In MB
17 OSDiskSpaceCloud uint64 // In GB21 OSDiskSpaceCloud uint64 // In MB
18 OSDiskSpaceVirt uint64 // In GB22 OSDiskSpaceVirt uint64 // In MB
19 MaxDataDisks uint64 // 1TB each23 MaxDataDisks uint64 // 1TB each
20 Cost uint64 // US ยข (cents) per hour24 Cost uint64 // USD cents per hour
21}25}
2226
27const (
28 // MB is the unit in which we specify sizes, so it's 1.
29 // But please include it anyway, so that units are always explicit.
30 MB = 1
31 GB = 1024*MB
32 TB = 1024*GB
33)
34
23var RoleSizes = []RoleSize{35var RoleSizes = []RoleSize{
24 {36 {
25 Name: "ExtraSmall",37 Name: "ExtraSmall",
26 CpuCores: 1, // shared38 CpuCores: 1, // shared
27 Mem: 768,39 Mem: 768*MB,
28 OSDiskSpaceCloud: 19,40 OSDiskSpaceCloud: 19*GB,
29 OSDiskSpaceVirt: 20,41 OSDiskSpaceVirt: 20*GB,
30 MaxDataDisks: 1,42 MaxDataDisks: 1,
31 Cost: 2,43 Cost: 2,
32 }, {44 }, {
33 Name: "Small",45 Name: "Small",
34 CpuCores: 1,46 CpuCores: 1,
35 Mem: 1792,47 Mem: 1.75*GB,
36 OSDiskSpaceCloud: 224,48 OSDiskSpaceCloud: 224*GB,
37 OSDiskSpaceVirt: 70,49 OSDiskSpaceVirt: 70*GB,
38 MaxDataDisks: 2,50 MaxDataDisks: 2,
39 Cost: 6,51 Cost: 6,
40 }, {52 }, {
41 Name: "Medium",53 Name: "Medium",
42 CpuCores: 2,54 CpuCores: 2,
43 Mem: 3584,55 Mem: 3.5*GB,
44 OSDiskSpaceCloud: 489,56 OSDiskSpaceCloud: 489*GB,
45 OSDiskSpaceVirt: 135,57 OSDiskSpaceVirt: 135*GB,
46 MaxDataDisks: 4,58 MaxDataDisks: 4,
47 Cost: 12,59 Cost: 12,
48 }, {60 }, {
49 Name: "Large",61 Name: "Large",
50 CpuCores: 4,62 CpuCores: 4,
51 Mem: 7168,63 Mem: 7*GB,
52 OSDiskSpaceCloud: 999,64 OSDiskSpaceCloud: 999*GB,
53 OSDiskSpaceVirt: 285,65 OSDiskSpaceVirt: 285*GB,
54 MaxDataDisks: 8,66 MaxDataDisks: 8,
55 Cost: 24,67 Cost: 24,
56 }, {68 }, {
57 Name: "ExtraLarge",69 Name: "ExtraLarge",
58 CpuCores: 8,70 CpuCores: 8,
59 Mem: 14336,71 Mem: 14*GB,
60 OSDiskSpaceCloud: 2039,72 OSDiskSpaceCloud: 2039*GB,
61 OSDiskSpaceVirt: 65,73 OSDiskSpaceVirt: 65*GB,
62 MaxDataDisks: 16,74 MaxDataDisks: 16,
63 Cost: 48,75 Cost: 48,
64 }, {76 }, {
65 Name: "A6",77 Name: "A6",
66 CpuCores: 4,78 CpuCores: 4,
67 Mem: 28672,79 Mem: 28*GB,
68 OSDiskSpaceCloud: 999,80 OSDiskSpaceCloud: 999*GB,
69 OSDiskSpaceVirt: 285,81 OSDiskSpaceVirt: 285*GB,
70 MaxDataDisks: 8,82 MaxDataDisks: 8,
71 Cost: 82,83 Cost: 82,
72 }, {84 }, {
73 Name: "A7",85 Name: "A7",
74 CpuCores: 8,86 CpuCores: 8,
75 Mem: 57344,87 Mem: 56*GB,
76 OSDiskSpaceCloud: 2039,88 OSDiskSpaceCloud: 2039*GB,
77 OSDiskSpaceVirt: 65,89 OSDiskSpaceVirt: 65*GB,
78 MaxDataDisks: 16,90 MaxDataDisks: 16,
79 Cost: 164,91 Cost: 164,
80 },92 },
81}93}
94
95var RoleNameMap map[string]RoleSize = make(map[string]RoleSize)
96
97func init() {
98 for _, rolesize := range RoleSizes {
99 RoleNameMap[rolesize.Name] = rolesize
100 }
101}
82102
=== added file 'rolesizes_test.go'
--- rolesizes_test.go 1970-01-01 00:00:00 +0000
+++ rolesizes_test.go 2013-07-22 03:52:27 +0000
@@ -0,0 +1,16 @@
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
6import (
7 . "launchpad.net/gocheck"
8)
9
10type rolesizeSuite struct{}
11
12var _ = Suite(&rolesizeSuite{})
13
14func (suite *rolesizeSuite) TestMapIsCreated(c *C) {
15 c.Check(RoleNameMap, HasLen, len(RoleSizes))
16}

Subscribers

People subscribed via source and target branches

to all changes: