﻿{"id":12,"date":"2016-05-08T07:01:01","date_gmt":"2016-05-07T23:01:01","guid":{"rendered":"http:\/\/simon.conley.mobi\/?p=12"},"modified":"2016-05-08T07:08:16","modified_gmt":"2016-05-07T23:08:16","slug":"xenserver2","status":"publish","type":"post","link":"https:\/\/old.ice.com.tw\/?p=12","title":{"rendered":"Xenserver\u6dfb\u52a0\u5b58\u5728\u8cc7\u6599\u7684\u7b2c\u4e8c\u9846\u786c\u789f"},"content":{"rendered":"<ul>\n<li>Do a pvscan to get the Universally Unique Identifier (UUID) of an existing SR on a local disk. This example uses UUID 39baf126-a535-549f-58d6-feeda55f7801:<strong># pvscan<\/strong>\n<pre>PV \/dev\/sda3 VG VG_XenStorage-39baf126-a535-549f-58d6-feeda55f7801 lvm2 [66.87 GB \/ 57.87 GB free]\r\nTotal: 1 [66.87 GB] \/ in use: 1 [66.87 GB] \/ in no VG: 0 [0 ]<\/pre>\n<\/li>\n<li>Note the output above, the VG name of the local drive \/dev\/sda3 is VG_XenStorage-39baf126-a535-549f-58d6-feeda55f7801 . The VG name contains the SR UUID that resides on this storage media. In this case, the UUID is 39baf126-a535-549f-58d6-feeda55f7801.<\/li>\n<li>Introduce the SR with the following command:<strong># xe sr-introduce uuid=39baf126-a535-549f-58d6-feeda55f7801 type=ext name-label=\u201dLocal storage\u201d content-type=user<\/strong><br \/>\nThis command sets up database records for the SR named \u201cLocal storage\u201d.<\/li>\n<li>Locate the SCSI ID of the device or partition where the SR data is stored:<br \/>\n<strong># ls -l \/dev\/disk\/by-id\/<\/strong><\/p>\n<pre>total 0\r\nlrwxrwxrwx 1 root root 9 Jan 15 09:44 scsi-SATA_ST3500320AS_9QM13WP2 -&gt; ..\/..\/sdb\r\nlrwxrwxrwx 1 root root 10 Jan 15 09:44 scsi-SATA_ST3500320AS_9QM13WP2-part1 -&gt; ..\/..\/sdb1\r\nlrwxrwxrwx 1 root root 9 Jan 15 09:44 scsi-SATA_ST380815AS_6QZ5Z1AM -&gt; ..\/..\/sda\r\nlrwxrwxrwx 1 root root 10 Jan 15 09:44 scsi-SATA_ST380815AS_6QZ5Z1AM-part1 -&gt; ..\/..\/sda1\r\nlrwxrwxrwx 1 root root 10 Jan 15 09:44 scsi-SATA_ST380815AS_6QZ5Z1AM-part2 -&gt; ..\/..\/sda2\r\nlrwxrwxrwx 1 root root 10 Jan 15 09:44 scsi-SATA_ST380815AS_6QZ5Z1AM-part3 -&gt; ..\/..\/sda3<\/pre>\n<p>In this case, the SCSI ID of the device \/dev\/sda3 is scsi-SATA_ST380815AS_6QZ5Z1AM-part3. This is the device name to use in the next command, where a PBD (physical block device \u2013 a connector between the XenServer host and the SR) is created.<\/li>\n<li>Run the xe host-list command to find out the host UUID for the local host:<br \/>\n<strong># xe host-list<\/strong><\/p>\n<pre>uuid ( RO) : 83f2c775-57fc-457b-9f98-2b9b0a7dbcb5\r\nname-label ( RW): xenserver1\r\nname-description ( RO): Default install of XenServer<\/pre>\n<\/li>\n<li>Create the PBD using the device SCSI ID, host UUID and SR UUID detected above:<br \/>\n<strong># xe pbd-create sr-uuid=39baf126-a535-549f-58d6-feeda55f7801<br \/>\ndevice-config:device=\/dev\/disk\/by-id\/scsi-SATA_ST380815AS_6QZ5Z1AM-part3 host-uuid=83f2c775-57fc-457b-9f98-2b9b0a7dbcb5<br \/>\naec2c6fc-e1fb-0a27-2437-9862cffe213e<\/strong><\/li>\n<li>Attach the PBD created with<strong> xe pbd-plug <\/strong>command:<br \/>\n<strong># xe pbd-plug uuid=aec2c6fc-e1fb-0a27-2437-9862cffe213e<\/strong><br \/>\nThe SR should be connected to the XenServer host and be visible in XenCenter.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Do a pvscan to get the Universally Unique Identifier (U &hellip; <a href=\"https:\/\/old.ice.com.tw\/?p=12\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Xenserver\u6dfb\u52a0\u5b58\u5728\u8cc7\u6599\u7684\u7b2c\u4e8c\u9846\u786c\u789f\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-link","hentry","category-xenserver","post_format-post-format-link"],"_links":{"self":[{"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/12","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=12"}],"version-history":[{"count":1,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":13,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions\/13"}],"wp:attachment":[{"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/old.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}