platform resource scheduler holistic application policy in heat
TRANSCRIPT
© 2012 IBM Corporation
IBM Platform Resource Scheduler
Yong Feng: [email protected]
Holistic Application Policy in Heat
© 2014 IBM Corporation
Platform Computing
2
What is IBM Platform Resource Scheduler?
• Provides dynamic resource management for IBM OpenStack clouds
• Automated management
• Reduce Infrastructure costs
• Improved application performance and high availability
• Higher quality of service
• More flexible resource selection
• Intelligent placement – automated, runtime resource optimization
• Included as optional scheduler and optimization service in ICM 4.2
• Included as a chargeable add-on product for IBM SmartCloud Orchestrator 2.4
• Full compatibility with the Nova APIs and fits seamlessly into OpenStack environments
• Part of IBM SDE portfolio
© 2014 IBM Corporation
Platform Computing
3
Customer pain points with OpenStack adoption
• How to place workloads for optimal QoS of
application?
• How to migrate VMs as conditions change?
• Improve automation to reduce administration effort?
• How to reduce power consumption?
• Guarantee capacity for planned workloads?
• How share resources among competing tenants?
• How to optimally use software licenses?
Three key limitations:
Not holistically scheduling all VMs of application
Static allocation decisions
Deals with initial placement only – no runtime
optimization
© 2014 IBM Corporation
Platform Computing
4
Platform Resource Scheduler Vs Community Scheduler
Keep 100% compatibility of community scheduler
– Support all the features and planned of community scheduler
– The interface and architecture follows the extension of OpenStack
Contribute PRS feature timely back to community to protect PRS
technology
Provide enterprise level features and qualities
– More and user-defined metrics available for placement constraint
– Placement policy for aggregate (packing, striping, cpu/mem load balance,
user defined) to reduce infrastructure cost and improve resource utilization.
– Placement policy in HEAT and Server Group (topology-aware
affinity/anti-affinity, max lost per node failure) for optimal QoS of
application
– Placement policy and constraints honored during VM/Application Lifecycle
– Runtime optimization policy to optimize resource utilization and QoS of
application.
– VM HA Policy to optimize high availability of application
– Hypervisor Maintenance Policy to reduce admin efforts
– Faster, scale and stable as high quality service of product
© 2014 IBM Corporation
Platform Computing
5
3. Schedule VMs of
whole app
together. Global
policy and filters
are consider as
well. The result is
kept in PRS.PRS
Placement& Resource Plans
OpenStack Heat Manager
6. Place VM
according to plan
Python API
5. Query PRS for
placement plan of
individual VM
2. Request for VMs of
whole application
Heat Scheduler Plug-in
Extension to OpenStack Heat Template
– New Heat resource of “IBM::Policy::Group” to specify application placement policy of
topology-aware affinity. anti-affinity and max failure per host.
– Schedule VMs of whole Heat application in a holistic way.
VM
VM
VM
VM
VM
VM
NOVA COMPUTE
# heat stack-create –f PolicyGroup.yuml app1
Platform Resource Scheduler Heat Holistic Scheduling
1. Request a stack with PRS “IBM::Policy::Group” resourcetier1_policy_group:type: IBM::Policy::Grouppolicies:
- type: AntiAffinitymode: hardtopology:
name: Availabilitylevel: rack
tier2_policy_group:type: IBM::Policy::Groupproperties:policies:
- type: AntiAffinitymode: hardtopology:
name: Availabilitylevel: rack
relationships:- peer: tier1_policy_grouppolicy:
type: Affinitymode: hardtopology:name: Availabilitylevel: host
OpenStack Nova Manager
Python API
Heat Scheduler Plug-in
4. Create individual VM with
stack and resource id
0. Infrastructure
topology defined
in PRS.
© 2014 IBM Corporation
Platform Computing
6
Nova
EGO
IBM Platform Resource
Scheduler
OpenStack EE
EGO API
schedule request
Host attributes,
VM allocation
and migration
plan
VM Migrating
request by
OpenStack API
VM placement
replacement
decision
EGO Python
API
PRS Nova
Scheduler
Notification
Service
Resource
Optimization Service
Nova-compute
Nova-api
Nova-conductor
DB
Host metrics
message queue
state chance of VM,
VM group, host, host
aggregate
state chance of VM,
VM group, host, host
aggregate
Nova API extension for
CRUD of optimization policy
ArchitectureNova API extension for
CRUD of HA policy
PRS Heat
Scheduler
HA service
HeatHeat Engine
HOT with
APP Policy
stack_id and
res_name as hints
New added or enhanced components
query schedule
decision
decision id
persistent in VM
metadata
© 2014 IBM Corporation
Platform Computing
7
Demo Use Cases
1. Topology-aware Affinity and Anti-Affinity Policies within
Resource Policy Group
– The user wants to:
• Distribute the workloads of one application tier as close as each other as possible
for better performance. For example, the instances of this tier have communication
with each other like memcached.
• Distribute the workloads of the second on separate hosts. For example, they have
port conflicts or resource competing like both are I/O intensive workload.
© 2014 IBM Corporation
Platform Computing
8
Demo Use Cases
2. Topology-aware Affinity and Anti-Affinity Policies between
Resource Policy Groups
– The user wants to:
• Workloads from different tiers have dependence from each other so that they have
to be placed in the same physical host, for example NFV services.
• Workloads from different tiers have resource competing with each other so that
they’d better be placed in different physical host
© 2014 IBM Corporation
Platform Computing
9
Demo Use Cases
3. Application Resiliency using (Hierarchical) Availability Zones
– The user wants to distribute workloads of an application evenly between two
availability zones and maintain this distribution during scale up and down.
For example, this configuration guarantees that at least 50% of the workload
remains available if one of the zones goes down.
© 2014 IBM Corporation
Platform Computing
12
host1 host2 host3 host4 host5 host6
rack1 rack2 rack3
Availability
Runtime Environment• 6 hypervisors• Organized in three (3)
racks by hypervisor host name
• Or organized in two (2) availability-zones by hypervisor host attribute of availability_zone
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
© 2014 IBM Corporation
Platform Computing
13
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
© 2014 IBM Corporation
Platform Computing
14
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
tier1_policy_group:type: IBM::Policy::Groupproperties:policies:
- type: Affinitymode: hardtopology:
name: Availabilitylevel: host
© 2014 IBM Corporation
Platform Computing
15
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: rack
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
tier1_asg:type: OS::Heat::AutoScalingGroupproperties:resource:
type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1desired_capacity: 4max_size: 10
© 2014 IBM Corporation
Platform Computing
16
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: rack
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
tier1_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: tier1_asg}cooldown: 60scaling_adjustment: 1
tier1_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: tier1_asg}cooldown: 60scaling_adjustment: '-1'
© 2014 IBM Corporation
Platform Computing
17
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: rack
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_policy_group:type: IBM::Policy::Groupproperties:policies:
- type: AntiAffinitymode: hardtopology:
name: Availabilitylevel: host
© 2014 IBM Corporation
Platform Computing
18
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: rack
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:type: OS::Heat::AutoScalingGroupproperties:resource:
type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy: {get_resource:
tier2_policy_group}}min_size: 1desired_capacity: 4max_size: 10
© 2014 IBM Corporation
Platform Computing
19
Affinity and Anti-Affinity in Resource Groups - Heat Document[root@dc1-rack1-host1 demo]# more Affinity_and_AntiAffinity_Policy_within_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Affinity
mode: hard
topology:
name: Availability
level: rack
- type: Affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: AntiAffinity
mode: hard
topology:
name: Availability
level: host
tier1_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier1_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier1_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: 1
tier1_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier1_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_asg:
type: OS::Heat::AutoScalingGroup
properties:
resource:
type: OS::Nova::Server
properties:
image: { get_param: image }
flavor: { get_param: flavor }
scheduler_hints: {group_policy: {get_resource: tier2_policy_group}}
min_size: 1
desired_capacity: 4
max_size: 10
tier2_scale_up_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: 1
tier2_scale_down_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: tier2_asg}
cooldown: 60
scaling_adjustment: '-1'
tier2_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: tier2_asg}cooldown: 60scaling_adjustment: 1
tier2_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: tier2_asg}cooldown: 60scaling_adjustment: '-1'
© 2014 IBM Corporation
Platform Computing
20
host1 host2 host3 host4 host5 host6
rack1 rack2 rack3
Availability
tier1_asg
tier2_asg
tier1_asg
tier1_asg
tier1_asg
tier2_asg tier2_asg tier2_asg
© 2014 IBM Corporation
Platform Computing
21
host1 host2 host3 host4 host5 host6
rack1 rack2 rack3
Availability
tier1_asg
tier2_asg
tier1_asg
tier1_asg
tier1_asg
tier2_asg tier2_asg tier2_asg
tier1_asg
© 2014 IBM Corporation
Platform Computing
22
host1 host2 host3 host4 host5 host6
rack1 rack2 rack3
Availability
tier1_asg
tier2_asg
tier1_asg
tier1_asg
tier1_asg
tier2_asg tier2_asg tier2_asg
© 2014 IBM Corporation
Platform Computing
25
Anti-Affinity between Resource Groups - Heat Document[[root@dc1-rack1-host1 demo]# more
./Affinity_and_AntiAffinity_Policy_between_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Anti-affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Anti-affinity
mode: hard
topology:
name: Availability
level: host
relationships:
- peer: tier1_policy_group
policy:
type: Affinity
mode: hard
topology:
name: Availability
level: host
tier1_inst_gp:
type: OS::Heat::InstanceGroup
properties:
Size: 4
AvailabilityZones: []
LaunchConfigurationName: {Ref: tier1_launchconfig}
tier2_inst_gp:
type: OS::Heat::InstanceGroup
properties:
Size: 4
AvailabilityZones: []
LaunchConfigurationName: {Ref: tier2_launchconfig}
tier1_launchconfig:
type: AWS::AutoScaling::LaunchConfiguration
properties:
ImageId: yy
InstanceType: ddn.test
NovaSchedulerHints: [{"Value": "tier1_policy_group","Key": "group_policy"}]
tier2_launchconfig:
type: AWS::AutoScaling::LaunchConfiguration
properties:
ImageId: yy
InstanceType: ddn.test
NovaSchedulerHints: [{"Value": "tier2_policy_group","Key": "group_policy"}]
© 2014 IBM Corporation
Platform Computing
26
Anti-Affinity between Resource Groups - Heat Document[[root@dc1-rack1-host1 demo]# more
./Affinity_and_AntiAffinity_Policy_between_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Anti-affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Anti-affinity
mode: hard
topology:
name: Availability
level: host
relationships:
- peer: tier1_policy_group
policy:
type: Affinity
mode: hard
topology:
name: Availability
level: host
tier1_inst_gp:
type: OS::Heat::InstanceGroup
properties:
Size: 4
AvailabilityZones: []
LaunchConfigurationName: {Ref: tier1_launchconfig}
tier2_inst_gp:
type: OS::Heat::InstanceGroup
properties:
Size: 4
AvailabilityZones: []
LaunchConfigurationName: {Ref: tier2_launchconfig}
tier1_launchconfig:
type: AWS::AutoScaling::LaunchConfiguration
properties:
ImageId: yy
InstanceType: ddn.test
NovaSchedulerHints: [{"Value": "tier1_policy_group","Key": "group_policy"}]
tier2_launchconfig:
type: AWS::AutoScaling::LaunchConfiguration
properties:
ImageId: yy
InstanceType: ddn.test
NovaSchedulerHints: [{"Value": "tier2_policy_group","Key": "group_policy"}]
tier1_policy_group:type: IBM::Policy::Groupproperties:policies:
- type: Anti-affinitymode: hardtopology:
name: Availabilitylevel: host
© 2014 IBM Corporation
Platform Computing
27
Anti-Affinity between Resource Groups - Heat Document[[root@dc1-rack1-host1 demo]# more
./Affinity_and_AntiAffinity_Policy_between_ResourceGroup.yuml
heat_template_version: 2013-05-23
description: >
This is a very simple template that illustrates the basic features
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: ddn.test
image:
type: string
default: xx
resources:
tier1_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Anti-affinity
mode: hard
topology:
name: Availability
level: host
tier2_policy_group:
type: IBM::Policy::Group
properties:
policies:
- type: Anti-affinity
mode: hard
topology:
name: Availability
level: host
relationships:
- peer: tier1_policy_group
policy:
type: Affinity
mode: hard
topology:
name: Availability
level: host
tier1_inst_gp:
type: OS::Heat::InstanceGroup
properties:
Size: 4
AvailabilityZones: []
LaunchConfigurationName: {Ref: tier1_launchconfig}
tier2_inst_gp:
type: OS::Heat::InstanceGroup
properties:
Size: 4
AvailabilityZones: []
LaunchConfigurationName: {Ref: tier2_launchconfig}
tier1_launchconfig:
type: AWS::AutoScaling::LaunchConfiguration
properties:
ImageId: yy
InstanceType: ddn.test
NovaSchedulerHints: [{"Value": "tier1_policy_group","Key": "group_policy"}]
tier2_launchconfig:
type: AWS::AutoScaling::LaunchConfiguration
properties:
ImageId: yy
InstanceType: ddn.test
NovaSchedulerHints: [{"Value": "tier2_policy_group","Key": "group_policy"}]
tier2_policy_group:type: IBM::Policy::Groupproperties:policies:
- type: Anti-affinitymode: hardtopology:
name: Availabilitylevel: host
relationships:- peer: tier1_policy_group
policy:type: Affinitymode: hardtopology:
name: Availabilitylevel: host
© 2014 IBM Corporation
Platform Computing
29
Runtime Environment• 6 hypervisors• Organized in two (2)
availability zones
host1 host2 host3 host4 host5 host6
rack1 rack2 rack3
Availability
tier1_asg
tier2_asg
tier1_asgtier1_asg tier1_asg
tier2_asg tier2_asg tier2_asg
© 2014 IBM Corporation
Platform Computing
30
Runtime Environment• 6 hypervisors• Organized in two (2)
availability zones
© 2014 IBM Corporation
Platform Computing
31
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
Runtime Environment• 6 hypervisors• Organized in two (2)
availability zones
© 2014 IBM Corporation
Platform Computing
32
Application Resiliency using Availability Zones - Heat Document
heat_template_version: 2013-05-23
description: >This is a very simple template that illustrates the basic features
parameters:
flavor:type: stringdescription: Flavor for the instances to be createddefault: ddn.test
image:type: stringdefault: xx
resources:my_policy_group:
type: IBM::Policy::Groupproperties:
policies:- type: ResourceLostPerNodeFailure
mode: hardtopology:
name: Availability-zonelevel: availability-zonepercentage: 50
- type: AntiAffinitymode: hardtopology:
name: Availability-zonelevel: host
my_asg:type: OS::Heat::AutoScalingGroupproperties:
resource:type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy: {get_resource: my_policy_group}}
min_size: 1desired_capacity: 4max_size: 10
my_asg_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: 1
my_asg_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: '-1'
© 2014 IBM Corporation
Platform Computing
33
Application Resiliency using Availability Zones - Heat Document
heat_template_version: 2013-05-23
description: >This is a very simple template that illustrates the basic features
parameters:
flavor:type: stringdescription: Flavor for the instances to be createddefault: ddn.test
image:type: stringdefault: xx
resources:my_policy_group:
type: IBM::Policy::Groupproperties:
policies:- type: ResourceLostPerNodeFailure
mode: hardtopology:
name: Availability-zonelevel: availability-zonepercentage: 50
- type: AntiAffinitymode: hardtopology:
name: Availability-zonelevel: host
my_asg:type: OS::Heat::AutoScalingGroupproperties:
resource:type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy: {get_resource: my_policy_group}}
min_size: 1desired_capacity: 4max_size: 10
my_asg_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: 1
my_asg_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: '-1'
my_policy_group:type: IBM::Policy::Groupproperties:policies:
- type: ResourceLostPerNodeFailuremode: hardtopology:
name: Availability-zonelevel: availability-zonepercentage: 50
- type: AntiAffinitymode: hardtopology:
name: Availability-zonelevel: host
© 2014 IBM Corporation
Platform Computing
34
Application Resiliency using Availability Zones - Heat Document
heat_template_version: 2013-05-23
description: >This is a very simple template that illustrates the basic features
parameters:
flavor:type: stringdescription: Flavor for the instances to be createddefault: ddn.test
image:type: stringdefault: xx
resources:my_policy_group:
type: IBM::Policy::Groupproperties:
policies:- type: ResourceLostPerNodeFailure
mode: hardtopology:
name: Availability-zonelevel: availability-zonepercentage: 50
- type: AntiAffinitymode: hardtopology:
name: Availability-zonelevel: host
my_asg:type: OS::Heat::AutoScalingGroupproperties:
resource:type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy: {get_resource: my_policy_group}}
min_size: 1desired_capacity: 4max_size: 10
my_asg_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: 1
my_asg_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: '-1'
my_asg:type: OS::Heat::AutoScalingGroupproperties:resource:
type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy:
{get_resource: my_policy_group}}min_size: 1desired_capacity: 4max_size: 10
© 2014 IBM Corporation
Platform Computing
35
Application Resiliency using Availability Zones - Heat Document
heat_template_version: 2013-05-23
description: >This is a very simple template that illustrates the basic features
parameters:
flavor:type: stringdescription: Flavor for the instances to be createddefault: ddn.test
image:type: stringdefault: xx
resources:my_policy_group:
type: IBM::Policy::Groupproperties:
policies:- type: ResourceLostPerNodeFailure
mode: hardtopology:
name: Availability-zonelevel: availability-zonepercentage: 50
- type: AntiAffinitymode: hardtopology:
name: Availability-zonelevel: host
my_asg:type: OS::Heat::AutoScalingGroupproperties:
resource:type: OS::Nova::Serverproperties:
image: { get_param: image }flavor: { get_param: flavor }scheduler_hints: {group_policy: {get_resource: my_policy_group}}
min_size: 1desired_capacity: 4max_size: 10
my_asg_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: 1
my_asg_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:
adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: '-1'
my_asg_scale_up_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: 1
my_asg_scale_down_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: my_asg}cooldown: 60scaling_adjustment: '-1'
© 2014 IBM Corporation
Platform Computing
37
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
my_asg my_asg my_asg my_asg
© 2014 IBM Corporation
Platform Computing
38
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
my_asg my_asg my_asg my_asg
© 2014 IBM Corporation
Platform Computing
39
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
my_asg my_asg my_asg my_asgmy_asg
© 2014 IBM Corporation
Platform Computing
40
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
my_asg my_asg my_asg my_asgmy_asg
© 2014 IBM Corporation
Platform Computing
41
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
my_asg my_asg my_asg my_asgmy_asg my_asg
© 2014 IBM Corporation
Platform Computing
42
host1 host2 host3 host4 host5 host6
zone1 zone2
Availability-zone
my_asg my_asg my_asg my_asgmy_asg my_asg