Merge lp:~axwalk/juju-core/azure-provider-doc into lp:~go-bot/juju-core/trunk

Proposed by Andrew Wilkins
Status: Merged
Approved by: Andrew Wilkins
Approved revision: no longer in the source branch.
Merged at revision: 2581
Proposed branch: lp:~axwalk/juju-core/azure-provider-doc
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 164 lines (+160/-0)
1 file modified
doc/azure-provider.txt (+160/-0)
To merge this branch: bzr merge lp:~axwalk/juju-core/azure-provider-doc
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+214478@code.launchpad.net

Commit message

doc: add azure provider doc

https://codereview.appspot.com/84470052/

Description of the change

doc: add azure provider doc

https://codereview.appspot.com/84470052/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+214478_code.launchpad.net,

Message:
Please take a look.

Description:
doc: add azure provider doc

https://code.launchpad.net/~axwalk/juju-core/azure-provider-doc/+merge/214478

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/84470052/

Affected files (+157, -0 lines):
   A [revision details]
   A doc/azure-provider.txt

Revision history for this message
William Reade (fwereade) wrote :

LGTM. Please make sure evilnick knows about this.

https://codereview.appspot.com/84470052/diff/1/doc/azure-provider.txt
File doc/azure-provider.txt (right):

https://codereview.appspot.com/84470052/diff/1/doc/azure-provider.txt#newcode101
doc/azure-provider.txt:101: default, we set
availability-sets-enabled=true for new environments.
I know you cover it later, but it would be good to have a single
sentence here, explicitly pointing out the tradeoff you're making by
setting availability-sets-enabled to false.

https://codereview.appspot.com/84470052/

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Please take a look.

https://codereview.appspot.com/84470052/diff/1/doc/azure-provider.txt
File doc/azure-provider.txt (right):

https://codereview.appspot.com/84470052/diff/1/doc/azure-provider.txt#newcode101
doc/azure-provider.txt:101: default, we set
availability-sets-enabled=true for new environments.
On 2014/04/07 09:10:22, fwereade wrote:
> I know you cover it later, but it would be good to have a single
sentence here,
> explicitly pointing out the tradeoff you're making by setting
> availability-sets-enabled to false.

Done.

https://codereview.appspot.com/84470052/

Revision history for this message
Nick Veitch (evilnick) wrote :

i got the note thanks. Will add a bug to the docs so I can add this to dev docs

On Tue, Apr 8, 2014 at 4:30 AM, Andrew Wilkins
<email address hidden> wrote:
> Please take a look.
>
>
> https://codereview.appspot.com/84470052/diff/1/doc/azure-provider.txt
> File doc/azure-provider.txt (right):
>
> https://codereview.appspot.com/84470052/diff/1/doc/azure-provider.txt#newcode101
> doc/azure-provider.txt:101: default, we set
> availability-sets-enabled=true for new environments.
> On 2014/04/07 09:10:22, fwereade wrote:
>> I know you cover it later, but it would be good to have a single
> sentence here,
>> explicitly pointing out the tradeoff you're making by setting
>> availability-sets-enabled to false.
>
> Done.
>
> https://codereview.appspot.com/84470052/
>
> --
> https://code.launchpad.net/~axwalk/juju-core/azure-provider-doc/+merge/214478
> Your team juju hackers is requested to review the proposed merge of lp:~axwalk/juju-core/azure-provider-doc into lp:juju-core.

