[nova] instance breaks the affinity/anti-affinity of server group with force_hosts or force_nodes
Boxiang Zhu
bxzhu_5355 at 163.com
Thu Mar 14 14:04:20 UTC 2019
In my all-in-one openstack, I created the first instance[1], then created the second[2].
At last I created the third[3]. Just one by one.
Instance[1] and instance[2] are active and instance[3] is error.
But I only have one host and use the anti-afinity policy server-group for instance[1][2].
The code[4] is now if we specify the force_hosts or force_nodes, scheduler will ignore the filters.
So I think even we specify the force_hosts or force_nodes, scheduler should evaluate the filters.
For that, I have pushed a patch to add a config[5].
[1] nova boot <instance-name> --flavor <flavor> --image <image> --availability-zone <az> --security-groups <sec-group> --nic net-id=<net-id> --hint group=<server-group>
[2] nova boot <instance-name> --flavor <flavor> --image <image> --availability-zone <az>:<host> --security-groups <sec-group> --nic net-id=<net-id> --hint group=<server-group>
[3] nova boot <instance-name> --flavor <flavor> --image <image> --availability-zone <az> --security-groups <sec-group> --nic net-id=<net-id> --hint group=<server-group>
[4] https://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L581-L591
[5] https://review.openstack.org/#/c/641908/
Best Regards
Boxiang
On 3/14/2019 21:29,Matt Riedemann<mriedemos at gmail.com> wrote:
On 3/14/2019 12:29 AM, Boxiang Zhu wrote:
My openstack all-in-one environment is setup by devstack. I created a
server-group with anti-affinity policy.
Then an instance was created with this server-group successfully with
command[1]. Another instance was also
created with this server-group and with force_host successfully with
command[2]. But if I did not specify the
force_host, the instance failed to create[3].
I think the second instance had broken the anti-affinity server-group.
So my question is that whether the result is within design scope or it
is a issue and needs to be discussed : )
[1] nova boot <instance-name> --flavor <flavor> --image <image>
--availability-zone <az> --security-groups <sec-group> --nic
net-id=<net-id> --hint group=<server-group>
[2] nova boot <instance-name> --flavor <flavor> --image <image>
--availability-zone <az>:<host> --security-groups <sec-group> --nic
net-id=<net-id> --hint group=<server-group>
[3] nova boot <instance-name> --flavor <flavor> --image <image>
--availability-zone <az> --security-groups <sec-group> --nic
net-id=<net-id> --hint group=<server-group>
I assume [2] works because force_hosts is an administrative override
during server create. Did you create [2] after [1]? Or concurrently? It
does seem odd that [2] would pass the ServerGroupAntiAffinityFilter even
with the forced host. Seems that should be a 409 or 400 type of case.
The behavior with [3] is what I would expect, but haven't dug into the
code. Maybe the forced_host is overriding the requested server group?
--
Thanks,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20190314/57e65269/attachment.html>
More information about the openstack-discuss
mailing list