﻿{"id":20,"date":"2016-05-08T07:25:39","date_gmt":"2016-05-07T23:25:39","guid":{"rendered":"http:\/\/simon.conley.mobi\/?p=20"},"modified":"2016-05-08T07:25:39","modified_gmt":"2016-05-07T23:25:39","slug":"xenserver-%e7%a7%bb%e9%99%a4-local-storage","status":"publish","type":"post","link":"https:\/\/old.ice.com.tw\/?p=20","title":{"rendered":"XenServer \u79fb\u9664 local storage"},"content":{"rendered":"<h2>1. log in to your xenserver host via ssh<\/h2>\n<p>Use your favourite SSH <span id=\"IL_AD6\" class=\"IL_AD\">program I<\/span> prefer using\u00a0 MTPuTTY myself.<\/p>\n<h2>2.List your storage repositories.<\/h2>\n<p>type<strong> xe sr-list <\/strong>to get the <strong>UUID<\/strong> from the local share you want to remove.<\/p>\n<p>You <span id=\"IL_AD10\" class=\"IL_AD\">will see<\/span> something like this:<\/p>\n<p><strong>uuid<\/strong> ( RO) : 62aac8ce-f974-9ecc-5a6f-6e601fcef97a<br \/>\n<strong>name-label<\/strong> ( RW): Local storage<br \/>\nname-description ( RW):<br \/>\nhost ( RO): xenghetto.sitedevelopments.local<br \/>\ntype ( RO): lvm<br \/>\ncontent-type ( RO): user<\/p>\n<p><strong>uuid<\/strong> string is the Storage <span id=\"IL_AD3\" class=\"IL_AD\">Repository<\/span> uuid (SR-uuid) that you need to be able to do the next step.<\/p>\n<p><strong>name-label<\/strong> This is the name of the local storage so check if that corresponds to the local storageyou want to detach before you go to the next step.<\/p>\n<h2><strong>Step 3. Get the Physical Block Device UUID.<\/strong><\/h2>\n<p>Now it\u2019s time to get the Physical Block Device (PBD):<\/p>\n<p>You find that by typing:\u00a0 xe pbd-list sr-uuid=Your-UUID<\/p>\n<p>[root@xenghetto # <strong>xe pbd-list sr-uuid=62aac8ce-f974-9ecc-5a6f-6e601fcef97a<\/strong><br \/>\nuuid ( RO)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 47127040-7e77-749c-ce24-49d33b9df232<br \/>\nhost-uuid ( RO): 4b3c5ae2-6b22-4972-bea5-9467b25f519d<br \/>\nsr-uuid ( RO): 62aac8ce-f974-9ecc-5a6f-6e601fcef97a<br \/>\ndevice-config (MRO): device: \/dev\/disk\/by-id\/scsi-SATA_INTEL_SSDSC2CT0CVMP2156091M060AGN-part3<br \/>\ncurrently-attached ( RO): true<\/p>\n<p><strong>uuid ( RO) <\/strong>This is the PBD-uuid write this down and lets unplug the local storage.<\/p>\n<h2>Step 4. Unplug the local storage.<\/h2>\n<p>To unplug the local storage you type the following:<\/p>\n<p>xe pbd-unplug uuid=Your-PBD-uuid<\/p>\n<p>In my case it\u2019s:<\/p>\n<p>xe pbd-unplug uuid=<strong>47127040-7e77-749c-ce24-49d33b9df232<\/strong><\/p>\n<p>it should now be <span id=\"IL_AD11\" class=\"IL_AD\">unplugged<\/span>. you can check that in xencenter.<\/p>\n<h2>Step 5.Delete the PBD:<\/h2>\n<p>xe pbd-destroy uuid=your-PBD-uuid<\/p>\n<p>in my case it\u2019s<\/p>\n<p>xe pbd-destroy uuid=47127040-7e77-749c-ce24-49d33b9df232<\/p>\n<p>if you go to xencenter you will now see that it\u2019s fully detached:<a href=\"http:\/\/media.sitedevelopments.net\/2013\/03\/localstorage-detached.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-61 alignleft\" src=\"http:\/\/media.sitedevelopments.net\/2013\/03\/localstorage-detached-300x175.png\" alt=\"detached localstorage\" width=\"300\" height=\"175\" \/><\/a><\/p>\n<h2>6. Forget ( remove ) the Local storage from showing up as detached.<\/h2>\n<p>xe sr-forget uuid=your-SR-uuid<\/p>\n<p>xe sr-forget uuid=62aac8ce-f974-9ecc-5a6f-6e601fcef97a<\/p>\n<p>Now check your XenCenter that it\u2019s removed.<\/p>\n<p><a href=\"http:\/\/media.sitedevelopments.net\/2013\/03\/done-removing-localstorage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-65 alignleft\" src=\"http:\/\/media.sitedevelopments.net\/2013\/03\/done-removing-localstorage.png\" alt=\"done-removing-localstorage\" width=\"231\" height=\"112\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. log in to your xenserver host via ssh Use your favou &hellip; <a href=\"https:\/\/old.ice.com.tw\/?p=20\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008XenServer \u79fb\u9664 local storage\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-xenserver"],"_links":{"self":[{"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20"}],"version-history":[{"count":1,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/20\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}