forked from cloudify-examples/drupal-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-blueprint.yaml
889 lines (798 loc) · 26.8 KB
/
azure-blueprint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
tosca_definitions_version: cloudify_dsl_1_3
imports:
- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-azure-plugin/1.4.2/plugin.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.3.5/plugin.yaml
- scale.yaml
#####################################################################################
# inputs section allows the user to use same
# blueprint for creating different deployments, each one
# with its own parameters.
# to specify deployment inputs run:
# - cfy deployments create -b <blueprint_id> -d <deployment_id> -i inputs.json
#####################################################################################
inputs:
resource_prefix:
default: cfy
resource_suffix:
default: 10
# Azure account information
subscription_id:
type: string
required: false
tenant_id:
type: string
required: false
client_id:
type: string
required: false
client_secret:
type: string
required: false
location:
type: string
required: true
default: eastus
retry_after:
type: integer
default: 60
# Existing manager resources
mgr_resource_group_name:
type: string
required: true
mgr_virtual_network_name:
type: string
required: true
mgr_subnet_name:
type: string
required: true
# Virtual Machine information
vm_size:
type: string
required: true
default: Standard_A2
vm_os_family:
type: string
required: true
default: linux
vm_image_publisher:
type: string
required: true
default: Canonical
vm_image_offer:
type: string
required: true
default: UbuntuServer
vm_image_sku:
type: string
required: true
default: 14.04.4-LTS
vm_image_version:
type: string
required: true
default: 14.04.201604060
vm_os_username:
description: >
Username to create as the VM's administrator user
type: string
required: true
default: cloudify
vm_os_password:
description: >
Password to use for the VM's administrator user
type: string
required: true
default: Cl0ud1fy!
vm_os_pubkeys:
description: the public key
default:
- path: {concat:[ '/home/', { get_input: vm_os_username }, '/.ssh/authorized_keys' ]}
keyData:
"ssh-rsa AAAAA3----your-key-here----aabbzz"
vm_os_pubkey_auth_only:
default: true
# Application information
docRoot:
default: /var/www/html
dbPort:
default: 3306
dbBindAddress:
type: string
default: '0.0.0.0'
memcachePort:
default: 11211
agent_config:
default:
user: { get_input: vm_os_username }
password: { get_input: vm_os_password }
port: 22
install_method: remote
azure_config:
default:
subscription_id: { get_input: subscription_id }
tenant_id: { get_input: tenant_id }
client_id: { get_input: client_id }
client_secret: { get_input: client_secret }
schemaurl:
type: string
default: 'http://repository.cloudifysource.org/org/cloudifysource/examples/drupal/new_babies7.zip'
drupalImageURL:
type:
default: 'http://repository.cloudifysource.org/org/cloudifysource/examples/drupal/babies_image_d7_v2.zip'
node_types:
###########################################################
# We define a type that inherits azure's default
# server, and adds monitoring capabillities on top of it.
###########################################################
host:
derived_from: cloudify.azure.nodes.compute.VirtualMachine
properties:
location:
default: { get_input: location }
retry_after:
default: { get_input: retry_after }
os_family:
default: { get_input: vm_os_family }
azure_config:
default: { get_input: azure_config }
resource_config:
default:
hardwareProfile:
vmSize: { get_input: vm_size }
storageProfile:
imageReference:
publisher: { get_input: vm_image_publisher }
offer: { get_input: vm_image_offer }
sku: { get_input: vm_image_sku }
version: { get_input: vm_image_version }
osProfile:
adminUsername: { get_input: vm_os_username }
adminPassword: { get_input: vm_os_password }
linuxConfiguration:
ssh:
publicKeys: { get_input: vm_os_pubkeys }
disablePasswordAuthentication: { get_input: vm_os_pubkey_auth_only }
agent_config:
default: { get_input: agent_config }
interfaces:
utils.ops:
restart_vm_op: utils-scripts/restart_vm.sh
###########################################################
# We are infact telling cloudify to install a diamond
# monitoring agent on the server.
#
# (see https://github.com/BrightcoveOS/Diamond)
###########################################################
cloudify.interfaces.monitoring_agent:
install:
implementation: diamond.diamond_agent.tasks.install
inputs:
diamond_config:
default:
interval: 1
start: diamond.diamond_agent.tasks.start
stop: diamond.diamond_agent.tasks.stop
uninstall: diamond.diamond_agent.tasks.uninstall
###########################################################
# Adding some collectors. These collectors are necessary
# for the Cloudify UI to display the deafult metrics.
###########################################################
cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
default:
CPUCollector: {}
MemoryCollector: {}
LoadAverageCollector: {}
DiskUsageCollector:
config:
devices: x?vd[a-z]+[0-9]*$
NetworkCollector: {}
mysql_dbms:
derived_from: cloudify.nodes.DBMS
properties:
port:
description: MySQL port
type: integer
sectionNames:
description: A command separated list of my.cnf section names
type: string
variableNames:
description: A command separated list of my.cnf variable names
type: string
newValues:
description: A command separated list of my.cnf values for the above variable names
type: string
mysql_schema:
derived_from: cloudify.nodes.ApplicationModule
properties:
port:
description: MySQL port
type: integer
schemaurl:
description: schema zip url
type: string
query:
description: Test Query
type: string
memcached_db_server:
derived_from: cloudify.nodes.DBMS
properties:
port:
description: Memcached port
type: integer
memcached_application:
derived_from: cloudify.nodes.ApplicationModule
properties:
port:
description: Memcached port
type: integer
requiredmemory:
description: Required memory size in MB
type: integer
apache_server:
derived_from: cloudify.nodes.WebServer
properties:
base_port:
description: Web application port
type: integer
needPhp:
description: Does this application require php
type: string
needMemcache:
description: Does this application require memcache
type: string
dbType:
description: Database type that this application requires
type: string
num_instances:
description: Number of instances
type: integer
drupalVersion:
description: Drupal version
type: string
newPort:
description: Apache port
type: integer
docRoot:
description: docRoot of the Apache
type: string
drupal_application:
derived_from: cloudify.nodes.ApplicationModule
properties:
drupalImageURL:
description: Drupal image zip URL
type: string
app_name:
description: Application name
type: string
dbName:
description: Database name
type: string
dbUserName:
description: DB user name
type: string
dbUserPassword:
description: DB user password
type: string
docRoot:
description: docRoot of the Drupal
type: string
relationships:
drupal_server_connected_to_mysql_database:
derived_from: cloudify.relationships.connected_to
drupal_app_connected_to_mysql_drupal_schema:
derived_from: cloudify.relationships.connected_to
source_interfaces:
cloudify.interfaces.relationship_lifecycle:
postconfigure: drupal-scripts/configure-mysql-drupal.sh
target_interfaces:
cloudify.interfaces.relationship_lifecycle:
postconfigure: mysql-scripts/configure-mysql-schema.sh
drupal_app_connected_to_memcached_app:
derived_from: cloudify.relationships.connected_to
source_interfaces:
cloudify.interfaces.relationship_lifecycle:
establish: drupal-scripts/configure-memcached-drupal.sh
node_templates:
mysql_database:
type: mysql_dbms
properties:
port: { get_input: dbPort }
sectionNames: mysqld
variableNames: bind-address
newValues: 0.0.0.0
interfaces:
cloudify.interfaces.lifecycle:
create: mysql-scripts/install-mysql-aws.sh
start: mysql-scripts/start-mysql.sh
stop: mysql-scripts/stop-mysql.sh
relationships:
- target: mysql_vm
type: cloudify.relationships.contained_in
mysql_drupal_schema:
type: mysql_schema
properties:
port: { get_input: dbPort }
query: select name,mail from users
schemaurl: { get_input: schemaurl }
interfaces:
cloudify.interfaces.lifecycle:
configure: mysql-scripts/configure-mysql-schema.sh
cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
MySQLCollector:
config:
enabled: True
hosts: "admin:123@localhost:3306/mydrupaldb"
relationships:
- target: mysql_database
type: cloudify.relationships.contained_in
memcached_server:
type: memcached_db_server
properties:
port: { get_input: memcachePort }
interfaces:
cloudify.interfaces.lifecycle:
create: memcached-scripts/install-memcached.sh
configure: memcached-scripts/configure-memcached.sh
relationships:
- target: memcached_vm
type: cloudify.relationships.contained_in
memcached_app:
type: memcached_application
properties:
port: { get_input: memcachePort }
requiredmemory: 1000
interfaces:
cloudify.interfaces.lifecycle:
start: memcached-scripts/start-memcached.sh
stop: memcached-scripts/stop-memcached.sh
relationships:
- target: memcached_server
type: cloudify.relationships.contained_in
drupal_server:
type: apache_server
properties:
base_port: 8080
num_instances: 1
needPhp: yesplease
needMemcache: yesplease
dbType: mysql
drupalVersion: 7
newPort: 80
docRoot: { get_input: docRoot }
interfaces:
cloudify.interfaces.lifecycle:
create: apache-scripts/install-apache.sh
relationships:
- type: cloudify.relationships.contained_in
target: apache_vm
- type: drupal_server_connected_to_mysql_database
target: mysql_database
drupal_app:
type: drupal_application
properties:
docRoot: { get_input: docRoot }
drupalImageURL: { get_input: drupalImageURL }
app_name: My drupal web server
dbName: mydrupaldb
dbUserName: admin
dbUserPassword: 123
interfaces:
cloudify.interfaces.lifecycle:
start: apache-scripts/start-apache.sh
stop: apache-scripts/stop-apache.sh
drupal.interfaces.action:
install_project: drupal-scripts/drush-install.sh
set_variable: drupal-scripts/drush-setvar.sh
relationships:
- type: cloudify.relationships.contained_in
target: drupal_server
- type: drupal_app_connected_to_memcached_app
target: memcached_app
- type: drupal_app_connected_to_mysql_drupal_schema
target: mysql_drupal_schema
apache_vm:
type: host
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.connected_to_storage_account
target: storage_account
- type: cloudify.azure.relationships.connected_to_availability_set
target: availability_set
- type: cloudify.azure.relationships.connected_to_nic
target: apache_nic
mysql_vm:
type: host
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.connected_to_storage_account
target: storage_account
- type: cloudify.azure.relationships.connected_to_availability_set
target: availability_set
- type: cloudify.azure.relationships.connected_to_nic
target: mysql_nic
memcached_vm:
type: host
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.connected_to_storage_account
target: storage_account
- type: cloudify.azure.relationships.connected_to_availability_set
target: availability_set
- type: cloudify.azure.relationships.connected_to_nic
target: memcached_nic
resource_group:
type: cloudify.azure.nodes.ResourceGroup
properties:
name: {concat:[{get_input: resource_prefix},arg,{get_input: resource_suffix}]}
location: { get_input: location }
azure_config: { get_input: azure_config }
storage_account:
type: cloudify.azure.nodes.storage.StorageAccount
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
resource_config:
accountType: Standard_LRS
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
virtual_network:
type: cloudify.azure.nodes.network.VirtualNetwork
properties:
resource_group_name: { get_input: mgr_resource_group_name }
name: { get_input: mgr_virtual_network_name }
azure_config: { get_input: azure_config }
use_external_resource: true
location: { get_input: location }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
subnet:
type: cloudify.azure.nodes.network.Subnet
properties:
resource_group_name: { get_input: mgr_resource_group_name }
name: { get_input: mgr_subnet_name }
azure_config: { get_input: azure_config }
use_external_resource: true
location: { get_input: location }
relationships:
- type: cloudify.azure.relationships.contained_in_virtual_network
target: virtual_network
drupal_security_group:
type: cloudify.azure.nodes.network.NetworkSecurityGroup
properties:
name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix}]}
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
resource_config:
securityRules:
- name: drup_ssh
properties:
description: SSH access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 22
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 102
access: Allow
direction: Inbound
- name: drup_http
properties:
description: HTTP access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 80
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 103
access: Allow
direction: Inbound
- name: drup_httpb
properties:
description: HTTP Access B
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 8080
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 1030
access: Allow
direction: Inbound
- name: drup_httpc
properties:
description: HTTP Access C
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 8000
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 1031
access: Allow
direction: Inbound
- name: drup_mysql
properties:
description: MySQL access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 3306
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 104
access: Allow
direction: Inbound
- name: cfy_rabbitb
properties:
description: Cloudify RabbitMQ B
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 55672
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 105
access: Allow
direction: Inbound
- name: cfy_rabbit
properties:
description: Cloudify RabbitMQ
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 5672
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 106
access: Allow
direction: Inbound
- name: cfy_filesrv
properties:
description: Cloudify File Server
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 53229
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 107
access: Allow
direction: Inbound
- name: cfy_agent
properties:
description: Cloudify Agent Rest API
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 8101
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 108
access: Allow
direction: Inbound
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
availability_set:
type: cloudify.azure.nodes.compute.AvailabilitySet
properties:
name: {concat:[{get_input: resource_prefix},availset,{get_input: resource_suffix}]}
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
mysql_nic:
type: cloudify.azure.nodes.network.NetworkInterfaceCard
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.nic_connected_to_network_security_group
target: drupal_security_group
- type: cloudify.azure.relationships.nic_connected_to_ip_configuration
target: mysql_nic_ip_config
memcached_nic:
type: cloudify.azure.nodes.network.NetworkInterfaceCard
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.nic_connected_to_network_security_group
target: drupal_security_group
- type: cloudify.azure.relationships.nic_connected_to_ip_configuration
target: memcached_nic_ip_config
apache_nic:
type: cloudify.azure.nodes.network.NetworkInterfaceCard
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.nic_connected_to_network_security_group
target: drupal_security_group
- type: cloudify.azure.relationships.nic_connected_to_ip_configuration
target: apache_nic_ip_config
mysql_nic_ip_config:
type: cloudify.azure.nodes.network.IPConfiguration
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
resource_config:
privateIPAllocationMethod: Dynamic
relationships:
- type: cloudify.azure.relationships.ip_configuration_connected_to_subnet
target: subnet
memcached_nic_ip_config:
type: cloudify.azure.nodes.network.IPConfiguration
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
resource_config:
privateIPAllocationMethod: Dynamic
relationships:
- type: cloudify.azure.relationships.ip_configuration_connected_to_subnet
target: subnet
apache_nic_ip_config:
type: cloudify.azure.nodes.network.IPConfiguration
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
resource_config:
privateIPAllocationMethod: Dynamic
relationships:
- type: cloudify.azure.relationships.ip_configuration_connected_to_subnet
target: subnet
- type: cloudify.azure.relationships.ip_configuration_connected_to_public_ip
target: apache_ip
apache_ip:
type: cloudify.azure.nodes.network.PublicIPAddress
properties:
location: { get_input: location }
azure_config: { get_input: azure_config }
retry_after: { get_input: retry_after }
resource_config:
publicIPAllocationMethod: Static
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
plugins:
drush-plugin:
executor: central_deployment_agent
source: drush-plugin
utils-plugin:
executor: central_deployment_agent
source: utils-plugin
workflows:
restart_vms:
mapping: utils-plugin.vms.tasks.restart_vms
parameters:
node_id:
description: The node id whose instance will be restarted
node_instance_id:
description: The node instance id which will be restarted - default(null) = All instances...
default: null
my_input:
description: Additional input
default: null
drush_install:
mapping: drush-plugin.drush.tasks.install_project
parameters:
project_name: {}
# See Built-in Workflows in http://getcloudify.org/guide/3.3.1/guide-workflows.html#built-in-workflows
# drushinstall:
# mapping: default_workflows.cloudify.plugins.workflows.execute_operation
# parameters:
# operation: drupal.interfaces.action.install_project
# node_ids:
# - drupal_app
drush_setvar:
mapping: drush-plugin.drush.tasks.set_variable
parameters:
variable_name:
default: theme_default
variable_value: {}
# Syntax without parameters
# drush_dl: drush-plugin.drush.tasks.drush_download_module
# drush_en: drush-plugin.drush.tasks.drush_enable_module
outputs:
endpoint:
description: Web application endpoint
value:
drupal_url: { concat: ['http://', { get_attribute: [apache_vm, public_ip] },':', { get_property: [drupal_server, newPort] }] }
groups:
scale_up_group:
members: [apache_vm]
policies:
auto_scale_up:
type: scale_policy_type
properties:
default_instances: 1
# If there is more than one member and policy_operates_on_group is set to true,
# then the threshold is checked against the SUM of all the relevant metrics from all the memebers.
# E.g.:
# policy_operates_on_group is set to true and the members are aaa,bbb and ccc
# threshold is 10
# aaa has 3, bbb has 4 and ccc is 5, then together they are more than 10 , hence the threshold will be breached.
# if policy_operates_on_group is set to false, then if and only if at least one of them (aaa,bbb or ccc) is greater than 10, the threshold will be breached.
policy_operates_on_group: true
scale_limit: 5
scale_direction: '<'
scale_threshold: 40
service_selector: .*apache_vm.*.cpu.total.user
cooldown_time: 60
triggers:
execute_scale_workflow:
type: cloudify.policies.triggers.execute_workflow
parameters:
workflow: scale
workflow_parameters:
delta: 1
scalable_entity_name: apache
# scale_compute: true
scale_down_group:
members: [apache_vm]
policies:
auto_scale_down:
type: scale_policy_type
properties:
default_instances: 1
scale_limit: 2
scale_direction: '>'
scale_threshold: 20
service_selector: .*apache_vm.*.cpu.total.user
cooldown_time: 60
triggers:
execute_scale_workflow:
type: cloudify.policies.triggers.execute_workflow
parameters:
workflow: scale
workflow_parameters:
delta: -1
scalable_entity_name: apache
# scale_compute: true
heal_group:
members: [memcached_vm]
policies:
simple_autoheal_policy:
type: cloudify.policies.types.host_failure
properties:
service: ['cpu.total.user']
#- .*memcached-vm.*.cpu.total.user
interval_between_workflows: 60
triggers:
auto_heal_trigger:
type: cloudify.policies.triggers.execute_workflow
parameters:
workflow: heal
workflow_parameters:
node_instance_id: { 'get_property': [ SELF, node_id ] }
diagnose_value: { 'get_property': [ SELF, diagnose ] }
apache:
members: [apache_vm, apache_ip]
policies:
scale_policy1:
type: cloudify.policies.scaling
properties:
default_instances: 1
targets: [apache]