Skip to content

Commit 192439b

Browse files
committed
Merge pull request #3329 from gvilarino/add/azure-affinity-groups
fix(azure): add support for Azure affinity groups
2 parents 1bda737 + a8eb3ab commit 192439b

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

contrib/azure/azure-coreos-cluster

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ parser.add_argument('--vm-name-prefix', default='coreos',
3030
parser.add_argument('--availability-set', default='coreos-as',
3131
help='optional, name of availability set for cluster [coreos-as]')
3232
parser.add_argument('--location', default='West US',
33-
help='optional, [West US]')
33+
help='optional - overriden by affinity-group, [West US]')
34+
parser.add_argument('--affinity-group', default='',
35+
help='optional, overrides location if specified')
3436
parser.add_argument('--ssh', default=22001, type=int,
3537
help='optional, starts with 22001 and +1 for each machine in cluster')
3638
parser.add_argument('--coreos-image', default='2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-607.0.0',
@@ -176,8 +178,12 @@ sms = ServiceManagementService(args.subscription, args.azure_cert)
176178
try:
177179
print 'Creating the hosted service...',
178180
sys.stdout.flush()
179-
sms.create_hosted_service(
180-
args.cloud_service_name, label=args.cloud_service_name, location=args.location)
181+
if args.affinity_group:
182+
sms.create_hosted_service(
183+
args.cloud_service_name, label=args.cloud_service_name, affinity_group=args.affinity_group)
184+
else:
185+
sms.create_hosted_service(
186+
args.cloud_service_name, label=args.cloud_service_name, location=args.location)
181187
print('Successfully created hosted service ' + args.cloud_service_name)
182188
sys.stdout.flush()
183189
time.sleep(2)

docs/installing_deis/azure.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ With the management certificate and cloud config in place, we are ready to creat
6969

7070
* Create a container called ``vhds`` within a storage account in the same region as your cluster using the Azure portal. Note the URL of the container for the cluster creation script below.
7171
* Choose a cloud service name for your Deis cluster for the script below. The script will automatically create this cloud service for you.
72-
* Choose an Azure `region`_ to use. Supply it in quotes with the ``--location`` parameter. The default is "West US".
72+
* Create an `affinity group`_ if you already don't have one. Supply it in quotes with the ``--affinity-group`` parameter. Although *using an affinity group is not mandatory*, it is **highly recommended** since it tells the Azure fabric to place all VMs in the cluster physically close to each other, reducing inter-node latency by a great deal. If you don't want ot use affinity groups, specify a `region`_ for Azure to use with a ``--location`` parameter. The default is ``"West US"``. If you specify both parameters, ``location`` will be ignored. Please note that the script *will not* create an affinity group by itself; it expects the affinity group exists.
7373

7474
With that, let's run the azure-coreos-cluster script which will create the CoreOS cluster. Fill in the bracketed values with the values for your deployment you created above.
7575

@@ -79,7 +79,7 @@ With that, let's run the azure-coreos-cluster script which will create the CoreO
7979
--subscription [subscription id]
8080
--azure-cert azure-cert.pem
8181
--num-nodes 3
82-
--location "[location]"
82+
--affinity-group [affinity group name]
8383
--vm-size Large
8484
--pip
8585
--deis
@@ -112,3 +112,4 @@ start installing the platform.
112112
.. _`etcd`: https://github.com/coreos/etcd
113113
.. _`etcd disaster recovery`: https://github.com/coreos/etcd/blob/master/Documentation/admin_guide.md#disaster-recovery
114114
.. _`region`: http://azure.microsoft.com/en-us/regions/
115+
.. _`affinity group`: https://msdn.microsoft.com/en-gb/library/azure/jj156085.aspx

0 commit comments

Comments
 (0)