--
Nick Veitch
<email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'doc/azure-provider.txt'
2--- doc/azure-provider.txt 1970-01-01 00:00:00 +0000
3+++ doc/azure-provider.txt 2014-04-08 03:24:31 +0000
4@@ -0,0 +1,160 @@
5+Introduction
6+============
7+
8+This document describes how the Azure provider works; how Azure concepts are
9+mapped, and some high-level descriptions of how the provider is implemented.
10+
11+
12+References
13+==========
14+
15+Service Management REST API Reference
16+http://msdn.microsoft.com/library/azure/ee460799.aspx
17+
18+"What is a cloud service?" (This is out of date, but still somewhat useful.)
19+http://azure.microsoft.com/en-us/documentation/articles/cloud-services-what-is/
20+
21+Cloud Services, Virtual Machines and Virtual Network SLA
22+https://www.microsoft.com/windowsazure/sla/
23+
24+
25+Azure Concepts
26+==============
27+
28+Affinity Group
29+
30+ An Affinity Group is used to group VMs, storage, etc. within a location.
31+ It is possible to simply associate each of the entities with the same
32+ location, however it is recommended to use an Affinity Group. Azure may
33+ then locate entities as close to each other as possible within a data-
34+ centre, as opposed to just being in the same data-centre.
35+
36+ We create an Affinty Group per environment called "juju-<envname>-ag".
37+
38+Cloud Service
39+
40+ (AKA "Hosted Service" in API)
41+
42+ A Cloud Service is a container for VMs, and is the publicly-addressable
43+ entity for Azure's compute service. Each Cloud Service must have a
44+ globally-unique name, which is used to derive its domain name. A Cloud-
45+ Service has only one domain name and public IP address.
46+
47+ We currently prefix Cloud Services that we create with "juju-<envname>-",
48+ and randomly generate the remainder of the name.
49+
50+Deployment
51+
52+ A Cloud Service may have up to two deployments: Production and Staging.
53+ The deployments may be swapped at runtime, so that a Staging deployment
54+ can be upgraded whilst maintaining a Production deployment that can be
55+ swapped back to should the upgrade go wrong.
56+
57+ We currently only ever create a Production deployment.
58+
59+Role
60+
61+ For our purposes, a Role describes a Virtual Machine (VM). The description
62+ includes the hostname, initial username and password, attached disk(s),
63+ network configuration, and which Availability Set (if any) the role belongs
64+ to.
65+
66+ A role may have multiple instances (Role Instance), however we only ever
67+ have one per role. The Juju "Instance" implementation for the Azure
68+ provider maps to a Role Instance, although the implementation details
69+ differ between the current and the original implementation.
70+
71+ A role/instance has only Virtual IPs (VIPs), i.e. internal addresses. The
72+ role may expose "endpoints", i.e. TCP/UDP ports. Each port may be exposed
73+ by at most one role in a Cloud Service, unless that port is part of a load-
74+ balancing set. When a client connects to the containing Cloud Service's
75+ address + the endpoint port, the traffic will be routed to the role
76+ instance(s) that expose that endpoint.
77+
78+Availability Set
79+
80+ Each Cloud Service has zero or more Availability Sets within it; a Role
81+ can be assigned to at most one of them. As long as there are at least two
82+ Roles in the same Availability Set, then Azure will guarantee at least
83+ 99.95% availability under the Azure Service Level Agreement (SLA).
84+
85+ We create a single Availability Set for each Cloud Service, and all roles
86+ are added to it. Thus, all Juju-deployed services are, by default, covered
87+ by the Azure SLA.
88+
89+
90+Azure provider implementation
91+=============================
92+
93+Bootstrapping
94+
95+ Before the Azure provider can bootstrap an environment, it expects one and
96+ only one thing to be pre-existing: a storage account; this storage account
97+ is used for the environment's Storage() implementation. When the
98+ environment is bootstrapped, the provider creates an affinity group and a
99+ virtual network.
100+
101+ The Azure provider now has two modes in which it can operate, configured at
102+ bootstrap time with the "availability-sets-enabled" boolean attribute. If it
103+ is true (henceforth "azure-mode"), then support for multiple Roles per Cloud-
104+ Service is enabled; otherwise there is a single Role per Cloud Service. By
105+ default, we set availability-sets-enabled=true for new environments.
106+
107+ Note: by setting availability-sets-enabled=false, you will gain the abililty
108+ to place units on any machine at the cost of losing Azure's SLA guarantees.
109+ See "Starting instances" below for more details on what is prevented by
110+ azure-mode.
111+
112+Starting instances
113+
114+ When *not* in azure-mode, the provider will simply create a new Cloud-
115+ Service, Deployment, and Role. The user may use placement directives and
116+ add machines like in any other provider, but they will not have any
117+ availability guarantees provided by Azure.
118+
119+ When in azure-mode, the provider must impose several restrictions to
120+ achieve availability guarantees:
121+ - placement (i.e. --to <machine>) is disallowed,
122+ - "juju add-machine" is disallowed.
123+ Thus, an instance can only be created in response to adding a unit to a
124+ service, and an instance can contain only units of a single service type.
125+
126+ Instances are deployed to the same Cloud Service as the other instances
127+ of its "Distribution Group" (a new Juju provisioning concept introduced
128+ to support azure-mode, Availability Zones, etc.), or a new Cloud Service
129+ if the group is empty. For a state server, the Distribution Group is the
130+ set of instances that contain other state server instances; for any other
131+ instance, the Distribution Group is the set of instances that contain units
132+ of the same service that the instance is being provisioned for. All new
133+ instances are added to the same Availability Set within the Cloud Service.
134+
135+Instance mapping
136+
137+ In the Azure provider, we map instance IDs to a Role within a Cloud-
138+ Service. The instance-id format is servicename-rolename, where servicename
139+ is the name of the Cloud Service and rolename is the name of the Role. We
140+ only ever have one Deployment in a Cloud Service, so it is inferred.
141+
142+ Originally the provider was written such that instance IDs mapped only to
143+ Cloud Services, as originally there was a one-to-one correspondence between
144+ Juju-deployed Cloud Services and Roles. This has had to change to cater for
145+ Azure's recommended high availability practices. We maintain backwards
146+ compatability with old deployments; existing Cloud Services are assumed
147+ to have a single role within.
148+
149+Exposing Services
150+
151+ Because a Cloud Service has a single public IP, and instances within do
152+ not have their own, exposed services will have their ports load balanced
153+ across each instance whose unit opens the port. Load balancing only takes
154+ effect when connecting to the public (Cloud Service) address.
155+
156+ In azure-mode, the state server and API server ports are automatically
157+ load-balanced. When HA Juju is enabled, this means that API client
158+ connections will be load balanced automatically by Azure.
159+
160+ In azure-mode, the SSH port is also load-balanced so that port 22 may be
161+ used uniformly across providers. To ensure that "juju ssh" connects to
162+ the correct instance, we connect to the instance's internal address by
163+ first proxying through the API server.
164+

Subscribers

People subscribed via source and target branches

to status/vote changes: