{"id":12,"date":"2009-01-25T06:11:51","date_gmt":"2009-01-25T06:11:51","guid":{"rendered":"http:\/\/nsrd.wordpress.com\/?p=12"},"modified":"2018-12-12T16:38:51","modified_gmt":"2018-12-12T06:38:51","slug":"instantiating-savesets","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2009\/01\/25\/instantiating-savesets\/","title":{"rendered":"Instantiating savesets"},"content":{"rendered":"<p>Following a recent discussion I\u2019ve been having on the NetWorker Mailing List, I thought I should put a few details down about clone IDs.<\/p>\n<p>If you don\u2019t clone your backups (and if you don\u2019t: <em>why not?<\/em>), you may not have really encountered clone IDs very much. They\u2019re the shadowy twin of the saveset ID, and serve a fairly important purpose.<\/p>\n<p>From hereon in, I\u2019ll use the following nomenclature:<\/p>\n<ul>\n<li> SSID = Save Set ID<\/li>\n<li> CLID = CLone ID<\/li>\n<\/ul>\n<p>\u201cSSID\u201d is pretty much the standard NetWorker terminology for saveset ID, but usually clone ID is just written as \u201cclone ID\u201d or \u201cclone-id\u201d, etc., which gets a bit tiresome after a while.<\/p>\n<p>Every saveset in NetWorker is tagged with a unique SSID. However, every copy of a saveset is tagged with the same SSID, but a different CLID.<\/p>\n<p>You can see this when you ask mminfo to show both:<\/p>\n<pre style=\"text-align:left;\">[root@nox ~]# mminfo -q \"savetime&gt;=18 hours ago,pool=Staging,client=archon,\nname=\/Volumes\/TARDIS\" -r volume,ssid,cloneid,nsavetime<\/pre>\n<pre style=\"text-align:left;\">&nbsp;volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clone id&nbsp; save time<\/pre>\n<pre style=\"text-align:left;\">Staging-01&nbsp;&nbsp;&nbsp;&nbsp; 3962821973&nbsp; 1228135765 1228135764<\/pre>\n<pre style=\"text-align:left;\">Staging-01.RO&nbsp; 3962821973&nbsp; 1228135764 1228135764<\/pre>\n<p style=\"text-align:left;\"><em>(If you must know, being a fan of Doctor Who, all my Time Machine drives are called \u201cTARDIS\u201d \u2013 and no, I don\u2019t backup my Time Machine copies with NetWorker, it would be a truly arduous and wasteful thing to do; I use my Time Machine drives for other database dumps from my Macs.)<\/em><\/p>\n<p>In this case we\u2019re not only seeing the SSID and CLID, but also a special instance of the SSID\/CLID combination \u2013 that which is assigned for disk backup units. In the above example, you\u2019ll note that the CLID associated with the read-only (.RO) version of the disk backup unit is exactly one less than the CLID associated with the read-write version of the disk backup unit. This is done by NetWorker for a very specific reason.<\/p>\n<p>So, you might wonder then what the purpose of the CLID is, since we use the SSID to identify an individual saveset, right?<\/p>\n<p>I had hunted for ages for a really good analogy on SSID\/CLIDs, and stupidly the most obvious one never occurred to me. One of the NetWorker Mailing List\u2019s most helpful posters, Davina Treiber, posted the (in retrospect) obvious and smartest analogy I\u2019ve seen &#8211; comparing savesets to books in a library. To paraphrase, while a library may have multiple copies of the same book (with each copy having the same ISBN &#8211; after all, it\u2019s the same book), they will obviously need to keep track of the individual copies of the book to know who has which copy, how many copies they have left, etc. Thus, the library would assign an individual copy number to each instance of the book they have, even if they only have one instance.<\/p>\n<p>This, quite simply, is the purpose of the CLID \u2013 to identify individual instances of a single saveset. This means that you can, for example, do any of the following (and more!):<\/p>\n<ul>\n<li> Clone a saveset by reading from a particular cited copy.<\/li>\n<li> Recover from a saveset by reading from a particular cited copy.<\/li>\n<li> Instruct NetWorker to remove from its media database reference to a particular cited copy.<\/li>\n<\/ul>\n<p style=\"text-align:left;\">In particular, in the final example, if you know that a particular tape is bad, and you want to delete that tape, you only want NetWorker to delete reference to the saveset instances on that tape \u2013 you wouldn\u2019t want to also delete reference to perfectly good copies sitting on other tapes. Thus you would refer to SSID\/CLID.<\/p>\n<p>I\u2019ve not been using the terminology SSID\/CLID randomly. When working with NetWorker in a situation where you either want to, or must specify a specific instance of a saveset, you literally use that in the command. E.g.,:<\/p>\n<pre># nsrclone -b \u201cDaily Clone\u201d -S 3962821973\/1228135764<\/pre>\n<p style=\"text-align:left;\">Would clone the saveset 3962821973 to the \u201cDaily Clone\u201d pool, using the saveset instance (CLID) 1228135764.<\/p>\n<p>The same command could be specified as:<\/p>\n<pre># nsrclone -b \u201cDaily Clone\u201d -S 3962821973<\/pre>\n<p style=\"text-align:left;\">However, this would mean that NetWorker would pick which instance of the saveset to read from in order to clone the nominated saveset. The same thing happens when NetWorker is asked to perform a recovery in standard situations (i.e., non-SSID based recoveries).<\/p>\n<p>So, how does NetWorker pick which instance of a saveset should be used to facilitate a recovery? The algorithm used goes a little like this:<\/p>\n<ul>\n<li>If there are instances online, then the most available instance is used.<\/li>\n<li>If there are multiple instances equally online, then the instance with the lowest CLID is requested.<\/li>\n<li>If all instances are offline, then the instance with the lowest CLID not marked as offsite is requested.<\/li>\n<\/ul>\n<p style=\"text-align:left;\">The first point may not immediately make sense. Most available? If you say, have 2 copies on tape, and one tape is in a library, but the other is physically mounted in a tape drive, and is not in use, that tape in the drive will be used.<\/p>\n<p>For the second point, consider disk backup units &#8211; adv_file type devices. In this case, both the RW and the RO \u201cversion\u201d of the saveset (remembering, there\u2019s only one real physical copy on disk, NetWorker just mungs some details to make it appear to the media database that there\u2019s 2 copies) are equally online &#8211; they\u2019re both mounted disk volumes. So, to prevent recoveries automatically running from the RW \u201cversion\u201d of the saveset on disk, when the instances are setup, the \u201cversion\u201d on the RO portion of the disk backup unit is assigned a CLID one less than the CLID of the \u201cversion\u201d on the RW device.<\/p>\n<p>Thus, we get \u201cguaranteed\u201d recovery\/reading from the RO version of the disk backup unit. In normal circumstances, that is. (You can still force recovery\/reading from the RW version if you so desire.)<\/p>\n<p>In the final point, if all copies are equally offline, NetWorker previously just requested the copy with the lowest CLID. This works well in a tape only environment &#8211; i.e.:<\/p>\n<ul>\n<li> Backup to tape<\/li>\n<li> Clone backup to another tape<\/li>\n<li> Send clone offsite<\/li>\n<li> Keep \u2018original\u2019 onsite<\/li>\n<\/ul>\n<p style=\"text-align:left;\">In this scenario, NetWorker would ask for the \u2018original\u2019 by virtue of it having the lowest CLID. However, the CLID is only generated when the saveset is cloned. Thus, consider the backup to disk scenario:<\/p>\n<ul>\n<li> Backup to disk<\/li>\n<li> Clone from disk to tape<\/li>\n<li> Send clone offsite<\/li>\n<li> Later, when disk becomes full or savesets are too old, stage from disk to tape<\/li>\n<li> Keep new \u201coriginals\u201d on-site.<\/li>\n<\/ul>\n<p style=\"text-align:left;\">This created a problem \u2013&nbsp;in this scenario, if you went to do a recovery after staging, then NetWorker would (annoyingly for many!) request the clone version of the saveset. This either meant requesting it to be pulled back from the offsite location, or doing a SSID\/CLID recovery or marking the clone SSID\/CLID as suspect or mounting the \u201coriginal\u201d. However you looked at it, it was a lot of work that you really shouldn\u2019t have needed to do.<\/p>\n<p>NetWorker 7.3.x however introduced the notion of an offsite flag; this isn\u2019t the same as setting the volume location to offsite however. It\u2019s literally a new flag:<\/p>\n<pre># nsrmm -o offsite 800841<\/pre>\n<p style=\"text-align:left;\">Would mark the volume 800841 in the media database as not being onsite \u2013 I.e., having a <em>less desirable<\/em> availability for recovery\/read operations.<\/p>\n<p>The net result is that in this situation, even if the offsite clone has a lower CLID, if it is flagged as offsite, but there\u2019s a clone with a higher CLID not flagged as offsite, NetWorker will bypass that normal \u201cuse the lowest CLID\u201d preference to instead request the onsite copy.<\/p>\n<p>It would certainly be preferable however if a future version of NetWorker could have read priority established as a flag for pools; that way, rather than having to bugger around with the offsite flag (which, incidentally, can only be set\/cleared from the command line, and can\u2019t be queried!), an administrator could nominate \u201cThis pool has highest recovery priority, whereas this pool has lower recovery priority\u201d. That way, NetWorker would pick the lowest CLID in the highest recovery priority pool.<\/p>\n<p>(I wait, and hope.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following a recent discussion I\u2019ve been having on the NetWorker Mailing List, I thought I should put a few details&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":[16,20],"tags":[1249,1252,856,1253],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-networker","category-scripting","tag-networker","tag-recovery","tag-saveset","tag-scripting"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-c","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/12","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=12"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":7702,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions\/7702"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}