<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<base href="x-msg://1103/">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br>
<div>
<div>On Jul 11, 2012, at 11:18 AM, Day, Phil wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">
<div lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1" style="page: WordSection1; ">
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
Hi All,<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
<o:p> </o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
I’m looking at the network bandwidth code with a view to how the current framework could be made to work with libvirt, and a I have a couple of questions that hopefully someone familiar with the Xen implementation can answer:<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
<o:p> </o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; ">
<span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">         <span class="Apple-converted-space"> </span></span></span>Do the Xen counters get reset after they are read, or are the values always cumulative ?   (I’m guessing the latter
 as they seem to be just overwritten by the periodic task).<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
</div>
</div>
</div>
</span></blockquote>
<div><br>
</div>
<div>Xenserver's data is... complex to deal with. it doesn't have counters.  Basically, we can ask "how much bw has been used between time X and now."  We ask that periodically for, with time X being the start of the current audit period, and update the bw
 cache table with that.</div>
<div><br>
</div>
<br>
<blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">
<div lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1" style="page: WordSection1; ">
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
<o:p> </o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
<o:p> </o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; ">
<span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">         <span class="Apple-converted-space"> </span></span></span>It looks as if the table is intended to provide a set of values per instance_uuid/mac combination (presumably to
 have counters per NIC), but the code which updates the entries looks like it always just updates the first entry it finds for a particular uuid:<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
<o:p> </o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
        bwusage = model_query(context, models.BandwidthUsage,<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
                              session=session, read_deleted="yes").\<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
                              filter_by(start_period=start_period).\<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
                              filter_by(uuid=uuid).\<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
                             first() </div>
</div>
</div>
</span></blockquote>
<div><br>
</div>
<div>Heh. that was a bug, which was recently fixed.  Yes, we update per instance/mac combo (now)</div>
<div><br>
</div>
<br>
<blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">
<div lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1" style="page: WordSection1; ">
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
        if not bwusage:<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
            …<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
<o:p> </o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
Thanks,<o:p></o:p></div>
<div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">
Phil<o:p></o:p></div>
</div>
_______________________________________________<br>
Mailing list:<span class="Apple-converted-space"> </span><a href="https://launchpad.net/~openstack" style="color: blue; text-decoration: underline; ">https://launchpad.net/~openstack</a><br>
Post to     :<span class="Apple-converted-space"> </span><a href="mailto:openstack@lists.launchpad.net" style="color: blue; text-decoration: underline; ">openstack@lists.launchpad.net</a><br>
Unsubscribe :<span class="Apple-converted-space"> </span><a href="https://launchpad.net/~openstack" style="color: blue; text-decoration: underline; ">https://launchpad.net/~openstack</a><br>
More help   :<span class="Apple-converted-space"> </span><a href="https://help.launchpad.net/ListHelp" style="color: blue; text-decoration: underline; ">https://help.launchpad.net/ListHelp</a><br>
</div>
</span></blockquote>
</div>
<br>
<div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>
<div>--</div>
<div><span class="Apple-tab-span" style="white-space: pre; "></span>Monsyne M. Dragon</div>
<div><span class="Apple-tab-span" style="white-space: pre; "></span>OpenStack/Nova </div>
<div><span class="Apple-tab-span" style="white-space: pre; "></span>cell 210-441-0965</div>
<div><span class="Apple-tab-span" style="white-space: pre; "></span>work x 5014190</div>
</div>
</div>
</span></span></div>
<br>
</body>
</html>