{"id":7983,"date":"2019-03-20T11:20:12","date_gmt":"2019-03-20T01:20:12","guid":{"rendered":"https:\/\/nsrd.info\/blog\/?p=7983"},"modified":"2019-03-20T11:20:20","modified_gmt":"2019-03-20T01:20:20","slug":"basics-determining-pss-saveset-dependencies","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2019\/03\/20\/basics-determining-pss-saveset-dependencies\/","title":{"rendered":"Basics \u2013\u00a0Determining PSS Saveset Dependencies"},"content":{"rendered":"\n<p>A question I&#8217;ve been asked a few times is <em>&#8220;how do we use mminfo to determine dependencies between PSS savesets?&#8221;<\/em><\/p>\n\n\n\n<p>When we do a Parallel Save Stream (PSS) saveset, NetWorker breaks down the saveset into multiple streams and names them using the old method used back in NetWorker v5.x\/etc. days for continuation savesets. Back in those days, NetWorker used a cut-off limit of 2GB when writing a saveset, so if you needed to backup a 5GB filesystem called &#8216;\/home&#8217;, you&#8217;d get saveset names of:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/home<br>&lt;1&gt;\/home<br>&lt;2&gt;\/home<br><\/pre>\n\n\n\n<p>Now, we don&#8217;t need to do those continuation savesets any more, so the nomenclature gets used for identifying PSS savesets. If you go to recover from a PSS backup, NetWorker automatically uses the various PSS savesets that were generated, and it handles recycling them appropriately \u2013&nbsp;i.e., it doesn&#8217;t think that \/home and &lt;1&gt;\/home are different savesets, as such.<\/p>\n\n\n\n<p>But how?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"674\" src=\"https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2018\/11\/img_0221.jpg\" alt=\"\" class=\"wp-image-7244\" srcset=\"https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2018\/11\/img_0221.jpg 900w, https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2018\/11\/img_0221-300x225.jpg 300w, https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2018\/11\/img_0221-768x575.jpg 768w, https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2018\/11\/img_0221-267x200.jpg 267w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><figcaption>Taking a closer look at PSS details using <strong>mminfo<\/strong><\/figcaption><\/figure>\n\n\n\n<p>My first thought when I was asked this was that given we were using continuation saveset nomenclature, it would be as easy as chaining via a &#8220;pssid&#8221; option in mminfo. However, that&#8217;s not the case, so I did some more digging and found out how we get this information out of mminfo. (Thanks, Matt, Kumar, Pavan!)<\/p>\n\n\n\n<p>So, let&#8217;s start with an example of a PSS backup I generate in my lab of a saveset, &#8220;<strong>\/Volumes\/Documents\/Alteran<\/strong>&#8221; on the host <strong>rama<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>mminfo -q \"client=rama.turbamentis.int,name=\/Volumes\/Alteran\/Documents,level=full,savetime&gt;=3 weeks ago\"<\/strong><br>  volume        client       date      size   level  name<br> Backup.03      rama.turbamentis.int 03\/03\/19 515 GB full \/Volumes\/Alteran\/Documents<br><\/pre>\n\n\n\n<p>That&#8217;s our starting point. The next thing is to work out what the saveset ID is so we can do a bit more digging, so our query becomes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>mminfo -q \"client=rama.turbamentis.int,name=\/Volumes\/Alteran\/Documents,level=full,savetime&gt;=3 weeks ago\" -r ssid<\/strong><br> 3178921591<br><\/pre>\n\n\n\n<p>The saveset ID helps here because we&#8217;re going to use the &#8220;super verbose mode&#8221; option in mminfo, -S. Now you&#8217;ll note I&#8217;m deliberately querying based on the core saveset name. This is effectively the &#8216;parent&#8217; for the saveset. So, my new query based on saveset ID and focusing on the super verbose output is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>mminfo -S -q \"ssid=3178921591\"<\/strong><br> ssid=3178921591 savetime=03\/03\/19 00:00:35 (1551531635) rama.turbamentis.int:\/Volumes\/Alteran\/Documents<br>   level=full   sflags=vF       size=528098212924 files=10282      insert=03\/03\/19<br>   create=03\/03\/19 complete=03\/03\/19 browse=03\/04\/19 23:59:59 retent=03\/04\/19 23:59:59<br>   clientid=c7237fcb-00000004-58eb5ef3-58eb5ef2-00375000-9f778f56<br>           *backup start time: 1551531632;<br>     *mbs anchor saveset time: 1551531632;<br><em>              *mbs dependents: \\<br> 4d303631-00000006-be7a7e75-5c7a7e75-01435000-9f778f56, <br> 0142dba6-00000006-bf7a7e75-5c7a7e75-01425000-9f778f56, <br> 5d1f8601-00000006-c07a7e75-5c7a7e75-01415000-9f778f56;<\/em><br>         *policy action jobid: 1729123;<br>          *policy action name: \"backup: 1551531635\";<br>                 *policy name: \"Platinum: 1551531635\";<br>        *policy workflow name: \"Documents: 1551531635\";<br>                        group: Platinum_Documents;<br>             saveset features: CLIENT_SAVETIME;<br>   Clone #1: cloneid=1551531635  time=03\/03\/19 00:00:35    retent=03\/04\/19  flags=<br>     frag@         0 volid=3844106399 file\/rec=       0\/0     rn=0 last=03\/03\/19<br><\/pre>\n\n\n\n<p>I&#8217;ve italicised the output you want to look for in this scenario: you&#8217;ll see a section of the output called &#8220;mbs dependents&#8221; &#8211; these are the &lt;x&gt;Name savesets that are associated with the core saveset we queries from. If you&#8217;re not familiar with that lengthy hexadecimal string format, it&#8217;s what we refer to as the &#8220;long SSID&#8221;; in actual fact, you can get the long SSID for any saveset just by giving a length attribute to the ssid output field:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>mminfo -q \"client=rama.turbamentis.int,name=\/Volumes\/Alteran\/Documents,level=full,savetime&gt;=3 weeks ago\" -r \"ssid,ssid(53)\"<\/strong><br>  ssid      ssid<br> 3178921591 79eeaeec-00000006-bd7a7e77-5c7a7e77-01445000-9f778f56<br><\/pre>\n\n\n\n<p>The long SSID is useful not only in this case for us to do the tracing of dependent saveset sections, but also if you&#8217;re using an advanced file type device, you&#8217;ll actually <em>find<\/em> the saveset on disk using that filename.<\/p>\n\n\n\n<p>You can also query based on the long SSID as well, so in this case now I&#8217;ve got the details of the &#8216;mbs dependents&#8217;, I can query any one of those to find out their specific details as follows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>mminfo -S -q \"ssid=4d303631-00000006-be7a7e75-5c7a7e75-01435000-9f778f56\"<\/strong><br> ssid=3195698805 savetime=03\/03\/19 00:00:34 (1551531634) rama.turbamentis.int:&lt;3&gt;\/Volumes\/Alteran\/Documents<br>   level=full   sflags=vF       size=554835612580 files=3896       insert=03\/03\/19<br>   create=03\/03\/19 complete=03\/03\/19 browse=03\/04\/19 23:59:59 retent=03\/04\/19 23:59:59<br>   clientid=c7237fcb-00000004-58eb5ef3-58eb5ef2-00375000-9f778f56<br>           *backup start time: 1551531632;<br>              *mbs dependents: \/Volumes\/Alteran\/Documents;<br>         *policy action jobid: 1729123;<br>          *policy action name: \"backup: 1551531632\";<br>                 *policy name: \"Platinum: 1551531632\";<br>        *policy workflow name: \"Documents: 1551531632\";<br>                        group: Platinum_Documents;<br>             saveset features: CLIENT_SAVETIME;<br>   Clone #1: cloneid=1551531632  time=03\/03\/19 00:00:32    retent=03\/04\/19  flags=<br>     frag@         0 volid=3844106399 file\/rec=       0\/0     rn=0 last=03\/03\/19<br><\/pre>\n\n\n\n<p>You&#8217;ll notice in this output, as a <em>child<\/em> PSS entry, the <em>mbs dependents<\/em> simply gives the parent saveset name.<\/p>\n\n\n\n<p>So, how can you use this in scripting? Well below, you&#8217;ll find a <em>very<\/em> rough and ready Perl script that builds a view of the dependent details for a PSS saveset. I can guarantee the following is <strong><em>not<\/em><\/strong> in this script:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Any form of error checking<\/li><li>Handling Windows saveset names<\/li><li>Handling different pools<\/li><\/ul>\n\n\n\n<p>The script has to be run on the NetWorker backup server at the moment, using the arguments &#8220;-c clientName&#8221; and &#8220;-n savesetName&#8221; where the saveset name is obviously the name of the base PSS saveset. So in this case, running for my client of &#8220;<strong>rama<\/strong>&#8221; and a saveset name of &#8220;<strong>\/Volumes\/Alteran\/Documents<\/strong>&#8220;, I got output such as the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>.\/pss-dependents.pl -c rama -n \/Volumes\/Alteran\/Documents<\/strong><br> rama:\/Volumes\/Alteran\/Documents @ 03\/02\/19<br>     Level = full, Size = 508 GB, SSID = 3528823916<br>         3545601131 &lt;3&gt;\/Volumes\/Alteran\/Documents (533 GB)<br>         3579155563 &lt;2&gt;\/Volumes\/Alteran\/Documents (568 GB)<br>         3562378347 &lt;1&gt;\/Volumes\/Alteran\/Documents (548 GB)<br><br> rama:\/Volumes\/Alteran\/Documents @ 17\/02\/19<br>     Level = 1, Size = 4  B, SSID = 896010610<br>         929565040 &lt;3&gt;\/Volumes\/Alteran\/Documents (4  B)<br>         946342256 &lt;2&gt;\/Volumes\/Alteran\/Documents (4  B)<br>         912787824 &lt;1&gt;\/Volumes\/Alteran\/Documents (4  B)<br><br> rama:\/Volumes\/Alteran\/Documents @ 18\/02\/19<br>     Level = incr, Size = 105 MB, SSID = 3765000946<br>         3781778159 &lt;3&gt;\/Volumes\/Alteran\/Documents (119 MB)<br>         3798555375 &lt;2&gt;\/Volumes\/Alteran\/Documents (115 MB)<br>         3815332591 &lt;1&gt;\/Volumes\/Alteran\/Documents (106 MB)<br><br> rama:\/Volumes\/Alteran\/Documents @ 19\/02\/19<br>     Level = incr, Size = 4  B, SSID = 2339023986<br>         2355801200 &lt;3&gt;\/Volumes\/Alteran\/Documents (4  B)<br>         2372578416 &lt;2&gt;\/Volumes\/Alteran\/Documents (4  B)<br>         2389355632 &lt;1&gt;\/Volumes\/Alteran\/Documents (4  B)<br><br> rama:\/Volumes\/Alteran\/Documents @ 20\/02\/19<br>     Level = incr, Size = 4  B, SSID = 913047026<br>         963378672 &lt;3&gt;\/Volumes\/Alteran\/Documents (4  B)<br>         946601456 &lt;2&gt;\/Volumes\/Alteran\/Documents (4  B)<br>         929824240 &lt;1&gt;\/Volumes\/Alteran\/Documents (4  B)<\/pre>\n\n\n\n<p>(Abridged, there was a chunk more output.)<\/p>\n\n\n\n<p>The output is sorted by <em>nsavetime<\/em> for the core PSS saveset name, so you&#8217;ll get a rough view of the chaining of the saveset by dependencies. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <strong>cat pss-dependents.pl | awk '{gsub(\"\\t\",\"&nbsp; &nbsp; \");print}' -<\/strong><br> #!\/usr\/bin\/perl -w<br> <br> use strict;<br> use Getopt::Std;<br><br> my %opts;<br> my $client = \"none\";<br> my $name = \"none\";<br> if (getopts('c:n:',\\%opts)) {<br> &nbsp; &nbsp; if (defined($opts{c})) {<br> &nbsp; &nbsp; &nbsp; &nbsp; $client = $opts{c};<br> &nbsp; &nbsp; } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; die \"You must supply a client name (-c client)\\n\";<br> &nbsp; &nbsp; }<br> &nbsp; &nbsp; if (defined($opts{n})) {<br> &nbsp; &nbsp; &nbsp; &nbsp; $name = $opts{n};<br> &nbsp; &nbsp; } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; die \"You must supply a saveset name (-n name)\\n\";<br> &nbsp; &nbsp; }<br> }<br><br> my %ssids = ();<br> my $mminfo = \"mminfo -q \\\"client=$client,name=$name\\\" -r ssid,nsavetime,savetime,level,sumsize -xc,\";<br> if (open(MMI,\"$mminfo 2&gt;&amp;1 |\")) {<br> &nbsp; &nbsp; while (&lt;MMI&gt;) {<br> &nbsp; &nbsp; &nbsp; &nbsp; my $line = $_;<br> &nbsp; &nbsp; &nbsp; &nbsp; next if ($line =~ \/ssid\/);<br> &nbsp; &nbsp; &nbsp; &nbsp; chomp $line;<br> &nbsp; &nbsp; &nbsp; &nbsp; my ($ssid,$nsavetime,$savetime,$level,$sumsize) = (split(\/\\,\/,$line))[0,1,2,3,4];<br> &nbsp; &nbsp; &nbsp; &nbsp; $ssids{$nsavetime}{ssid} = $ssid;<br> &nbsp; &nbsp; &nbsp; &nbsp; $ssids{$nsavetime}{level} = $level;<br> &nbsp; &nbsp; &nbsp; &nbsp; $ssids{$nsavetime}{savetime} = $savetime;<br> &nbsp; &nbsp; &nbsp; &nbsp; $ssids{$nsavetime}{sumsize} = $sumsize;<br> &nbsp; &nbsp; }<br> &nbsp; &nbsp; close(MMI);<br> }<br><br> foreach my $nsavetime (sort {$a &lt;=&gt; $b} keys %ssids) {<br> &nbsp; &nbsp; my $savetime = $ssids{$nsavetime}{savetime};<br> &nbsp; &nbsp; my $level = $ssids{$nsavetime}{level};<br> &nbsp; &nbsp; my $ssid = $ssids{$nsavetime}{ssid};<br> &nbsp; &nbsp; my $sumsize = $ssids{$nsavetime}{sumsize};<br> &nbsp; &nbsp; print \"$client:$name @ $savetime\\n\";<br> &nbsp; &nbsp; print \"\\tLevel = $level, Size = $sumsize, SSID = $ssid\\n\";<br><br> &nbsp; &nbsp; my $mminfoVerbose = \"mminfo -q \\\"ssid=$ssid\\\" -S\";<br> &nbsp; &nbsp; $\/ = \";\\n\";<br> &nbsp; &nbsp; my @dependents = ();<br> &nbsp; &nbsp; if (open(MMI,\"$mminfoVerbose 2&gt;&amp;1 |\")) {<br> &nbsp; &nbsp; &nbsp; &nbsp; while (&lt;MMI&gt;) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $line = $_;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chomp $line;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($line =~ \/^\\s+\\*mbs dependents:\\s\\\\\\n(.*)$\/s) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $deps = $1;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @dependents = split(\/\\,\\s*\/,$deps);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #foreach my $dep (@dependents) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&nbsp; &nbsp; print \"\\t$dep\\n\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #}<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; close(MMI);<br> &nbsp; &nbsp; }<br> &nbsp; &nbsp; $\/ = \"\\n\";<br> &nbsp; &nbsp; foreach my $dep (@dependents) {<br> &nbsp; &nbsp; &nbsp; &nbsp; if (open(MMI,\"mminfo -q \\\"ssid=$dep\\\" -r ssid,name,sumsize -xc, 2&gt;&amp;1 |\")) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (&lt;MMI&gt;) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $line = $_;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chomp $line;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next if ($line =~ \/ssid\/);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my ($dSSID,$dName,$dSumsize) = (split(\/\\,\/,$line))[0,1,2];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print \"\\t\\t$dSSID $dName ($dSumsize)\\n\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; close(MMI);<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; }<br> &nbsp; &nbsp; print \"\\n\";<br> }<br> <br><\/pre>\n\n\n\n<p>So there you have it \u2013 pulling out details from NetWorker for the parallel savesets created in a PSS operation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A question I&#8217;ve been asked a few times is &#8220;how do we use mminfo to determine dependencies between PSS savesets?&#8221;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":7244,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,16],"tags":[594,1249,1192],"class_list":["post-7983","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-basics","category-networker","tag-mminfo","tag-networker","tag-pss"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2018\/11\/img_0221.jpg","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-24L","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/7983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/comments?post=7983"}],"version-history":[{"count":5,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/7983\/revisions"}],"predecessor-version":[{"id":7988,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/7983\/revisions\/7988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media\/7244"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=7983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=7983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=7983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}