{"id":1322,"date":"2009-11-13T16:45:02","date_gmt":"2009-11-13T06:45:02","guid":{"rendered":"http:\/\/nsrd.wordpress.com\/?p=1322"},"modified":"2018-12-12T15:18:57","modified_gmt":"2018-12-12T05:18:57","slug":"manually-staging-dont-forget-the-clone-id","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2009\/11\/13\/manually-staging-dont-forget-the-clone-id\/","title":{"rendered":"Manually Staging? Don&#8217;t forget the Clone ID!"},"content":{"rendered":"<p>Something that continues to periodically come up is the need to remind people running manual staging to ensure they specify both the SSID and the Clone ID when they stage. <a title=\"Instantiating savesets\" href=\"https:\/\/nsrd.info\/blog\/2009\/01\/25\/instantiating-savesets\/\" target=\"_blank\">I did some initial coverage of this when I first started the blog<\/a>, but I wanted to revisit and demonstrate exactly <em>why<\/em> this is necessary.<\/p>\n<p>The short version of why is simple: If you stage by SSID alone, NetWorker will delete\/purge <em>all instances of the saveset other than the one you just created<\/em>. This is Not A Good Thing for 99.999% of what we do within NetWorker.<\/p>\n<p>So to demonstrate, here&#8217;s a session where I:<\/p>\n<ol>\n<li>Generate a backup<\/li>\n<li>Clone the backup to tape<\/li>\n<li>Stage the saveset only to tape<\/li>\n<\/ol>\n<p>In between each step, I&#8217;ll run mminfo to get a dump of what the media database says about saveset availability.<\/p>\n<h3>Part 1 \u2013 Generate the Backup<\/h3>\n<p>Here&#8217;s a very simple backup for the purposes of this demonstration, and the subsequent mminfo command to find out about the backup:<\/p>\n<pre>[root@tara ~]# save -b Default -LL -q \/etc\nsave: \/etc&nbsp; 106 MB 00:00:07&nbsp;&nbsp; 2122 files\ncompleted savetime=1258093549\n\n[root@tara ~]# mminfo -q \"client=tara.pmdg.lab,name=\/etc\" -r volume,ssid,cloneid,\nsavetime\n volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id&nbsp; date\nDefault.001&nbsp;&nbsp;&nbsp; 2600270829&nbsp; 1258093549 11\/13\/2009\nDefault.001.RO 2600270829&nbsp; 1258093548 11\/13\/2009<\/pre>\n<p>There&#8217;s nothing out of the ordinary here, so we&#8217;ll move onto the next step.<\/p>\n<h3>Part 2 \u2013 Clone the Backup<\/h3>\n<p>We&#8217;ll just do a manual clone to the Default Clone pool. Here we&#8217;ll specify the saveset ID alone, which is fine for cloning \u2013 but is often what leads people to being in the habit of not specifying a particular saveset instance. I&#8217;m using very small VTL tapes, so don&#8217;t be worried that in this case I&#8217;ve got a clone of \/etc spanning 3 volumes:<\/p>\n<pre>[root@tara ~]# nsrclone -b \"Default Clone\" -S 2600270829\n[root@tara ~]# mminfo -q \"client=tara.pmdg.lab,name=\/etc\" -r volume,ssid,cloneid,\nsavetime\n&nbsp;volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id&nbsp; date\n800843S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2600270829&nbsp; 1258094164 11\/13\/2009\n800844S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2600270829&nbsp; 1258094164 11\/13\/2009\n800845S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2600270829&nbsp; 1258094164 11\/13\/2009\nDefault.001&nbsp;&nbsp;&nbsp; 2600270829&nbsp; 1258093549 11\/13\/2009\nDefault.001.RO 2600270829&nbsp; 1258093548 11\/13\/2009<\/pre>\n<p>As you can see there, it&#8217;s all looking fairly ordinary at this point &#8211; nothing surprising is going on at all.<\/p>\n<h3>Part 3 \u2013 Stage by Saveset ID Only<\/h3>\n<p>In this next step, I&#8217;m going to stage by saveset ID alone rather than specifying the saveset ID\/clone ID, which is the correct way of staging, so as to demonstrate what happens at the conclusion of the staging. I&#8217;ll be staging to a pool called &#8220;Big&#8221;:<\/p>\n<pre>[root@tara ~]# nsrstage -b Big -v -m -S 2600270829\nObtaining media database information on server tara.pmdg.lab\nParsing save set id(s)\nMigrating the following save sets (ids):\n 2600270829\n5874:nsrstage: Automatically copying save sets(s) to other volume(s)\n\nStarting migration operation...\nNov 13 17:34:00 tara logger: NetWorker media: (waiting) Waiting for 1 writable\nvolume(s) to backup pool 'Big' disk(s) or tape(s) on tara.pmdg.lab\n5884:nsrstage: Successfully cloned all requested save sets\n5886:nsrstage: Clones were written to the following volume(s):\n BIG991S3\n6359:nsrstage: Deleting the successfully cloned save set 2600270829\nSuccessfully deleted original clone 1258093548 of save set 2600270829\nfrom media database.\nSuccessfully deleted AFTD's companion clone 1258093549 of save set 2600270829\nfrom media database with 0 retries.\nSuccessfully deleted original clone 1258094164 of save set 2600270829\nfrom media database.\nRecovering space from volume 4294740163 failed with the error\n'Cannot access volume 800844S3, please mount the volume or verify its label.'.\nRefer to the NetWorker log for details.\n6330:nsrstage: Cannot access volume 800844S3, please mount the volume\nor verify its label.\nCompleted recover space operation for volume 4177299774\nRefer to the NetWorker log for any failures.\nRecovering space from volume 4277962971 failed with the error\n'Cannot access volume 800845S3, please mount the volume or verify its label.'.\nRefer to the NetWorker log for details.\n6330:nsrstage: Cannot access volume 800845S3, please mount the volume\nor verify its label.\nRecovering space from volume 16550059 failed with the error\n'Cannot access volume 800843S3, please mount the volume or verify its label.'.\nRefer to the NetWorker log for details.\n6330:nsrstage: Cannot access volume 800843S3, please mount the volume\nor verify its label.<\/pre>\n<p>You&#8217;ll note there&#8217;s a bunch of output there about being unable to access the clone volumes the saveset was previously cloned to. When we then check mminfo, we see the consequences of the staging operation though:<\/p>\n<pre>[root@tara ~]# mminfo -q \"client=tara.pmdg.lab,name=\/etc\" -r volume,ssid,cloneid,\nsavetime\n volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id&nbsp; date\nBIG991S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2600270829&nbsp; 1258095244 11\/13\/2009<\/pre>\n<p>As you can see \u2013 no reference to the clone volumes at all!<\/p>\n<p>Now, has the clone data been erased? No, but it <em>has<\/em> been removed from the media database, meaning you&#8217;d have to manually scan the volumes back in order to be able to use them again. Worse, if those volumes <em>only<\/em> contained clone data that was subsequently removed from the media database, they may become eligible for recycling and get re-used before you notice what has gone wrong!<\/p>\n<h3>Wrapping Up<\/h3>\n<p>Hopefully the above session will have demonstrated the danger of staging by saveset ID alone. If instead of staging by saveset ID we staged by saveset ID and clone ID, we&#8217;d have had a much more desirable outcome. Here&#8217;s a (short) example of that:<\/p>\n<pre>[root@tara ~]# save -b Default -LL -q \/tmp\nsave: \/tmp&nbsp; 2352 KB 00:00:01&nbsp;&nbsp;&nbsp;&nbsp; 67 files\ncompleted savetime=1258094378\n[root@tara ~]# mminfo -q \"name=\/tmp\" -r volume,ssid,cloneid\n volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id\nDefault.001&nbsp;&nbsp;&nbsp; 2583494442&nbsp; 1258094378\nDefault.001.RO 2583494442&nbsp; 1258094377\n[root@tara ~]# nsrclone -b \"Default Clone\" -S 2583494442\n\n[root@tara ~]# mminfo -q \"name=\/tmp\" -r volume,ssid,cloneid\n volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id\n800845S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2583494442&nbsp; 1258095244\nDefault.001&nbsp;&nbsp;&nbsp; 2583494442&nbsp; 1258094378\nDefault.001.RO 2583494442&nbsp; 1258094377\n[root@tara ~]# nsrstage -b Big -v -m -S 2583494442\/1258094377\nObtaining media database information on server tara.pmdg.lab\nParsing save set id(s)\nMigrating the following save sets (ids):\n 2583494442\n5874:nsrstage: Automatically copying save sets(s) to other volume(s)\n\nStarting migration operation...\n\n5886:nsrstage: Clones were written to the following volume(s):\n BIG991S3\n6359:nsrstage: Deleting the successfully cloned save set 2583494442\nSuccessfully deleted original clone 1258094377 of save set 2583494442 from\nmedia database.\nSuccessfully deleted AFTD's companion clone 1258094378 of save set 2583494442\nfrom media database with 0 retries.\nCompleted recover space operation for volume 4177299774\nRefer to the NetWorker log for any failures.\n\n[root@tara ~]# mminfo -q \"name=\/tmp\" -r volume,ssid,cloneid\n volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id\n800845S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2583494442&nbsp; 1258095244\nBIG991S3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2583494442&nbsp; 1258096324<\/pre>\n<p>The recommendation that I always make is that you <em>forget about using saveset IDs alone<\/em> unless you absolutely have to. Instead, get yourself into the habit of always specifying a particular <em>instance<\/em> of a saveset ID via the &#8220;ssid\/cloneid&#8221; option. That way, if you do any manual staging, you won&#8217;t wipe out access to data!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Something that continues to periodically come up is the need to remind people running manual staging to ensure they specify&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,16,20],"tags":[227,656,677,857,928,933],"class_list":["post-1322","post","type-post","status-publish","format-standard","hentry","category-basics","category-networker","category-scripting","tag-clone-id","tag-nsrclone","tag-nsrstage","tag-saveset-id","tag-ssid","tag-staging"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-lk","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/1322","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=1322"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/1322\/revisions"}],"predecessor-version":[{"id":7590,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/1322\/revisions\/7590"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=1322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=1322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=1322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}