diff options
author | tzumainn <tzumainn@redhat.com> | 2017-10-13 05:21:26 -0400 |
---|---|---|
committer | Tomas Sedovic <tomas@sedovic.cz> | 2017-10-13 11:21:26 +0200 |
commit | b450ff75888f7801094ca88957a237f33f5e85f1 (patch) | |
tree | 744495b2d7d95dcb4b487c3bb5a9b8340eff0bbd | |
parent | 2bb21a8e26cce69b9da722463a6b78860902d3e5 (diff) | |
download | openshift-b450ff75888f7801094ca88957a237f33f5e85f1.tar.gz openshift-b450ff75888f7801094ca88957a237f33f5e85f1.tar.bz2 openshift-b450ff75888f7801094ca88957a237f33f5e85f1.tar.xz openshift-b450ff75888f7801094ca88957a237f33f5e85f1.zip |
Allow the specification of server group policies when provisioning openstack (#747)
* Allow for the specifying of server policies during OpenStack provisioning
* documentation for openstack server group policies
* add doc link detailing allowed policies
* changed default to anti-affinity
6 files changed, 56 insertions, 0 deletions
diff --git a/playbooks/provisioning/openstack/README.md b/playbooks/provisioning/openstack/README.md index fe87f68f4..370f582b2 100644 --- a/playbooks/provisioning/openstack/README.md +++ b/playbooks/provisioning/openstack/README.md @@ -308,6 +308,21 @@ In order to set a custom entrypoint, update `openshift_master_cluster_public_hos Note than an empty hostname does not work, so if your domain is `openshift.example.com`, you cannot set this value to simply `openshift.example.com`. + +### Specifying server group policies + +You can specify server group policies for infra and master nodes using the following +parameters in `inventory/group_vars/all.yml`: + + ## Specify server group policies for master and infra nodes. Nova must be configured to + ## enable these policies. 'anti-affinity' will ensure that each VM is launched on a + ## different physical host. + #openstack_master_server_group_policies: [anti-affinity] + #openstack_infra_server_group_policies: [anti-affinity] + +The [Heat template documentation](https://docs.openstack.org/heat/pike/template_guide/openstack.html#OS::Nova::ServerGroup) +lists allowed policy values. + ### Creating and using a Cinder volume for the OpenShift registry You can optionally have the playbooks create a Cinder volume and set diff --git a/playbooks/provisioning/openstack/sample-inventory/group_vars/all.yml b/playbooks/provisioning/openstack/sample-inventory/group_vars/all.yml index 12f64f401..fa1fb6c64 100644 --- a/playbooks/provisioning/openstack/sample-inventory/group_vars/all.yml +++ b/playbooks/provisioning/openstack/sample-inventory/group_vars/all.yml @@ -62,6 +62,11 @@ openstack_default_flavor: "m1.medium" #docker_lb_volume_size: "5" docker_volume_size: "15" +## Specify server group policies for master and infra nodes. Nova must be configured to +## enable these policies. 'anti-affinity' will ensure that each VM is launched on a +## different physical host. +#openstack_master_server_group_policies: [anti-affinity] +#openstack_infra_server_group_policies: [anti-affinity] ## Create a Cinder volume and use it for the OpenShift registry. ## NOTE: the openstack credentials and hosted registry options must be set in OSEv3.yml! diff --git a/playbooks/provisioning/openstack/stack_params.yaml b/playbooks/provisioning/openstack/stack_params.yaml index 484c06889..a4da31bfe 100644 --- a/playbooks/provisioning/openstack/stack_params.yaml +++ b/playbooks/provisioning/openstack/stack_params.yaml @@ -36,6 +36,8 @@ num_masters: "{{ openstack_num_masters }}" num_nodes: "{{ openstack_num_nodes }}" num_infra: "{{ openstack_num_infra }}" num_dns: "{{ openstack_num_dns | default(1) }}" +master_server_group_policies: "{{ openstack_master_server_group_policies | default([]) | to_yaml }}" +infra_server_group_policies: "{{ openstack_infra_server_group_policies | default([]) | to_yaml }}" master_volume_size: "{{ docker_master_volume_size | default(docker_volume_size) }}" infra_volume_size: "{{ docker_infra_volume_size | default(docker_volume_size) }}" node_volume_size: "{{ docker_node_volume_size | default(docker_volume_size) }}" diff --git a/roles/openstack-stack/templates/heat_stack.yaml.j2 b/roles/openstack-stack/templates/heat_stack.yaml.j2 index ef46211a4..a6b088efb 100644 --- a/roles/openstack-stack/templates/heat_stack.yaml.j2 +++ b/roles/openstack-stack/templates/heat_stack.yaml.j2 @@ -536,6 +536,20 @@ resources: - interface {% endif %} +{% if master_server_group_policies|length > 0 %} + master_server_group: + type: OS::Nova::ServerGroup + properties: + name: master_server_group + policies: {{ master_server_group_policies }} +{% endif %} +{% if infra_server_group_policies|length > 0 %} + infra_server_group: + type: OS::Nova::ServerGroup + properties: + name: infra_server_group + policies: {{ infra_server_group_policies }} +{% endif %} {% if num_masters|int > 1 %} loadbalancer: type: OS::Heat::ResourceGroup @@ -643,6 +657,10 @@ resources: floating_network: {{ external_network }} {% endif %} volume_size: {{ master_volume_size }} +{% if master_server_group_policies|length > 0 %} + scheduler_hints: + group: { get_resource: master_server_group } +{% endif %} {% if not provider_network %} depends_on: - interface @@ -766,6 +784,10 @@ resources: floating_network: {{ external_network }} {% endif %} volume_size: {{ infra_volume_size }} +{% if infra_server_group_policies|length > 0 %} + scheduler_hints: + group: { get_resource: infra_server_group } +{% endif %} {% if not provider_network %} depends_on: - interface diff --git a/roles/openstack-stack/templates/heat_stack_server.yaml.j2 b/roles/openstack-stack/templates/heat_stack_server.yaml.j2 index fc797941e..66c2491a9 100644 --- a/roles/openstack-stack/templates/heat_stack_server.yaml.j2 +++ b/roles/openstack-stack/templates/heat_stack_server.yaml.j2 @@ -98,6 +98,11 @@ parameters: description: OpenShift Node Labels default: {"region": "default" } + scheduler_hints: + type: json + description: Server scheduler hints. + default: {} + outputs: name: @@ -154,6 +159,7 @@ resources: host-type: { get_param: type } sub-host-type: { get_param: subtype } node_labels: { get_param: node_labels } + scheduler_hints: { get_param: scheduler_hints } {% if use_trunk_ports|default(false)|bool %} trunk-port: diff --git a/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2 b/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2 index 2c16ad778..4b79d5ab6 100644 --- a/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2 +++ b/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2 @@ -89,6 +89,11 @@ parameters: description: OpenShift Node Labels default: {"region": "default" } + scheduler_hints: + type: json + description: Server scheduler hints. + default: {} + outputs: name: @@ -131,6 +136,7 @@ resources: host-type: { get_param: type } sub-host-type: { get_param: subtype } node_labels: { get_param: node_labels } + scheduler_hints: { get_param: scheduler_hints } {% if use_trunk_ports|default(false)|bool %} trunk-port: |