Evacuation still doesn't respect anti-affinity rules after adding late group check
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Boxiang Zhu |
Bug Description
Description
===========
When we evacuate multi servers simultaneously, it will break the anti-affinity rules of group.
Environment
===========
Prepare three nodes and deploy the multi nodes cluster with kolla-ansible.
Steps to reproduce
==================
1. we have 3 compute nodes
2. we created a server group with anti-affinity policy
=> nova server-group-create anti anti-affinity
3. we create 2 servers with this server group
=> nova boot --image cirros --flavor m1.tiny --nic net-id=
=> nova boot --image cirros --flavor m1.tiny --nic net-id=
4. we stop nova-compute service on the nodes where 2 VMs are running
=> nova show vm01 | grep "hypervisor"
=> nova show vm02 | grep "hypervisor"
=> docker stop nova_compute[on two compute nodes]
5. we evacuate 2 VMs at once
=> nova evacuate vm01
=> nova evacuate vm02
6. we check where 2 VMs are running now
=> nova show vm01 | grep "hypervisor"
=> nova show vm02 | grep "hypervisor"
Expected result
===============
1. both of them failed to evacuate
2. one of them succeeded to evacuate to the last node, and another failed to evacuate
Actual result
=============
1. both of them succeeded to evacuate to the last node
Changed in nova: | |
assignee: | nobody → Boxiang Zhu (bxzhu-5355) |
status: | New → In Progress |
A same bug is found here https:/ /bugs.launchpad .net/mos/ +bug/1735407. /review. openstack. org/#/c/ 525242/
It has been set 'Fix Released'. And you can find the patch here https:/
But in fact, after I test the evacuation now, but in fact it does not meet our requirement which still breaks the anti-affinity policy of group after it does late group check now.
Some codes as followed: InstanceList. get_uuids_ by_host( uuids) uuid])
instances_uuids = objects.
context, self.host)
ins_on_host = set(instances_
members = set(group.members)
# Determine the set of instance group members on this host
# which are not the instance in question. This is used to
# determine how many other members from the same anti-affinity
# group can be on this host.
members_on_host = ins_on_host & members - set([instance.
We only check the instances which are on host now. But if we simultaneously evacuate 2 instances, they will both get '[]' of 'members_on_host'.
So that we must check the migrations when we do late group check if the action is move operation.