SWITCH | SWITCHdrive | SWITCHengines |

Distributing redundant services with affinity

Hi team

We are working on a ha haproxy/keepalive loadbalancer. For a working ha setup, we should place the servers of the lb team on different hosts in Openstack.

I have made two different implementations, none of them seems to work:

  1. scheduler_hints: {differenthost: {getresource: haproxy_1_server}}

    haproxy_1_server:
    type: OS::Nova::Server
    properties:
    name: haproxy01
    flavor: { get_param: flavor }
    image: { get_param: image }
    key_name: { get_param: key_name }
    networks:
    - port: { get_resource: haproxy_1_port }
    scheduler_hints: {differenthost: {getresource: haproxy_2_server}}

    haproxy_2_server:
    type: OS::Nova::Server
    properties:
    name: haproxy02
    flavor: { get_param: flavor }
    image: { get_param: image }
    key_name: { get_param: key_name }
    networks:
    - port: { get_resource: haproxy_2_port }
    scheduler_hints: {differenthost: {getresource: haproxy_1_server}}

This leads to the error

Resource CREATE failed: ClientException: resources.haproxy_2_server: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. <type ‘exceptions.ValueError’> (HTTP 500) (Request-ID: req-c0f41530-f

  1. Approach with anti-affinity_group
    Define a type: OS::Nova::ServerGroup with anty-affinity policy. Use this group in server ressource:

    resources:
    my_instance:
    type: OS::Nova::Server
    properties:
    user_data_format: RAW
    image: CentOS 7 (SWITCHengines)
    flavor: m1.small
    name: { get_param: server_name }
    networks:
    - port: { get_resource: example_port }
    scheduler_hints:
    group: { get_param: affinity_group }

This throws an error like on time of stack create command in openstack heat client

ERROR: UnsupportedVersion: : resources.affinity_group: : Invalid format of client version ‘’. Expected format ‘X.Y’, where X is a major part and Y is a minor part of version.

What is the working way to go for scheduler-hints with anty-affinity in SE Openstack?
Thanks for any hints.

BR
Martin

sorry for no response for so long (we have neglected the forum too much)

I can’t give you an answer here, but if the problem persists, please create a support ticket by mailing to engines-support@switch.ch

best regards
Jens-Christian

thanks for the awesome information.