<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 27 mars 2023 à 14:28, Sean Mooney <<a href="mailto:smooney@redhat.com">smooney@redhat.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 2023-03-27 at 14:06 +0200, Sylvain Bauza wrote:<br>
> Le lun. 27 mars 2023 à 13:51, Sean Mooney <<a href="mailto:smooney@redhat.com" target="_blank">smooney@redhat.com</a>> a écrit :<br>
> <br>
> > On Mon, 2023-03-27 at 10:19 +0200, Sylvain Bauza wrote:<br>
> > > Le dim. 26 mars 2023 à 14:30, Rafael Weingärtner <<br>
> > > <a href="mailto:rafaelweingartner@gmail.com" target="_blank">rafaelweingartner@gmail.com</a>> a écrit :<br>
> > > <br>
> > > > Hello Nguyễn Hũu Khôi,<br>
> > > > You might want to take a look at:<br>
> > > > <a href="https://review.opendev.org/c/openstack/nova/+/864760" rel="noreferrer" target="_blank">https://review.opendev.org/c/openstack/nova/+/864760</a>. We created a<br>
> > patch<br>
> > > > to avoid migrating VMs to any AZ, once the VM has been bootstrapped in<br>
> > an<br>
> > > > AZ that has cross zone attache equals to false.<br>
> > > > <br>
> > > > <br>
> > > Well, I'll provide some comments in the change, but I'm afraid we can't<br>
> > > just modify the request spec like you would want.<br>
> > > <br>
> > > Anyway, if you want to discuss about it in the vPTG, just add it in the<br>
> > > etherpad and add your IRC nick so we could try to find a time where we<br>
> > > could be discussing it : <a href="https://etherpad.opendev.org/p/nova-bobcat-ptg" rel="noreferrer" target="_blank">https://etherpad.opendev.org/p/nova-bobcat-ptg</a><br>
> > > Also, this kind of behaviour modification is more a new feature than a<br>
> > > bugfix, so fwiw you should create a launchpad blueprint so we could<br>
> > better<br>
> > > see it.<br>
> > <br>
> > i tought i left review feedback on that too that the approch was not<br>
> > correct.<br>
> > i guess i did not in the end.<br>
> > <br>
> > modifying the request spec as sylvain menthioned is not correct.<br>
> > i disucssed this topic on irc a few weeks back with mohomad for vxhost.<br>
> > what can be done is as follows.<br>
> > <br>
> > we can add a current_az field to the Destination object<br>
> > <br>
> > <a href="https://github.com/openstack/nova/blob/master/nova/objects/request_spec.py#L1092-L1122" rel="noreferrer" target="_blank">https://github.com/openstack/nova/blob/master/nova/objects/request_spec.py#L1092-L1122</a><br>
> > The conductor can read the instance.AZ and populate it in that new field.<br>
> > We can then add a new weigher to prefer hosts that are in the same az.<br>
> > <br>
> > <br>
> <br>
> I tend to disagree this approach as people would think that the<br>
> Destination.az field would be related to the current AZ for an instance,<br>
> while we only look at the original AZ.<br>
> That being said, we could have a weigher that would look at whether the<br>
> host is in the same AZ than the instance.host.<br>
you miss understood what i wrote<br>
<br>
i suggested addint Destination.current_az to store teh curernt AZ of the instance before scheduling.<br>
<br>
so my proposal is if RequestSpec.AZ is not set and Destination.current_az is set then the new<br>
weigher would prefer hosts that are in the same az as Destination.current_az<br>
<br>
we coudl also call Destination.current_az Destination.prefered_az <br>
<br></blockquote><div><br></div><div>I meant, I think we don't need to provide a new field, we can already know about what host an existing instance uses if we want (using [1])</div><div>Anyway, let's stop to discuss about it here, we should rather review that for a Launchpad blueprint or more a spec.</div><div><br></div><div>-Sylvain<br></div><div><br></div><div>[1] <a href="https://github.com/openstack/nova/blob/b9a49ffb04cb5ae2d8c439361a3552296df02988/nova/scheduler/host_manager.py#L369-L370">https://github.com/openstack/nova/blob/b9a49ffb04cb5ae2d8c439361a3552296df02988/nova/scheduler/host_manager.py#L369-L370</a></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> <br>
> This will provide soft AZ affinity for the vm and preserve the fact that if<br>
> > a vm is created without sepcifying<br>
> > An AZ the expectaiton at the api level woudl be that it can migrate to any<br>
> > AZ.<br>
> > <br>
> > To provide hard AZ affintiy we could also add prefileter that would use<br>
> > the same data but instead include it in the<br>
> > placement query so that only the current AZ is considered. This would have<br>
> > to be disabled by default.<br>
> > <br>
> > <br>
> Sure, we could create a new prefilter so we could then deprecate the<br>
> AZFilter if we want.<br>
we already have an AZ prefilter and the AZFilter is deprecate for removal<br>
i ment to delete it in zed but did not have time to do it in zed of Antielope<br>
i deprecated the AZ| filter in <a href="https://github.com/openstack/nova/commit/7c7a2a142d74a7deeda2a79baf21b689fe32cd08" rel="noreferrer" target="_blank">https://github.com/openstack/nova/commit/7c7a2a142d74a7deeda2a79baf21b689fe32cd08</a><br>
xena when i enabeld the az prefilter by default.<br>
<br></blockquote><div><br></div><div>Ah whoops, indeed I forgot the fact we already have the prefilter, so the hard support for AZ is already existing.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
i will try an delete teh AZ filter before m1 if others dont.<br></blockquote><div><br></div><div>OK.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> <br>
> > That woudl allow operators to choose the desired behavior.<br>
> > curret behavior (disable weigher and dont enabel prefilter)<br>
> > new default, prefer current AZ (weigher enabeld prefilter disabled)<br>
> > hard affintiy(prefilter enabled.)<br>
> > <br>
> > there are other ways to approch this but updating the request spec is not<br>
> > one of them.<br>
> > we have to maintain the fact the enduser did not request an AZ.<br>
> > <br>
> > <br>
> Anyway, if folks want to discuss about AZs, this week is the good time :-)<br>
> <br>
> <br>
> > > <br>
> > > -Sylvain<br>
> > > <br>
> > > <br>
> > > <br>
> > > > On Sun, Mar 26, 2023 at 8:20 AM Nguyễn Hữu Khôi <<br>
> > <a href="mailto:nguyenhuukhoinw@gmail.com" target="_blank">nguyenhuukhoinw@gmail.com</a>><br>
> > > > wrote:<br>
> > > > <br>
> > > > > Hello guys.<br>
> > > > > I playing with Nova AZ and Masakari<br>
> > > > > <br>
> > > > > <a href="https://docs.openstack.org/nova/latest/admin/availability-zones.html" rel="noreferrer" target="_blank">https://docs.openstack.org/nova/latest/admin/availability-zones.html</a><br>
> > > > > <br>
> > > > > Masakari will move server by nova scheduler.<br>
> > > > > <br>
> > > > > Openstack Docs describe that:<br>
> > > > > <br>
> > > > > If the server was not created in a specific zone then it is free to<br>
> > be<br>
> > > > > moved to other zones, i.e. the AvailabilityZoneFilter<br>
> > > > > <<br>
> > <a href="https://docs.openstack.org/nova/latest/admin/scheduling.html#availabilityzonefilter" rel="noreferrer" target="_blank">https://docs.openstack.org/nova/latest/admin/scheduling.html#availabilityzonefilter</a>><br>
> > is<br>
> > > > > a no-op.<br>
> > > > > <br>
> > > > > I see that everyone usually creates instances with "Any Availability<br>
> > > > > Zone" on Horzion and also we don't specify AZ when creating<br>
> > instances by<br>
> > > > > cli.<br>
> > > > > <br>
> > > > > By this way, when we use Masakari or we miragrated instances( or<br>
> > > > > evacuate) so our instance will be moved to other zones.<br>
> > > > > <br>
> > > > > Can we attach AZ to server create requests API based on Any<br>
> > > > > Availability Zone to limit instances moved to other zones?<br>
> > > > > <br>
> > > > > Thank you. Regards<br>
> > > > > <br>
> > > > > Nguyen Huu Khoi<br>
> > > > > <br>
> > > > <br>
> > > > <br>
> > > > --<br>
> > > > Rafael Weingärtner<br>
> > > > <br>
> > <br>
> > <br>
<br>
</blockquote></div></div>