TL;DR

Nova's v2 server group API list() call returns a list of members which
includes deleted instances. Is this valid behavior? Should requestors make
the determination that these are deleted instances and act accordingly, or
is this something that changed in Nova and that Nova will fix?

The whole story:

Trove's gate has begun to fail with a very repeatable and specific pattern
where a test finds that there are left-over members in a server group and
therefore does not delete the server group. See [1].

The tests in question create a server group (anti-affinity) and add multiple
instance to it. The instances are then deleted, and the tests wait to ensure
that the instances are in fact deleted. The tests then attempt to delete the
server group. The code (in trove) that determines whether or not to delete
the server group has contained (since its creation) a check to ensure that
the group is only deleted if it is empty (has no members) or has a single
instance (the last instance being deleted).

Now however, since the server groups membership shows deleted instances,
trove's code isn't deleting the server group and our tests are failing.

This is illustrated from the CLI based example (attached).

[1] https://bugs.launchpad.net/bugs/1682845

--
Amrith Kumar
[email protected]


amrith@amrith-work:/opt/stack/trove$ openstack server group create 
affinity-policy --policy affinity
+----------+--------------------------------------+
| Field    | Value                                |
+----------+--------------------------------------+
| id       | e74ce429-9f12-48f6-a156-6222930f733e |
| members  |                                      |
| name     | affinity-policy                      |
| policies | affinity                             |
+----------+--------------------------------------+

amrith@amrith-work:/opt/stack/trove$ nova server-group-list
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+---------+----------+
| Id                                   | Name            | Project Id           
            | User Id                          | Policies      | Members | 
Metadata |
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+---------+----------+
| e74ce429-9f12-48f6-a156-6222930f733e | affinity-policy | 
a2701e81c2214285b12f86921426d12b | ac9d7a717aa34456984ad2d0c9d21255 | 
[u'affinity'] | []      | {}       |
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+---------+----------+

amrith@amrith-work:/opt/stack/trove$ nova boot --image 
2c5becd4-4d27-4567-b6c8-5d5cb984ee7b --flavor 1 --hint 
"group=e74ce429-9f12-48f6-a156-6222930f733e" instance-1

amrith@amrith-work:/opt/stack/trove$ nova boot --image 
2c5becd4-4d27-4567-b6c8-5d5cb984ee7b --flavor 1 --hint 
"group=e74ce429-9f12-48f6-a156-6222930f733e" instance-2


amrith@amrith-work:/opt/stack/trove$ nova server-group-get 
e74ce429-9f12-48f6-a156-6222930f733e                      
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+------------------------------------------------------------------------------------+----------+
| Id                                   | Name            | Project Id           
            | User Id                          | Policies      | Members        
                                                                    | Metadata |
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+------------------------------------------------------------------------------------+----------+
| e74ce429-9f12-48f6-a156-6222930f733e | affinity-policy | 
a2701e81c2214285b12f86921426d12b | ac9d7a717aa34456984ad2d0c9d21255 | 
[u'affinity'] | [u'b4d45181-030b-491d-8266-4be7f412c59a', 
u'7af84322-4d3f-4c11-9f86-a52d34f393c4'] | {}       |
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+------------------------------------------------------------------------------------+----------+

amrith@amrith-work:/opt/stack/trove$ nova list
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
+--------------------------------------+------------+--------+------------+-------------+-------------------+
| ID                                   | Name       | Status | Task State | 
Power State | Networks          |
+--------------------------------------+------------+--------+------------+-------------+-------------------+
| b4d45181-030b-491d-8266-4be7f412c59a | instance-1 | ACTIVE | -          | 
Running     | public=172.24.4.6 |
| 7af84322-4d3f-4c11-9f86-a52d34f393c4 | instance-2 | ACTIVE | -          | 
Running     | public=172.24.4.4 |
+--------------------------------------+------------+--------+------------+-------------+-------------------+
amrith@amrith-work:/opt/stack/trove$ nova delete 
b4d45181-030b-491d-8266-4be7f412c59a
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
Request to delete server b4d45181-030b-491d-8266-4be7f412c59a has been accepted.
amrith@amrith-work:/opt/stack/trove$ nova delete 
7af84322-4d3f-4c11-9f86-a52d34f393c4
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
Request to delete server 7af84322-4d3f-4c11-9f86-a52d34f393c4 has been accepted.
amrith@amrith-work:/opt/stack/trove$

amrith@amrith-work:/opt/stack/trove$ nova list
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
amrith@amrith-work:/opt/stack/trove$

amrith@amrith-work:/opt/stack/trove$ nova server-group-get 
e74ce429-9f12-48f6-a156-6222930f733e
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: 
The 'tenant_id' argument is deprecated in Ocata and its use may result in 
errors in future releases. As 'project_id' is provided, the 'tenant_id' 
argument will be ignored.
  warnings.warn(msg)
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+------------------------------------------------------------------------------------+----------+
| Id                                   | Name            | Project Id           
            | User Id                          | Policies      | Members        
                                                                    | Metadata |
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+------------------------------------------------------------------------------------+----------+
| e74ce429-9f12-48f6-a156-6222930f733e | affinity-policy | 
a2701e81c2214285b12f86921426d12b | ac9d7a717aa34456984ad2d0c9d21255 | 
[u'affinity'] | [u'b4d45181-030b-491d-8266-4be7f412c59a', 
u'7af84322-4d3f-4c11-9f86-a52d34f393c4'] | {}       |
+--------------------------------------+-----------------+----------------------------------+----------------------------------+---------------+------------------------------------------------------------------------------------+----------+
amrith@amrith-work:/opt/stack/trove$

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [email protected]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to