{"id":1187,"date":"2012-04-27T13:04:59","date_gmt":"2012-04-27T03:04:59","guid":{"rendered":"https:\/\/www.penguinpunk.net\/blog\/?p=1187"},"modified":"2015-12-10T07:21:24","modified_gmt":"2015-12-09T21:21:24","slug":"emc-creating-snapview-clones-with-naviseccli","status":"publish","type":"post","link":"https:\/\/www.penguinpunk.net\/blog\/emc-creating-snapview-clones-with-naviseccli\/","title":{"rendered":"EMC &#8211; Creating SnapView Clones with naviseccli"},"content":{"rendered":"<p>EMC SnapView has been around for some time on the CLARiiON and VNX. I don&#8217;t want to go into the how and what of using SnapView in your environment, but I thought this quick rundown of creating a SnapView Clone using naviseccli might be useful. You can also do all of this using the Wizard in Unisphere &#8211; if you&#8217;re into pointy hats and capes.<\/p>\n<p>You&#8217;d be best served to test these commands in your own environment before trying them on data you care about. And I take no responsibility if you pooch it because you&#8217;ve followed my guide without thinking through the ramifications of your actions. Also, be careful of the line breaks here &#8211; if you don&#8217;t get the whole line copied you&#8217;ll run into issues. So let&#8217;s get to it.<\/p>\n<p>I&#8217;m assuming that you&#8217;ve never done clones before, so we&#8217;re starting from scratch. Firstly, bind\u00a0two LUNs for use as Clone Private LUNs.\u00a0These can be any size you want, but their usefulness is limited beyond 1GB each.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 bind r5 901 -rg 1 -sp a -cap 1024 -sq mb\r\n<\/strong><strong>naviseccli -h 192.168.0.90 bind r5 902 -rg 1 -sp b -cap 1024 -sq mb<\/strong><\/pre>\n<p>Note that I already had a RAID Group set aside for the LUNs. You then need to create a LUN to use as the clone. This LUN will evidently be the\u00a0same size as the source. Note that it can reside on a different SP. Let&#8217;s assume the source LUN\u00a0is 1TB.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 bind r5 910 -rg 7 -sp b -cap 1024 -sq gb<\/strong><\/pre>\n<p>Now it&#8217;s time to allocate the 1GB LUNs as CPLs.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -allocatecpl -spA 901 -spB 902 -o<\/strong><\/pre>\n<p>With SnapView, AllowProtectedRestore is disabled by default. You can change this on a global level with the following command. Note the -o prevents naviseccli from confirming my actions. If you&#8217;re unsure about the commands you want to use, you can leave -o off.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -changeclonefeature -AllowProtectedRestore 0|1(Disabled|Enabled) -o<\/strong><\/pre>\n<p>Create a Clone Group to store the Source and Clone in. At this point we nominate the LUN(s) that we want to be cloned.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -createclonegroup -name VMwareMgmtSnapClone -luns 3 -description \"Clone Group for vSphere Upgrade\" -o<\/strong><\/pre>\n<p>Now add the clone to the clone group.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -addclone -Name VMwareMgmtSnapClone -Luns 910<\/strong><\/pre>\n<p>The listclonegroup is used to get info on the array&#8217;s SnapView clone status.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -listclonegroup\r\n<\/strong><strong>Name: VMwareMgmtSnapClone\r\n<\/strong><strong>CloneGroupUid: 50:06:01:60:C6:E0:43:CF:01:00:00:00:00:00:00:00\r\n<\/strong><strong>InSync: Yes\r\n<\/strong><strong>Description: Clone Group for vSphere Upgrade Testing\r\n<\/strong><strong>QuiesceThreshold: 60\r\n<\/strong><strong>SourceMediaFailure: No\r\n<\/strong><strong>IsControllingSP: No\r\n<\/strong><strong>SourceLUNSize: 2147483648\r\n<\/strong><strong>CloneCount: 1\r\n<\/strong><strong>Sources: 3\r\n<\/strong><strong>Clones:\r\n<\/strong><strong>CloneID: 0100000000000000\r\n<\/strong><strong>CloneState: Synchronizing\r\n<\/strong><strong>CloneCondition: Synchronizing\r\n<\/strong><strong>AvailableForIO: No\r\n<\/strong><strong>CloneMediaFailure: No\r\n<\/strong><strong>IsDirty: No\r\n<\/strong><strong>PercentSynced: 0\r\n<\/strong><strong>RecoveryPolicy: Auto\r\n<\/strong><strong>SyncRate: Medium\r\n<\/strong><strong>CloneLUNs: 910\r\n<\/strong><strong>UseProtectedRestore: No\r\n<\/strong><strong>IsFractured: No<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>Using -changeclone you can change the sync rate and protected restore options for the clone. In this example I&#8217;ve changed the rate to High (from Medium) and set it to use Protected Restore.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -changeclone -name VMwareMgmtSnapClone -cloneid 0100000000000000 -SyncRate high -UseProtectedRestore 1 -o<\/strong><\/pre>\n<p>Depending on how much data needs to be synchronized, it might take a little time before the output looks like this:<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -listclonegroup\r\n<\/strong><strong>Name: VMwareMgmtSnapClone\r\n<\/strong><strong>CloneGroupUid: 50:06:01:60:C6:E0:43:CF:01:00:00:00:00:00:00:00\r\n<\/strong><strong>InSync: Yes\r\n<\/strong><strong>Description: Clone Group for vSphere Upgrade Testing\r\n<\/strong><strong>QuiesceThreshold: 60\r\n<\/strong><strong>SourceMediaFailure: No\r\n<\/strong><strong>IsControllingSP: No\r\n<\/strong><strong>SourceLUNSize: 2147483648\r\n<\/strong><strong>CloneCount: 1\r\n<\/strong><strong>Sources: 3\r\n<\/strong><strong>Clones:\r\n<\/strong><strong>CloneID: 0100000000000000\r\n<\/strong><strong>CloneState: Synchronized\r\n<\/strong><strong>CloneCondition: Normal\r\n<\/strong><strong>AvailableForIO: No\r\n<\/strong><strong>CloneMediaFailure: No\r\n<\/strong><strong>IsDirty: No\r\n<\/strong><strong>PercentSynced: 100\r\n<\/strong><strong>RecoveryPolicy: Auto\r\n<\/strong><strong>SyncRate: High\r\n<\/strong><strong>CloneLUNs: 910\r\n<\/strong><strong>UseProtectedRestore: Yes\r\n<\/strong><strong>IsFractured: No<\/strong><\/pre>\n<p>After synchronization, use the Windows-based tool admsnap to flush I\/O from the LUN<\/p>\n<pre><strong>admsnap flush -o E:<\/strong><\/pre>\n<p>Wait for the clone to transition to synchronized. Once this is complete, you can\u00a0fracture the Clone.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -fractureclone -Name VMwareMgmtSnapClone -CloneId 0100000000000000 -o<\/strong><\/pre>\n<p>Verify that it&#8217;s fractured and consistent<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 snapview -listclonegroup\r\n<\/strong><strong>Name: VMwareMgmtSnapClone\r\n<\/strong><strong>CloneGroupUid: 50:06:01:60:C6:E0:43:CF:01:00:00:00:00:00:00:00\r\n<\/strong><strong>InSync: Yes\r\n<\/strong><strong>Description: Clone Group for vSphere Upgrade Testing\r\n<\/strong><strong>QuiesceThreshold: 60\r\n<\/strong><strong>SourceMediaFailure: No\r\n<\/strong><strong>IsControllingSP: No\r\n<\/strong><strong>SourceLUNSize: 2147483648\r\n<\/strong><strong>CloneCount: 1\r\n<\/strong><strong>Sources: 3\r\n<\/strong><strong>Clones:\r\n<\/strong><strong>CloneID: 0100000000000000\r\n<\/strong><strong>CloneState: Consistent\r\n<\/strong><strong>CloneCondition: Administratively Fractured\r\n<\/strong><strong>AvailableForIO: Yes\r\n<\/strong><strong>CloneMediaFailure: No\r\n<\/strong><strong>IsDirty: No\r\n<\/strong><strong>PercentSynced: N\/A\r\n<\/strong><strong>RecoveryPolicy: Auto\r\n<\/strong><strong>SyncRate: High\r\n<\/strong><strong>CloneLUNs: 910\r\n<\/strong><strong>UseProtectedRestore: Yes\r\n<\/strong><strong>IsFractured: Yes<\/strong><\/pre>\n<p>If you wanted to use this clone to run a backup via a secondary host, you would then add it to the storage group of that host.<\/p>\n<pre><strong>naviseccli -h 192.168.0.90 storagegroup -addhlu -gname SGNAME -hlu HOSTLUNID -alu ARRAYLUNID<\/strong><\/pre>\n<p>Once you&#8217;ve added it to the storage group, you can use admsnap to scan for the clone on the secondary host<\/p>\n<pre><strong>admsnap clone_activate<\/strong><\/pre>\n<p>If for some reason you want to use the clone to restore the data on the source LUN, you&#8217;d use the Reverse Synchronize process.<\/p>\n<pre><strong>naviseccli clone -reversesyncclone -name NAME -cloneid CLONEID -UseProtectedRestore 0|1 -o<\/strong><\/pre>\n<p>If you want to keep the clone to use again in the future, fracture it from the source again.<\/p>\n<pre><strong>naviseccli clone -fractureclone -name NAME -cloneid CLONEID -o<\/strong><\/pre>\n<p>And that&#8217;s SnapView Clones\u00a0with naviseccli in a nutshell.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>EMC SnapView has been around for some time on the CLARiiON and VNX. I don&#8217;t want to go into the how and what of using SnapView in your environment, but I thought this quick rundown of creating a SnapView Clone using naviseccli might be useful. You can also do all of this using the Wizard [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[125,60,123,408],"tags":[24,453,170,21,110,158,40,359,452,787,807],"class_list":["post-1187","post","type-post","status-publish","format-standard","hentry","category-clariion-emc-storage-storage","category-emc-storage","category-snapview","category-vnx","tag-clariion","tag-clone","tag-cx4","tag-emc","tag-howto","tag-naviseccli","tag-san","tag-snap","tag-snapview-2","tag-storage","tag-vnx"],"_links":{"self":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts\/1187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/comments?post=1187"}],"version-history":[{"count":6,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts\/1187\/revisions"}],"predecessor-version":[{"id":3398,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts\/1187\/revisions\/3398"}],"wp:attachment":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/media?parent=1187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/categories?post=1187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/tags?post=1187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}