<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><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;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",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;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
samp
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Cambria",serif;
        color:#1F497D;}
.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></head><body lang="EN-US" link="blue" vlink="purple"><div class="WordSection1"><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Cambria",serif;color:#1f497d">I’ve also seen the request multiple times to be able to provide more targeted snapshots which might also (partially) solve this problem as it would require significantly less disk space to grab logs from a subset of nodes for a specific window of time, instead of the more robust grab-all solution we have now. </span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Cambria",serif;color:#1f497d"> </span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Maciej Kwiek [mailto:<a href="mailto:mkwiek@mirantis.com">mkwiek@mirantis.com</a>] <br><b>Sent:</b> Thursday, January 14, 2016 5:59 AM<br><b>To:</b> OpenStack Development Mailing List (not for usage questions) <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br><b>Subject:</b> Re: [openstack-dev] [Fuel] Diagnostic snapshot generation is broken due to lack of disk space</span></p><p class="MsoNormal"> </p><div><div><p class="MsoNormal">Igor,</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">I will investigate this, thanks!</p></div><div><p class="MsoNormal"> </p></div><p class="MsoNormal">Artem,</p><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">I guess that if we have an untrusted user on master node, he could just put something he wants to be in the snapshot in /var/log without having to time the attack carefully with tar execution.</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">I want to use links for directories, this saves me the trouble of creating hardlinks for every single file in the directory. Although with how exclusion is currently implemented it can cause deleting log files from original directories, need to check this out.</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">About your PS: whole /var/log on master node (not in container) is currently downloaded, I think we shouldn't change this as we plan to drop containers in 9.0.</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Cheers,</p></div><div><p class="MsoNormal">Maciej</p></div></div><div><p class="MsoNormal"> </p><div><p class="MsoNormal">On Thu, Jan 14, 2016 at 12:32 PM, Artem Panchenko <<a href="mailto:apanchenko@mirantis.com" target="_blank">apanchenko@mirantis.com</a>> wrote:</p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><p class="MsoNormal">Hi,<br><br>using symlinks is a bit dangerous, here is a quote from the man you mentioned [0]:<br><br>> <span style="font-size:13.5pt;color:black;background:white">The </span><samp><span style="color:black;background:white">`--dereference'</span></samp><span style="font-size:13.5pt;color:black;background:white"> option is unsafe if an untrusted user can modify directories while </span><code><span style="font-size:10.0pt;color:black;background:white">tar</span></code><span style="font-size:13.5pt;color:black;background:white"> is running.<br></span><br>Hard links usage is much safer, because you can't use them for directories. But at the same time implementation in shotgun would be more complicated than with symlinks.<br><br>Anyway, in order to determine what linking to use we need to decide where (/var/log or another partition) diagnostic snapshot will be stored.  <br><br>p.s.</p><pre>>This doesn't really give us much right now, because most of the logs are fetched from master node via ssh due to shotgun being run in mcollective container</pre><pre> </pre><p class="MsoNormal">AFAIK '/var/log/docker-logs/' is available from mcollective container and mounted to /var/log/:<br><br>[root@fuel-lab-cz5557 ~]# dockerctl shell mcollective mount -l | grep os-varlog<br>/dev/mapper/os-varlog on /var/log type ext4 (rw,relatime,stripe=128,data=ordered)<br><br>From my experience '/var/log/docker-logs/remote' folder is most ' <span style="font-family:"Arial",sans-serif;color:#222222;background:white">heavy</span>' thing in snapshot.<br><br>[0] <a href="http://www.gnu.org/software/tar/manual/html_node/dereference.html" target="_blank">http://www.gnu.org/software/tar/manual/html_node/dereference.html</a><br><br>Thanks!</p><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"> </p><div><p class="MsoNormal">On 14.01.16 13:00, Igor Kalnitsky wrote:</p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>I took a glance on Maciej's patch and it adds a switch to tar command</pre><pre>to make it follow symbolic links</pre></blockquote><pre>Yeah, that should work. Except one thing - we previously had fqdn -></pre><pre>ipaddr links in snapshots. So now they will be resolved into full</pre><pre>copy?</pre><pre> </pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>I meant that symlinks also give us the benefit of not using additional</pre><pre>space (just as hardlinks do) while being able to link to files from</pre><pre>different filesystems.</pre></blockquote><pre>I'm sorry, I got you wrong. :)</pre><pre> </pre><pre>- Igor</pre><pre> </pre><pre>On Thu, Jan 14, 2016 at 12:34 PM, Maciej Kwiek <a href="mailto:mkwiek@mirantis.com" target="_blank"><mkwiek@mirantis.com></a> wrote:</pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>Igor,</pre><pre> </pre><pre>I meant that symlinks also give us the benefit of not using additional space</pre><pre>(just as hardlinks do) while being able to link to files from different</pre><pre>filesystems.</pre><pre> </pre><pre>Also, as Barłomiej pointed out the `h` switch for tar should do the trick</pre><pre>[1].</pre><pre> </pre><pre>Cheers,</pre><pre>Maciej</pre><pre> </pre><pre>[1] <a href="http://www.gnu.org/software/tar/manual/html_node/dereference.html" target="_blank">http://www.gnu.org/software/tar/manual/html_node/dereference.html</a></pre><pre> </pre><pre>On Thu, Jan 14, 2016 at 11:22 AM, Bartlomiej Piotrowski</pre><pre><a href="mailto:bpiotrowski@mirantis.com" target="_blank"><bpiotrowski@mirantis.com></a> wrote:</pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>Igor,</pre><pre> </pre><pre>I took a glance on Maciej's patch and it adds a switch to tar command to</pre><pre>make it follow symbolic links, so it looks good to me.</pre><pre> </pre><pre>Bartłomiej</pre><pre> </pre><pre>On Thu, Jan 14, 2016 at 10:39 AM, Igor Kalnitsky <a href="mailto:ikalnitsky@mirantis.com" target="_blank"><ikalnitsky@mirantis.com></a></pre><pre>wrote:</pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>Hey Maceij -</pre><pre> </pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>About hardlinks - wouldn't it be better to use symlinks?</pre><pre>This way we don't occupy more space than necessary</pre></blockquote><pre>AFAIK, hardlinks won't occupy much space. They are the links, after all.</pre><pre>:)</pre><pre> </pre><pre>As for symlinks, I'm afraid shotgun (and fabric underneath) won't</pre><pre>resolve them and links are get to snapshot As Is. That means if there</pre><pre>will be no content in the snapshot they are pointing to, they are</pre><pre>simply useless. Needs to be checked, though.</pre><pre> </pre><pre>- Igor</pre><pre> </pre><pre>On Thu, Jan 14, 2016 at 10:31 AM, Maciej Kwiek <a href="mailto:mkwiek@mirantis.com" target="_blank"><mkwiek@mirantis.com></a></pre><pre>wrote:</pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>Thanks for your insight guys!</pre><pre> </pre><pre>I agree with Oleg, I will see what I can do to make this work this way.</pre><pre> </pre><pre>About hardlinks - wouldn't it be better to use symlinks? This way we</pre><pre>don't</pre><pre>occupy more space than necessary, and we can link to files and</pre><pre>directories</pre><pre>that are in other block device than /var. Please see [1] review for a</pre><pre>proposed change that introduces symlinks.</pre><pre> </pre><pre>This doesn't really give us much right now, because most of the logs</pre><pre>are</pre><pre>fetched from master node via ssh due to shotgun being run in</pre><pre>mcollective</pre><pre>container, but it's something! When we remove containers, this will</pre><pre>prove</pre><pre>more useful.</pre><pre> </pre><pre>Regards,</pre><pre>Maciej Kwiek</pre><pre> </pre><pre>[1] <a href="https://review.openstack.org/#/c/266964/" target="_blank">https://review.openstack.org/#/c/266964/</a></pre><pre> </pre><pre>On Tue, Jan 12, 2016 at 1:51 PM, Oleg Gelbukh <a href="mailto:ogelbukh@mirantis.com" target="_blank"><ogelbukh@mirantis.com></a></pre><pre>wrote:</pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>I think we need to find a way to:</pre><pre> </pre><pre>1) verify the size of snapshot without actually making it and compare</pre><pre>to</pre><pre>the available disk space beforehand.</pre><pre>2) refuse to create snapshot if space is insufficient and notify user</pre><pre>(otherwise it breaks Admin node as we have seen)</pre><pre>3) provide a way to prioritize elements of the snapshot and exclude</pre><pre>them</pre><pre>based on the priorities or user choice.</pre><pre> </pre><pre>This will allow for better and safer UX with the snapshot.</pre><pre> </pre><pre>--</pre><pre>Best regards,</pre><pre>Oleg Gelbukh</pre><pre> </pre><pre>On Tue, Jan 12, 2016 at 1:47 PM, Maciej Kwiek <a href="mailto:mkwiek@mirantis.com" target="_blank"><mkwiek@mirantis.com></a></pre><pre>wrote:</pre><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>Hi!</pre><pre> </pre><pre>I need some advice on how to tackle this issue. There is a bug [1]</pre><pre>describing the problem with creating a diagnostic snapshot. The issue</pre><pre>is</pre><pre>that /var/log has 100GB available, while /var (where diagnostic</pre><pre>snapshot is</pre><pre>being generated - /var/www/nailgun/dump/fuel-snapshot according to</pre><pre>[2]) has</pre><pre>10GB available, so dumping the logs can be an issue when logs size</pre><pre>exceed</pre><pre>free space in /var.</pre><pre> </pre><pre>There are several things we could do, but I am unsure on which course</pre><pre>to</pre><pre>take. Should we</pre><pre>a) Allocate more disk space for /var/www (or for whole /var)?</pre><pre>b) Make the snapshot location share the diskspace of /var/log?</pre><pre>c) Something else? What?</pre><pre> </pre><pre>Please share your thoughts on this.</pre><pre> </pre><pre>Cheers,</pre><pre>Maciej Kwiek</pre><pre> </pre><pre>[1] <a href="https://bugs.launchpad.net/fuel/+bug/1529182" target="_blank">https://bugs.launchpad.net/fuel/+bug/1529182</a></pre><pre>[2]</pre><pre> </pre><pre><a href="https://github.com/openstack/fuel-web/blob/2855a9ba925c146b4802ab3cd2185f1dce2d8a6a/nailgun/nailgun/settings.yaml#L717" target="_blank">https://github.com/openstack/fuel-web/blob/2855a9ba925c146b4802ab3cd2185f1dce2d8a6a/nailgun/nailgun/settings.yaml#L717</a></pre><pre> </pre><pre> </pre><pre> </pre><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe:</pre><pre><a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre><pre> </pre></blockquote><pre> </pre><pre> </pre><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe:</pre><pre><a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre><pre> </pre></blockquote><pre> </pre><pre> </pre><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe:</pre><pre><a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre><pre> </pre></blockquote><pre> </pre><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe:</pre><pre><a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre></blockquote><pre> </pre><pre> </pre><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre><pre> </pre></blockquote><pre> </pre><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre><pre> </pre></blockquote><pre>__________________________________________________________________________</pre><pre>OpenStack Development Mailing List (not for usage questions)</pre><pre>Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a></pre><pre><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre></blockquote><p class="MsoNormal"> </p></div></div><pre>-- </pre><pre>Artem Panchenko</pre><pre>QA Engineer</pre></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>__________________________________________________________________________<br>OpenStack Development Mailing List (not for usage questions)<br>Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></p></blockquote></div><p class="MsoNormal"> </p></div></div></body></html>