{"id":139,"date":"2011-07-26T18:54:09","date_gmt":"2011-07-26T18:54:09","guid":{"rendered":"http:\/\/www.pasko.net\/wordpress\/?p=139"},"modified":"2011-07-26T18:54:09","modified_gmt":"2011-07-26T18:54:09","slug":"solaris-sdsodssvm-san-migration-with-minimal-downtime","status":"publish","type":"post","link":"https:\/\/www.pasko.net\/wordpress\/2011\/07\/26\/solaris-sdsodssvm-san-migration-with-minimal-downtime\/","title":{"rendered":"Solaris SDS\/ODS\/SVM san migration with minimal downtime"},"content":{"rendered":"<p id=\"top\" \/>I need to migrate a Solaris 10 database server from an old san array to a newer one, while taking as small an outage as we can. I came upon the migration method below by necessity.<\/p>\n<p>We have a fairly large ~46Tb database which needed to get off an older san array due to EMC&#8217;s\u00a0extortion-like\u00a0support pricing model.<\/p>\n<p>My goal is to take the shortest outage possible, while getting all 46Tb of data migrated to disks on the new array.<\/p>\n<p>The minimal outage does require taking the database down and briefly unmounting the filesystems. But, a 5 minute outage to migrate 46Tb of data seems somewhat tolerable given our alternatives.<\/p>\n<p>For the purpose of this article, I&#8217;ll use the simpler CTD disks from a setup with internal only disk, rather than the eyechart CTD disk labels to illustrate the technique. The database server I&#8217;m working on has hundreds of luns, all with device names similar to:<\/p>\n<pre><strong>c3t60060480000190100478533031383339d0s2<\/strong><\/pre>\n<p>So, we&#8217;ll go with internal disks\u00a0<strong>c1<span style=\"color: #008000;\">t0<\/span>d0s5<\/strong>, mapped to metadevice <strong>d51<\/strong>, mounted as <strong>\/d1001<\/strong>, as a source disk that has good data. The destination disk is\u00a0<strong>c1<span style=\"color: #008000;\">t1<\/span>d0s5<\/strong>\u00a0mapped to metadevice <strong>d52<\/strong>\u00a0as a migration destination.<\/p>\n<p>Let&#8217;s make sure we know our source disk, so I&#8217;m creating a file based on the device name.<\/p>\n<pre>bash-3.00# <strong>metastat -ap | grep d51<\/strong>\nd51 1 1 c1t0d0s5\nbash-3.00# <strong>mount | grep d51<\/strong>\n<strong>\/d1001<\/strong> on \/dev\/md\/dsk\/<strong>d51<\/strong> read\/write\/setuid\/devices...\n<span class=\"Apple-style-span\" style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;\">bash-3.00# <strong>touch \/d1001\/I_am_d51<\/strong><\/span>\nbash-3.00# <strong>ls \/d1001<\/strong>\nI_am_d51    lost+found ...<\/pre>\n<p>Our original disk is mounted as \/d1001, first unmount it.<\/p>\n<pre>bash-3.00# <strong>umount \/d1001<\/strong><\/pre>\n<p>Now create the mirror, and attach d51 with our good data to it.<\/p>\n<pre>bash-3.00# <strong>metainit d50 -m d51<\/strong>\nd50: Mirror is setup<\/pre>\n<p><span style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace;\"><span class=\"Apple-style-span\" style=\"line-height: 21px;\">To see that our data is still there, mount our new mirror and take a look<\/span><\/span><\/p>\n<pre>bash-3.00# <strong>mount \/dev\/md\/dsk\/d50 \/d1001<\/strong>\nbash-3.00# <strong>ls \/d1001<\/strong>\nI_am_d51    lost+found<\/pre>\n<p>For my purposes, I would do the above unmount, attach new mirror metadevice for all mountpoints. \u00a0At this point the database could be restarted.<\/p>\n<p>We will then create the new side of the SDS mirror, then attach to get the data synchronized while the database is running.<\/p>\n<p>Use <strong>format<\/strong> to label the new incoming disks (<strong>c1t1d0s5<\/strong>) then use metainit to initialize the new disk.<\/p>\n<pre>bash-3.00# <strong><span class=\"Apple-style-span\" style=\"font-size: 16px; color: #444444; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; white-space: normal;\">metainit d52 1 1 c1t1d0s5<\/span><\/strong><\/pre>\n<p><span class=\"Apple-style-span\" style=\"font-size: 16px; color: #444444; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; white-space: normal;\">We can now attach the new disk, which would represent our new san array.<\/span><strong><span class=\"Apple-style-span\" style=\"font-size: 16px; color: #444444; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; white-space: normal;\"><br \/>\n<\/span><\/strong><\/p>\n<pre>bash-3.00# <strong>metattach d50 d52<\/strong>\nd50: submirror d52 is attached\nbash-3.00# <strong>metastat d50<\/strong>\nd50: Mirror\n    Submirror 0: d51\n      State: Okay\n    Submirror 1: d52\n      State: Resyncing\n    Resync in progress: 0 % done\n    Pass: 1\n    Read option: roundrobin (default)\n    Write option: parallel (default)\n    Size: 117726144 blocks (56 GB)\n\nd51: Submirror of d50\n    State: Okay\n    Size: 117726144 blocks (56 GB)\n    Stripe 0:\n        Device     Start Block  Dbase        State Reloc Hot Spare\n        c1t0d0s5          0     No            Okay   Yes \n\nd52: Submirror of d50\n    State: Resyncing\n    Size: 117726144 blocks (56 GB)\n    Stripe 0:\n        Device     Start Block  Dbase        State Reloc Hot Spare\n        c1t1d0s5          0     No            Okay   Yes<\/pre>\n<pre>bash-3.00# <strong>metastat d50 | grep progress<\/strong>\nResync in progress: 33 % done<\/pre>\n<p>When d50 has completed sync&#8217;ing we can detach the original disk which will make our old array decommission possible.<\/p>\n<pre>bash-3.00# <strong>metastat d50<\/strong>\nd50: Mirror\n    Submirror 0: d51\n      State: Okay\n    Submirror 1: d52\n      State: Okay\n    Pass: 1\n    Read option: roundrobin (default)\n    Write option: parallel (default)\n    Size: 117726144 blocks (56 GB)\n\nd51: Submirror of d50\n    State: Okay\n    Size: 117726144 blocks (56 GB)\n    Stripe 0:\n        Device     Start Block  Dbase        State Reloc Hot Spare\n        c1t0d0s5          0     No            Okay   Yes \n\nd52: Submirror of d50\n    State: Okay\n    Size: 117726144 blocks (56 GB)\n    Stripe 0:\n        Device     Start Block  Dbase        State Reloc Hot Spare\n        c1t1d0s5          0     No            Okay   Yes \n\nDevice Relocation Information:\nDevice   Reloc  Device ID\nc1t0d0   Yes    id1,sd@n500000e0125d2140\nc1t1d0   Yes    id1,sd@n500000e0125e77c0<\/pre>\n<p>We can now disconnect our original disk and retire our array.<\/p>\n<pre>bash-3.00# <strong>metadetach d50 d51<\/strong>\nd50: submirror d51 is detached<\/pre>\n<pre>bash-3.00# <strong>df -h | grep d1001<\/strong>\n\/dev\/md\/dsk\/d50         55G    56M    55G     1%    \/d1001\nbash-3.00# <strong>ls \/d1001<\/strong>\nI_am_d51    lost+found<\/pre>\n<p>As a note, if there are dozens of mounpoints to synchronize, it should be done in small groups or serially. Having two dozen metadevices syncing at the same time will certainly affect the performance of the database.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to migrate a Solaris 10 database server from an old san array to a newer one, while taking as small an outage as we can. I came upon the migration method below by necessity. We have a fairly &hellip; <a href=\"https:\/\/www.pasko.net\/wordpress\/2011\/07\/26\/solaris-sdsodssvm-san-migration-with-minimal-downtime\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[6,7],"tags":[11],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-nerd","category-solaris","tag-nerd-stuff-corporate-style"],"_links":{"self":[{"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":0,"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pasko.net\/wordpress\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}