Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1480338

Summary: [RFE] Add soft policy for nova server group
Product: Red Hat OpenStack Reporter: Jeremy <jmelvin>
Component: openstack-heatAssignee: Zane Bitter <zbitter>
Status: CLOSED ERRATA QA Contact: Ronnie Rasouli <rrasouli>
Severity: high Docs Contact:
Priority: medium    
Version: 10.0 (Newton)CC: aarapov, aarrichi, apannu, augol, dhill, jwaterwo, lmiccini, lruzicka, mburns, ramishra, rhel-osp-director-maint, rpolli, sbaker, shardy, srevivo, therve, zbitter
Target Milestone: z6Keywords: FutureFeature, RFE, Triaged, ZStream
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-heat-7.0.5-3.el7ost Doc Type: Enhancement
Doc Text:
With this update, the OS::Nova::ServerGroup resource now allows the 'soft-affinity' and 'soft-anti-affinity' policies to be used in addition to the 'affinity' and 'anti-affinity' policies.
Story Points: ---
Clone Of:
: 1498108 (view as bug list) Environment:
Last Closed: 2017-11-15 13:44:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1498108, 1525936    

Description Jeremy 2017-08-10 19:08:27 UTC
Description of problem:

Add soft-anti-affinity and soft-affinity policy for nova server
group resource.


###Upstream commit

https://github.com/openstack/heat/commit/219bb0c8e958c0cce16ad2ac3e224fbdedf56678

###nova side bugzilla:

(soft-affinity-for-server-group) 
https://bugzilla.redhat.com/show_bug.cgi?id=1093244

Comment 3 Roberto Polli 2017-09-06 10:03:11 UTC
Without this bug closed:

- it is impossible to scale a ServerGroup with anti-affinity to more than the number of compute node
- in case of large compute nodes it could be really annoying



## Example 1

I have:

- 6 compute nodes
- an AutoScalingGroup
- a ServerGroup with anti-affinity policy 

Then:

- I cannot create a stack with more than 6 vms


## Example 2 

I have Example 1 and

- one node is in maintenance 
- other nodes have enough capacity
- a stack with 4vm

Then:

- autoscaling will fail 


## Example 3

Using Availability Zones and further placement restrictions limits even more the virtual infrastructure size.



## Example 4

I have Example 1 and:

- I want to change the anti-affinity policy to soft-anti-affinity (eg with stack update, in future, or via cli)

But:

- ServerGroup.anti-affinity policy is unmodifiable, I should create a new ServerGroup
- Creating a new ServerGroup and causes  OS::Nova::Server replacement.


This keeps from using the anti-affinity policy at all in many cases where it's actually needed (see the OpenShift on OpenStack discussion
- https://github.com/redhat-openstack/openshift-on-openstack/issues/82#issuecomment-209807848 )

Comment 13 Ronnie Rasouli 2017-11-06 08:43:06 UTC
 nova server-group-create gr-anti anti-affinity
+--------------------------------------+---------+----------------------------------+----------------------------------+--------------------+---------+----------+
| Id                                   | Name    | Project Id                       | User Id                          | Policies           | Members | Metadata |
+--------------------------------------+---------+----------------------------------+----------------------------------+--------------------+---------+----------+
| 72ec2dd1-9248-49c5-9c09-e6d9b06894fe | gr-anti | 912e382417194f7b90b32d01fb1d2131 | b5f1ed63d315454ab086b21c5cb97afc | [u'anti-affinity'] | []      | {}       |
+--------------------------------------+---------+----------------------------------+----------------------------------+--------------------+---------+----------+

Comment 14 Ronnie Rasouli 2017-11-06 12:43:33 UTC
Using heat template for server group works as well
heat_template_version: 2016-04-08
description: Template to test rbac-policy Neutron resource
resources:
  nova:
    type: OS::Nova::ServerGroup 
    properties:
      name: qr-name
      policies: [soft-anti-affinity]

nova server-group-list
+--------------------------------------+---------+----------------------------------+----------------------------------+-------------------------+---------+----------+
| Id                                   | Name    | Project Id                       | User Id                          | Policies                | Members | Metadata |
+--------------------------------------+---------+----------------------------------+----------------------------------+-------------------------+---------+----------+
| fadbcdd9-3da8-466d-8843-b362f6761486 | qr-name | 115502acdc5f49f3a32a2f49edbadc2a | 567d3d2820eb41738c56968e10a43c7b | [u'soft-anti-affinity'] | []      | {}       |
+--------------------------------------+---------+----------------------------------+----------------------------------+-------------------------+---------+----------+

Comment 16 errata-xmlrpc 2017-11-15 13:44:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:3232

Comment 17 Rabi Mishra 2017-11-21 09:14:16 UTC
*** Bug 1447798 has been marked as a duplicate of this bug. ***