<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 29 mars 2023 à 08:06, Nguyễn Hữu Khôi <<a href="mailto:nguyenhuukhoinw@gmail.com">nguyenhuukhoinw@gmail.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"><div dir="ltr">Hello.<div>I have one question.</div><div>Follow this </div><div><br></div><div><a href="https://docs.openstack.org/nova/latest/admin/availability-zones.html" target="_blank">https://docs.openstack.org/nova/latest/admin/availability-zones.html</a><br></div><div><br></div><div><span style="color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px">If the server was not created in a specific zone then it is free to be moved to other zones. but when I use </span><br></div><div><span style="color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px"><br></span></div><div>openstack server show [server id]<span style="color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px"><br></span></div><div><br></div><div>I still see the "OS-EXT-AZ:availability_zone" value belonging to my instance.</div><div><br></div></div></blockquote><div><br></div><div>Correct, this is normal. If the operators creates some AZs, then the enduser should see where the instance in which AZ.</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"><div dir="ltr"><div></div><div><span style="color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px">Could you tell the difference which causes "</span><span style="color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px">if the server was not created in a specific zone then it is free to be moved to other zones.</span><span style="color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px">"</span></div><div><br clear="all"></div></div></blockquote><div><br></div><div>To be clear, an operator can create Availability Zones. Those AZs can then be seen by an enduser using the os-availability-zones API [1]. Then, either the enduser wants to use a specific AZ for their next instance creation (and if so, he/she adds --availability-zone parameter to their instance creation client) or they don't want and then they don't provide this parameter.</div><div><br></div><div>If they provide this parameter, then the server will be created only in one host in the specific AZ and then when moving the instance later, it will continue to move to any host within the same AZ.</div><div>If they *don't* provide this parameter, then depending on the default_schedule_zone config option, either the instance will eventually use a specific AZ (and then it's like if the enduser was asking for this AZ), or none of AZ is requested and then the instance can be created and moved between any hosts within *all* AZs.</div><div><br></div><div>That being said, as I said earlier, the enduser can still verify the AZ from where the instance is by the server show parameter you told.<br></div><div><br></div><div>We also have a documentation explaining about Availability Zones, maybe this would help you more to understand about AZs : <a href="https://docs.openstack.org/nova/latest/admin/availability-zones.html">https://docs.openstack.org/nova/latest/admin/availability-zones.html</a></div><div><br></div><div></div><div><br></div><div>[1] <a href="https://docs.openstack.org/api-ref/compute/#availability-zones-os-availability-zone">https://docs.openstack.org/api-ref/compute/#availability-zones-os-availability-zone</a> (tbc, the enduser won't see the hosts, but they can see the list of existing AZs)<br></div><div><br></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"><div dir="ltr"><div><div><div dir="ltr"><div dir="ltr">Nguyen Huu Khoi<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 27, 2023 at 8:37 PM Nguyễn Hữu Khôi <<a href="mailto:nguyenhuukhoinw@gmail.com" target="_blank">nguyenhuukhoinw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello guys.</div><div><br></div><div>I just suggest to openstack nova works better. My story because </div><div><br></div><ol style="box-sizing:border-box;margin-top:0px;margin-bottom:10px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin:0px 0px 10px">The server was created in a specific zone with the <code style="box-sizing:border-box;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;padding:0px;color:rgb(0,0,0);background-color:transparent;border-radius:0px;font-weight:bold"><span style="box-sizing:border-box;font-family:"Courier New",Courier,monospace">POST</span> <span style="box-sizing:border-box;font-family:"Courier New",Courier,monospace">/servers</span></code> request containing the <code style="box-sizing:border-box;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;padding:0px;color:rgb(0,0,0);background-color:transparent;border-radius:0px;font-weight:bold"><span style="box-sizing:border-box;font-family:"Courier New",Courier,monospace">availability_zone</span></code> parameter.</p></li></ol><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px">It will be nice when we attach randow zone when we create instances then It will only move to the same zone when migrating or masakari ha.</span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px">Currently we can force it to zone by default zone shedule in nova.conf.</span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px">Sorry because I am new to Openstack and I am just an operator. I try to verify some real cases. </span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px"> </span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif" color="#333333"><span style="font-size:14px"><br></span></font></div><div><div dir="ltr"><div dir="ltr">Nguyen Huu Khoi<br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 27, 2023 at 7:43 PM Sylvain Bauza <<a href="mailto:sbauza@redhat.com" target="_blank">sbauza@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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" target="_blank">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" target="_blank">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>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>