<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<style>
    font{
        line-height: 1.6;
    }
    ul,ol{
        padding-left: 20px;
        list-style-position: inside;
    }
</style>
<div style="font-family:微软雅黑,Verdana,"Microsoft Yahei",SimSun,sans-serif; line-height:1.6;">
    <div>
    <div>
        <span>
            <br>
        </span>
    </div>
    <div>In my all-in-one openstack, I created the first instance[1], then created the second[2].</div><div>At last I created the third[3]. <span style="line-height: 1.6;">Just one by one.</span></div><div><span style="line-height: 1.6;">Instance[1] and instance[2] are active and instance[3] is error.</span></div><div><span style="line-height: 1.6;"><br></span></div><div><span style="line-height: 1.6;">But I only have one host and use the anti-afinity policy server-group for instance[1][2]. </span></div><div><span>The code[4] is now if we specify the force_hosts or force_nodes, </span><span style="line-height: 22.4px;">scheduler </span><span>will ignore the filters.</span></div><div><span><br></span></div><div><span>So I think even we specify the force_hosts or force_nodes, </span><span style="line-height: 22.4px;">scheduler</span><span style="line-height: 22.4px;"> should evaluate the filters.</span></div><div><span style="line-height: 22.4px;">For that, I have pushed a patch to add a config[5]. </span></div><div><span><br></span></div><div><div style="color: rgb(49, 53, 59); font-family: 微软雅黑, Verdana, 'Microsoft Yahei', SimSun, sans-serif; line-height: 22.4px;">[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></div><div style="font-family: 微软雅黑, Verdana, 'Microsoft Yahei', SimSun, sans-serif; line-height: 22.4px;"><font color="#31353b">[2] </font><span style="line-height: 22.4px;"><font color="#31353b">nova boot <instance-name> --flavor <flavor> --image <image> --availability-zone <az></font><b><font color="#ff4312">:<host></font></b><font color="#31353b"> --security-groups <sec-group> --nic net-id=<net-id> --hint group=<server-group></font></span></div><div style="color: rgb(49, 53, 59); font-family: 微软雅黑, Verdana, 'Microsoft Yahei', SimSun, sans-serif; line-height: 22.4px;">[3] <span style="line-height: 22.4px;">nova boot <instance-name> --flavor <flavor> --image <image> --availability-zone <az> --security-groups <sec-group> --nic net-id=<net-id> --hint group=<server-group></span></div></div><div><span>[4] </span><a href="https://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L581-L591" _src="https://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L581-L591" style="line-height: 1.6;">https://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L581-L591</a></div><div><span>[5] </span><a href="https://review.openstack.org/#/c/641908/" _src="https://review.openstack.org/#/c/641908/" style="line-height: 1.6;">https://review.openstack.org/#/c/641908/</a></div><div><span><br></span></div><div><span>Best Regards
</span></div><div><span>Boxiang</span></div>
    <div id="ntes-pcmac-signature" style="font-family:'微软雅黑'">
        
        <div style="font-size:14px; padding: 0;  margin:0;">

        </div>
    </div>
</div><div class="J-reply" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;font-family:'微软雅黑';">
    <div style="font-size:12px;line-height:1.5;word-break:break-all;margin-left:10px;margin-right:10px">On <span class="mail-date">3/14/2019 21:29</span>,<a class="mail-to" style="text-decoration:none;color:#2a83f2;" href="mailto:mriedemos@gmail.com">Matt Riedemann<mriedemos@gmail.com></a> wrote: </div>
</div>
<blockquote id="ntes-pcmail-quote" style="margin: 0; padding: 0; font-size: 14px; font-family: '微软雅黑';">
On 3/14/2019 12:29 AM, Boxiang Zhu wrote:<br> <blockquote class="mmbqc1">My openstack all-in-one environment is setup by devstack. I created a <br> server-group with anti-affinity policy.<br> Then an instance was created with this server-group successfully with <br> command[1]. Another instance was also<br> created with this server-group and with force_host successfully with <br> command[2]. But if I did not specify the<br> force_host, the instance failed to create[3].<br> <br> I think the second instance had broken the anti-affinity server-group.<br> <br> So my question is that whether the result is within design scope or it <br> is a issue and needs to be discussed : )<br> <br> [1] nova boot <instance-name> --flavor <flavor> --image <image> <br> --availability-zone <az> --security-groups <sec-group> --nic <br> net-id=<net-id> --hint group=<server-group><br> [2] nova boot <instance-name> --flavor <flavor> --image <image> <br> --availability-zone <az>:<host> --security-groups <sec-group> --nic <br> net-id=<net-id> --hint group=<server-group><br> [3] nova boot <instance-name> --flavor <flavor> --image <image> <br> --availability-zone <az> --security-groups <sec-group> --nic <br> net-id=<net-id> --hint group=<server-group><br></blockquote><br>I assume [2] works because force_hosts is an administrative override <br>during server create. Did you create [2] after [1]? Or concurrently? It <br>does seem odd that [2] would pass the ServerGroupAntiAffinityFilter even <br>with the forced host. Seems that should be a 409 or 400 type of case.<br><br>The behavior with [3] is what I would expect, but haven't dug into the <br>code. Maybe the forced_host is overriding the requested server group?<br><br>-- <br><br>Thanks,<br><br>Matt<br></blockquote><!--😀-->
</div>
</body>
</html>