<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: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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">I recently experienced failures getting images from Glance while spawning instances. This step comes after building the networks in the guild sequence. When the Glance failure occurred
 the instance was cleaned up and rescheduled as expected, but the networks were not cleaned up. On investigation I found that the cleanup code for the networks is in the compute manager’s _<i>do_build_run</i>_instance() method as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">            # NOTE(comstud): Deallocate networks if the driver wants<br>
            # us to do so.<br>
            if self.driver.deallocate_networks_on_reschedule(instance):<br>
                self._cleanup_allocated_networks(context, instance,<br>
                        requested_networks)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">The default behavior in for the deallocate_networks_on_schedule() method defined in ComputeDriver is:<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">    def deallocate_networks_on_reschedule(self, instance):<br>
        """Does the driver want networks deallocated on reschedule?"""<br>
        return False<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">Only the Ironic driver over rides this method to return True, so I think this means the networks will not be cleaned up for any other virt driver.<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333"><o:p> </o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">Is this really the desired behavior?<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333"><o:p> </o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">I have filed a bug for this and plan to fix it:
<a href="https://bugs.launchpad.net/nova/+bug/1410739">https://bugs.launchpad.net/nova/+bug/1410739</a>
<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333"><o:p> </o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">My initial thought is to fix this either by making the method in the base class return True or by adding the method to virt drivers returning True (I would expect the former). But I wanted
 to check if there is a reason for the base class behavior (and so the default behavior) to be *<b>NOT</b>* to clean up the networks?<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333"><o:p> </o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:9.6pt;margin-left:0cm;line-height:13.5pt;background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:#333333">Paul<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">Paul Murray<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">Nova Technical Lead, HP Cloud<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">+44 117 316 2527<br>
<br>
Hewlett-Packard Limited registered Office: Cain Road, Bracknell, Berks RG12 1HN Registered No: 690597 England. The contents of this message and any attachments to it are confidential and may be legally privileged. If you have received this message in error,
 you should delete it from your system immediately and advise the sender. To any recipient of this message within HP, unless otherwise stated you should consider this message and attachments as "HP CONFIDENTIAL".</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>