DescriptionAzure provider: map instances onto Azure services.
We had to change our strategy w.r.t. how the Azure provider maps Juju instances onto Azure's objects. Our original plan was to use a Service as a container for all the Deployments created by the provider, each of these deployments corresponding to a Juju node. This is graphical representation of the model we had in mind:
Account >
- Hosted Service (container configured in the juju config)
- Deployment 1 (juju instance 1)
- VM
- Deployment 2 (juju instance 2)
- VM
- Deployment 3 (juju instance 3)
- VM
We thought we could use Service as a container of Deployments (and thus, VMs). But we can't! It turns out a Service can only be deployed to "staging" and to "production"... and those are its two Deployments. You can't add more.
Here is the Azure model as we now know it:
Account >
- Hosted Service 1 >
- Deployment, production slot >
- VM
- VM
- Deployment, staging slot >
- VM
- VM
- Hosted Service 2 >
We discussed our options with the Red Squad and mgz and reached the conclusion that having one hosted service per Juju instance is the only reasonnable solution to accomodate Juju's model with how Azure's structure. We're going with: one Juju Instance is one Azure Service, containing one Deployment, containing one VM.
Account > (container configured in the juju config)
- Hosted Service 1 (juju instance 1)
- Deployment 1
- VM
- Hosted Service 2 (juju instance 2)
- deployment 2
- VM
- Hosted Service 3 (juju instance 3)
- deployment 3
- VM
In this branch, I change the code from the old model to the new. The changes are surprinsingly straighforward:
- In Environ.Instances() and Environ.AllInstances(), use the gwacl method to list the hosted services instead of the method used to list deployments.
- Use the gwacl object representing a Service instead of the one representing a Deployment inside the instance.go:azureInstance object. Note that the hostname of the Azure instance, which is stored by Azure on the Deployment object, will be copied over (by the Azure provider, when the hosted service and the deployment will be created) in the Hosted Service's base64-encoded 'Label' field. This is mainly a convenient shortcut to avoid having to fetch the Deployment inside each Service when we want a list of the instances' hostnames.
- Get rid of the management hosted service name config item.
https://code.launchpad.net/~rvb/juju-core/use-hosted-services/+merge/173140
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 1
MessagesTotal messages: 4
|