<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As of now in the current master AggregateImagePropertiesIsolation filter returns True even if image property is not present in the host aggregate metadata.<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Example:<o:p></o:p></p>
<p class="MsoNormal">(1) Set below required config options in nova.conf under 'filter_scheduler' section:<o:p></o:p></p>
<p class="MsoNormal">aggregate_image_properties_isolation_namespace is set to 'os'<o:p></o:p></p>
<p class="MsoNormal">aggregate_image_properties_isolation_separator is set to '_'<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">1) add Host Aggregate with custom metadata "os_windows":<o:p></o:p></p>
<p class="MsoNormal">+----+-----------+-------------------+--------------+------------------------+<o:p></o:p></p>
<p class="MsoNormal">| Id | Name      | Availability Zone | Hosts        | Metadata               |<o:p></o:p></p>
<p class="MsoNormal">+----+-----------+-------------------+--------------+------------------------+<o:p></o:p></p>
<p class="MsoNormal">| 1  | win-agg   | -                 | 'controller'    | 'os_type=os_windows'   |<o:p></o:p></p>
<p class="MsoNormal">+----+-----------+-------------------+--------------+------------------------+<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">2) Add AggregateImagePropertiesIsolation filter to 'scheduler_default_filters'<o:p></o:p></p>
<p class="MsoNormal">scheduler_default_filters = RetryFilter,AggregateImagePropertiesIsolation,AvailabilityZoneFilter,RamFilter,DiskFilter,ComputeFilter,...<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Scenario A: Image property is present in the host aggregate metadata<o:p></o:p></p>
<p class="MsoNormal">(a) Create image with property os_type=os_windows<o:p></o:p></p>
<p class="MsoNormal">(b) Boot VM using image created in point 1.<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">In this case, 'AggregateImagePropertiesIsolation' will return True and instance will be successfully created in host present in aggregate 'win-aggregate'.<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Scenario B: Image property is not present in the host aggregate metadata<o:p></o:p></p>
<p class="MsoNormal">(a) Create image with property os=rhel<o:p></o:p></p>
<p class="MsoNormal">(b) Boot VM using image created in point 1.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In this case, AggregateImagePropertiesIsolation shouldn't select any host from "win-aggregate" host aggregate group as it doesn't contains 'os_type=os_rhel". But as per the current implementation [1], it is checking if image property key
 "os_type" is present or not. Even if it's not there, it is returning True from this filter, thus allowing to boot instance on the host from "win-aggregate" host aggregate group.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So the question here is, what is the exact goal of AggregateImagePropertiesIsolation' scheduler filter: - Is it one of the following:-<o:p></o:p></p>
<p class="MsoNormal">1. Matching all metadata of host aggregate with image properties.<o:p></o:p></p>
<p class="MsoNormal">2. Matching image properties with host aggregate metadata.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If we decide that actual goal of 'AggregateImagePropertiesIsolation' filter is as  pointed in #1, then a small correction is required to return False if image property is not present from the host aggregate metadata.<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Please let me know your opinion about the same.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[1] https://github.com/openstack/nova/blob/master/nova/scheduler/filters/aggregate_image_properties_isolation.py#L53<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Abhishek Kekane<o:p></o:p></p>
</div>
<br clear="both">
______________________________________________________________________<BR>
Disclaimer: This email and any attachments are sent in strictest confidence<BR>
for the sole use of the addressee and may contain legally privileged,<BR>
confidential, and proprietary data. If you are not the intended recipient,<BR>
please advise the sender by replying promptly to this email and then delete<BR>
and destroy this email and any attachments without any further use, copying<BR>
or forwarding.<BR>
</body>
</html>