Rabu, 03 September 2014

Citrix XenServer - Seri 2 (Storage)

Setelah pada tutorial yang lalu kita membahas partisi default dan hubungan antara VM, VBD, VDI, SR, PBD dan Host pada XenServer 6.2.0 diatas mesin virtual, maka kali ini kita akan melihat secara langsung hubungan, partisi default dan lain sebagainya yang ada pada Citrix XenServer 6.2.0 yang diinstall diatas PC Server Motherboard Intel S5500BC dengan Processor Intel Xeon Quad Core. Saya telah menginstall Citrix XenServer 6.2.0 diatas PC Server tersebut dengan kondisi memiliki 1 SATA Hardisk 500GB, beberapa USB Port, 3 NIC, 1 DVD Drive dan 6 GB RAM. Nah setelah instalasi selesai, saya men-shutdown XenServer, kemudian menambahkan lagi 1 buah Hardisk SATA 500GB. Hardisk ini dikenali sebagai "/dev/sdb". Hal ini penting untuk diingat, karena saat akan menambahkan hardisk ini ke SR, kita akan menemui pesan error yang menurut saya cukup sulit mendapatkan solusinya langsung dari google.
Baiklah, langsung saja kita lihat partisi default yang dibuat oleh Citrix XenServer saat instalasi pada single hardisk SATA 500GB. Perhatikan output dari perintah-perintah berikut ini.

[root@xenserver-master ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 500.1 GB, 500107862016 bytes
256 heads, 63 sectors/track, 60563 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60564   488386583+  ee  EFI GPT

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/dm-0: 498.9 GB, 498999492608 bytes
255 heads, 63 sectors/track, 60666 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
[root@xenserver-master ~]# pvs
  PV         VG                                                 Fmt  Attr PSize   PFree  
  /dev/sda3  VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308 lvm2 a-   457,75G 457,75G
[root@xenserver-master ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308
  PV Size               457,76 GB / not usable 9,12 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              117184
  Free PE               117183
  Allocated PE          1
  PV UUID               F2aZeQ-JBql-Vrnb-t55F-nsYb-ExBn-Av92rK
   
[root@xenserver-master ~]# vgdisplay
  --- Volume group ---
  VG Name               VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               457,75 GB
  PE Size               4,00 MB
  Total PE              117184
  Alloc PE / Size       1 / 4,00 MB
  Free  PE / Size       117183 / 457,75 GB
  VG UUID               Kz279D-np3Y-Zh7a-26j2-Mg63-N9dq-9JlnXl
   
[root@xenserver-master ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308/MGT
  VG Name                VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308
  LV UUID                1RQvRd-hchx-4hyq-aqXY-ZMPK-yTnY-fG6SVH
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                4,00 MB
  Current LE             1
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           252:1
   
[root@xenserver-master ~]# cat /proc/partitions 
major minor  #blocks  name

   7        0      52378 loop0
   8        0  488386584 sda
   8        1    4193297 sda1
   8        2    4193297 sda2
   8        3  479996935 sda3
   8       16  488386584 sdb
 252        0  487304192 dm-0
 252        1       4096 dm-1


Perhatikan bahwa XenServer membagi partisi menjadi 3, yaitu "/dev/sda1" dan "/dev/sda2" sebesar 4GB, dan "/dev/sda3" adalah sisanya yaitu sebesar 457,76 GB. Dan partisi "/dev/sda3" juga merupakan sebuah partisi yang bertipe LVM yang mempunyai Volume Group Name "VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308". VG ini memiliki kapasitas total yang dapat digunakan sebesar 457,75 GB. Dan VG ini telah berisi 1 buah partisi LV dengan nama "MGT" yang kapasitasnya sebesar 4 MB.
Sekali lagi saya ingatkan bahwa hardisk kedua dikenali sebagai "/dev/sdb" dan hardisk ini saya pasang di host setelah proses instalasi selesai dan kondisi host shutdown. Lihatlah dari perintah perintah terakhir diatas, ada 2 partisi yang di-mount sebagai dm-1 dan dm-0. Perhatikan kembali secara teliti bahwa dm-0 memiliki kapasitas sebesar 487304192 byte hampir mendekati kapasitas "/dev/sdb" yang sebesar 500 GB..
Selanjutnya kita akan melihat PBD, SR, VDI, VBD dan VM yang telah tersedia beserta keterkaitannya. Perhatikan output perintah-perintah berikut.

[root@xenserver-master ~]# xe vm-list
uuid ( RO)           : 20ee3e53-1487-4212-915a-3eab2582be4b
     name-label ( RW): Control domain on host: xenserver-master
    power-state ( RO): running


[root@xenserver-master ~]# xe vbd-list 
[root@xenserver-master ~]# xe vdi-list 
uuid ( RO)                : a0dbf564-c69b-4f81-ad51-371ea212116a
          name-label ( RW): XenCenter.iso
    name-description ( RW): 
             sr-uuid ( RO): b58a4904-7c6d-e79d-7367-c0160e6bb77a
        virtual-size ( RO): 53635072
            sharable ( RO): false
           read-only ( RO): true


uuid ( RO)                : 37e519cf-e31a-47bf-aabd-52c6feb43c1d
          name-label ( RW): xs-tools.iso
    name-description ( RW): 
             sr-uuid ( RO): b58a4904-7c6d-e79d-7367-c0160e6bb77a
        virtual-size ( RO): 119197696
            sharable ( RO): false
           read-only ( RO): true


uuid ( RO)                : 2dd1f27a-1755-423c-a331-0ac14c6030a5
          name-label ( RW): SCSI 0:0:0:0
    name-description ( RW): TSSTcorp model CDDVDW SH-S223C rev SB06 type 5
             sr-uuid ( RO): e4d972a7-9a61-01b7-f0de-ab7b402ca8c8
        virtual-size ( RO): 1073741312
            sharable ( RO): false
           read-only ( RO): true


[root@xenserver-master ~]# xe sr-list
uuid ( RO)                : e8fe919f-5899-6432-3429-f571180fc308
          name-label ( RW): Local storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): lvm
        content-type ( RO): user


uuid ( RO)                : bfebfb6b-6bfd-d96e-dc6a-90d6851ab2db
          name-label ( RW): Removable storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): udev
        content-type ( RO): disk


uuid ( RO)                : b58a4904-7c6d-e79d-7367-c0160e6bb77a
          name-label ( RW): XenServer Tools
    name-description ( RW): XenServer Tools ISOs
                host ( RO): xenserver-master
                type ( RO): iso
        content-type ( RO): iso


uuid ( RO)                : e4d972a7-9a61-01b7-f0de-ab7b402ca8c8
          name-label ( RW): DVD drives
    name-description ( RW): Physical DVD drives
                host ( RO): xenserver-master
                type ( RO): udev
        content-type ( RO): iso


[root@xenserver-master ~]# xe pbd-list 
uuid ( RO)                  : 09104c2b-d933-0c6c-d7f8-a5292b685fae
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): bfebfb6b-6bfd-d96e-dc6a-90d6851ab2db
         device-config (MRO): location: /dev/xapi/block
    currently-attached ( RO): true


uuid ( RO)                  : 00b9b1d4-aa1d-08da-2ed0-ae984c6dd5b7
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): e4d972a7-9a61-01b7-f0de-ab7b402ca8c8
         device-config (MRO): location: /dev/xapi/cd
    currently-attached ( RO): true


uuid ( RO)                  : 7fc42cc2-9324-9447-1727-74b92b67a70c
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): e8fe919f-5899-6432-3429-f571180fc308
         device-config (MRO): device: /dev/disk/by-id/scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part3
    currently-attached ( RO): true


uuid ( RO)                  : 0320a7e9-035d-3140-ff0f-db1d7a7bd4a1
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): b58a4904-7c6d-e79d-7367-c0160e6bb77a
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true

"xe vm-list" menunjukkan hanya ada 1 VM yaitu Domain 0 atau Control Domain, sebuah VM yang memiliki privillege khusus dan fungsi-fungsi lainnya, seperti yang telah kita singgung pada tutorial sebelumnya. Perintah selanjutnya menunjukkan tidak ada satupun VBD yang telah dibuat, karena memang belum ada satupun VM yang di-create. Perintah ke tiga menunjukkan sudah ada 4 VDI yang dibuat secara default, yaitu 1 VDI merepresentasikan keberadaan CD Image dengan format ISO seperti yang telah kita bahas di tutorial sebelumnya, 1 VDI lagi merepresentasikan keberadaan DVD drive pada host XenServer, 1 VDI lagi merepresentasikan keberadaan Port-port USB pada host, yang biasa dikenal dengan Removable Storage, dan yang terakhir adalah 1 VDI yang merepresentasikan keberadaan "/dev/sda3" sebagai partisi LVM. Semuanya persis seperti yang telah kita bahas pada tutorial sebelumnya. Silahkan membaca kembali tutorial sebelumnya untuk keterangan lebih detail disini. Perintah ke empat menunjukkan daftar SR yang ada, lagi-lagi sama seperti tutorial sebelumny ada 4 SR default yaitu :
  • 1 SR berjenis LVM, sebagai informasi keberadaan partisi LVM dari "/dev/sda3".
  • 2 SR berjenis udev, yang satu untuk Removable Storage (Port USB) dan yang satunya untuk DVD drive.
  • 1 SR berjenis ISO, sebagai informasi keberadaan file ISO, telah disebutkan diatas.
Dan yang terakhir adalah PBD. Juga lagi-lagi sama seperti tutorial sebelumnya, terdapat 4 PBD yang menginformasikan lokasi hardware dari masing-masing SR yang ada. Informasi yang diberikan oleh PBD antara lain :
  • PBD pertama dengan uuid = 09104c2b-d933-0c6c-d7f8-a5292b685fae, mengandung informasi bahwa SR dengan label "Removable Storage" memiliki lokasi di "/dev/xapi/block" pada host.
  • PBD kedua dengan uuid = 00b9b1d4-aa1d-08da-2ed0-ae984c6dd5b7, mengandung informasi bahwa SR dengan label "DVD Drives" memiliki lokasi di "/dev/xapi/cd" pada host.
  • PBD ketiga dengan uuid = 7fc42cc2-9324-9447-1727-74b92b67a70c, mengandung informasi bahwa SR dengan label "Local Storage" adalah sebuah device yang dikenal sebagai "/dev/disk/by-id/scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part3".
  • PBD keempat dengan uuid = 0320a7e9-035d-3140-ff0f-db1d7a7bd4a1, mengandung informasi bahwa SR dengan label "XenServers Tools", file-file ISO nya berada di "/opt/xensource/packages/iso" pada host.
Seperti biasanya, setelah instalasi XenServer 6.2.0 SR default yang bisa dilihat dari XenCenter hanya 3 SR saja, seperti terlihat pada  gambar dibawah ini.

Sampai disini kita telah selesai. Selanjutnya adalah membuat VM yang baru, namun sebelumnya kita akan menjadikan hardisk "/dev/sdb" sebagai local storage yang baru untuk menjadi Backup Storage. Untuk itu kita akan menambahkannya sebagai SR yang baru dengan tipe LVM. Gunakan perintah berikut ini.

[root@xenserver-master ~]# fdisk -l 

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 500.1 GB, 500107862016 bytes
256 heads, 63 sectors/track, 60563 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60564   488386583+  ee  EFI GPT

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/dm-0: 498.9 GB, 498999492608 bytes
255 heads, 63 sectors/track, 60666 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System

[root@xenserver-master ~]# xe host-list
uuid ( RO)                : e8d62a67-23b6-4a27-b276-f4129e3bcf48
          name-label ( RW): xenserver-master
    name-description ( RW): Default install of XenServer


[root@xenserver-master ~]# xe sr-create host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 content-type=user name-label="Backup Storage" shared=false device-config:device=/dev/sdb type=lvm
The SR operation cannot be performed because a device underlying the SR is in use by the host.

Uuupss..,ternyata hardisk "sdb" tidak bisa ditambahkan ke dalam SR sebagai local storage bertipe LVM. Ternyata operasi diatas memunculkan pesan "The SR operation cannot be performed because a device underlying the SR is in use by the host.". Apakah yang terjadi ?. Perhatikan output perintah berikut ini.

[root@xenserver-master ~]# cat /proc/partitions 
major minor  #blocks  name

   7        0      52378 loop0
   8        0  488386584 sda
   8        1    4193297 sda1
   8        2    4193297 sda2
   8        3  479996935 sda3
   8       16  488386584 sdb
 252        0  487304192 dm-0
 252        1       4096 dm-1

Baiklah, saya akan menggunakan perintah yang kedua. Perhatikan perintah berikut ini.

[root@xenserver-master ~]# xe sr-create host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 content-type=user name-label="Backup Storage" shared=false device-config:device=/dev/dm-0 type=lvm
05412087-5870-d6c0-0423-8e8f625efa20
[root@xenserver-master ~]# xe sr-list 
uuid ( RO)                : e8fe919f-5899-6432-3429-f571180fc308
          name-label ( RW): Local storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): lvm
        content-type ( RO): user


uuid ( RO)                : bfebfb6b-6bfd-d96e-dc6a-90d6851ab2db
          name-label ( RW): Removable storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): udev
        content-type ( RO): disk


uuid ( RO)                : b58a4904-7c6d-e79d-7367-c0160e6bb77a
          name-label ( RW): XenServer Tools
    name-description ( RW): XenServer Tools ISOs
                host ( RO): xenserver-master
                type ( RO): iso
        content-type ( RO): iso


uuid ( RO)                : 05412087-5870-d6c0-0423-8e8f625efa20
          name-label ( RW): Backup Storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): lvm
        content-type ( RO): user


uuid ( RO)                : e4d972a7-9a61-01b7-f0de-ab7b402ca8c8
          name-label ( RW): DVD drives
    name-description ( RW): Physical DVD drives
                host ( RO): xenserver-master
                type ( RO): udev
        content-type ( RO): iso


[root@xenserver-master ~]# pvs
  PV                                                                VG                                                 Fmt  Attr PSize   PFree  
  /dev/mapper/ddf1_4c5349202020202080862925000000004711471100001450 VG_XenStorage-05412087-5870-d6c0-0423-8e8f625efa20 lvm2 a-   464,72G 464,71G
  /dev/sda3                                                         VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308 lvm2 a-   457,75G 457,75G
[root@xenserver-master ~]# 

Akhirnya SR baru dengan tipe LVM berhasil dibuat. Berikut adalah perubahan yang terjadi pada host.

[root@xenserver-master ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 500.1 GB, 500107862016 bytes
256 heads, 63 sectors/track, 60563 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60564   488386583+  ee  EFI GPT

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/dm-0: 498.9 GB, 498999492608 bytes
255 heads, 63 sectors/track, 60666 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

[root@xenserver-master ~]# pvs
  PV                                                                VG                                                 Fmt  Attr PSize   PFree  
  /dev/mapper/ddf1_4c5349202020202080862925000000004711471100001450 VG_XenStorage-05412087-5870-d6c0-0423-8e8f625efa20 lvm2 a-   464,72G 464,71G
  /dev/sda3                                                         VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308 lvm2 a-   457,75G 457,75G

[root@xenserver-master ~]# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Sep  4 08:05 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0040258 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep  4 08:05 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  4 08:05 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  4 08:05 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  4 08:05 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part3 -> ../../sda3

[root@xenserver-master ~]# ls -l /dev/disk/by-
by-id/      by-label/   by-path/    by-scsibus/ by-scsid/   by-uuid/    
 
[root@xenserver-master ~]# ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 10 Sep  4 08:05 root-zjlmllpm -> ../../sda1

[root@xenserver-master ~]# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Sep  4 08:05 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 Sep  4 08:05 pci-0000:00:1f.2-scsi-1:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  4 08:05 pci-0000:00:1f.2-scsi-1:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  4 08:05 pci-0000:00:1f.2-scsi-1:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  4 08:05 pci-0000:00:1f.2-scsi-1:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root  9 Sep  4 08:05 pci-0000:00:1f.2-scsi-3:0:0:0 -> ../../sdb

[root@xenserver-master ~]# ls -l /dev/disk/by-scsibus/
total 0
lrwxrwxrwx 1 root root 9 Sep  4 08:05 SATA_WDC_WD5001AALS-_WD-WMAYP0040258-3:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 9 Sep  4 08:05 SATA_WDC_WD5001AALS-_WD-WMAYP0061640-1:0:0:0 -> ../../sda

[root@xenserver-master ~]# ls -l /dev/disk/by-scsid/
total 0
drwxr-xr-x 2 root root 60 Sep  4 08:05 ddf1_4c5349202020202080862925000000004711471100001450
drwxr-xr-x 2 root root 60 Sep  4 08:05 SATA_WDC_WD5001AALS-_WD-WMAYP0040258
drwxr-xr-x 2 root root 60 Sep  4 08:05 SATA_WDC_WD5001AALS-_WD-WMAYP0061640

[root@xenserver-master ~]# xe sr-list name-label=Backup\ Storage 
uuid ( RO)                : 05412087-5870-d6c0-0423-8e8f625efa20
          name-label ( RW): Backup Storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): lvm
        content-type ( RO): user


[root@xenserver-master ~]# xe vdi-list sr-uuid=05412087-5870-d6c0-0423-8e8f625efa20 
[root@xenserver-master ~]# xe pbd-list sr-uuid=05412087-5870-d6c0-0423-8e8f625efa20 
uuid ( RO)                  : 0beb8048-0d73-6cba-06b3-e6a7b42b7592
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): 05412087-5870-d6c0-0423-8e8f625efa20
         device-config (MRO): device: /dev/dm-0
    currently-attached ( RO): true


[root@xenserver-master ~]# xe pbd-list sr-uuid=05412087-5870-d6c0-0423-8e8f625efa20 params=all 
uuid ( RO)                  : 0beb8048-0d73-6cba-06b3-e6a7b42b7592
     host ( RO) [DEPRECATED]: e8d62a67-23b6-4a27-b276-f4129e3bcf48
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
       host-name-label ( RO): xenserver-master
               sr-uuid ( RO): 05412087-5870-d6c0-0423-8e8f625efa20
         sr-name-label ( RO): Backup Storage
         device-config (MRO): device: /dev/dm-0
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:1452abf5-536f-bee6-a4ba-4ce21d2988d2

Walaupun SR LVM baru berhasil di-create, namun saya belum yakin dengan langkah-langkah yang saya lakukan karena belum sesuai dengan instruksi citrix. Akhirnya saya men-destroy SR tersebut untuk mengembalikan hardisk ke "/dev/sdb" ke posisi semula dengan tujuan untuk me-create SR kembali sesuai dengan instruksi cirtix.

[root@xenserver-master ~]# xe sr-list name-label=Backup\ Storage 
uuid ( RO)                : 05412087-5870-d6c0-0423-8e8f625efa20
          name-label ( RW): Backup Storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): lvm
        content-type ( RO): user


[root@xenserver-master ~]# xe pbd-list sr-uuid=05412087-5870-d6c0-0423-8e8f625efa20 
uuid ( RO)                  : 0beb8048-0d73-6cba-06b3-e6a7b42b7592
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): 05412087-5870-d6c0-0423-8e8f625efa20
         device-config (MRO): device: /dev/dm-0
    currently-attached ( RO): true


[root@xenserver-master ~]# xe pbd-unplug uuid=0beb8048-0d73-6cba-06b3-e6a7b42b7592 
[root@xenserver-master ~]# xe pbd-list sr-uuid=05412087-5870-d6c0-0423-8e8f625efa20 
uuid ( RO)                  : 0beb8048-0d73-6cba-06b3-e6a7b42b7592
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): 05412087-5870-d6c0-0423-8e8f625efa20
         device-config (MRO): device: /dev/dm-0
    currently-attached ( RO): false

[root@xenserver-master ~]# xe sr-destroy uuid=05412087-5870-d6c0-0423-8e8f625efa20 

[root@xenserver-master ~]# xe pbd-list 
uuid ( RO)                  : 09104c2b-d933-0c6c-d7f8-a5292b685fae
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): bfebfb6b-6bfd-d96e-dc6a-90d6851ab2db
         device-config (MRO): location: /dev/xapi/block
    currently-attached ( RO): true


uuid ( RO)                  : 00b9b1d4-aa1d-08da-2ed0-ae984c6dd5b7
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): e4d972a7-9a61-01b7-f0de-ab7b402ca8c8
         device-config (MRO): location: /dev/xapi/cd
    currently-attached ( RO): true


uuid ( RO)                  : 7fc42cc2-9324-9447-1727-74b92b67a70c
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): e8fe919f-5899-6432-3429-f571180fc308
         device-config (MRO): device: /dev/disk/by-id/scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part3
    currently-attached ( RO): true


uuid ( RO)                  : 0320a7e9-035d-3140-ff0f-db1d7a7bd4a1
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): b58a4904-7c6d-e79d-7367-c0160e6bb77a
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true

[root@xenserver-master ~]# cat /proc/partitions 
major minor  #blocks  name

   7        0      52378 loop0
   8        0  488386584 sda
   8        1    4193297 sda1
   8        2    4193297 sda2
   8        3  479996935 sda3
   8       16  488386584 sdb
 252        0  487304192 dm-0
 252        1       4096 dm-1

[root@xenserver-master ~]#

Sekarang "/dev/dm-0" sudah tidak ada di daftar SR, PBD terkait juga sudah tidak ada, dan PV & VG yang dibentuk dari "/dev/dm-0" juga sudah tidak ada. Selanjutnya saya akan melakukan reboot untuk memastikan kondisi sistem benar-benar fresh. Kemudian saya akan me-create SR LVM baru dengan parameter yang sesuai dengan instruksi citrix disini.


[root@xenserver-master ~]# ll /dev/disk/by-
by-id/      by-label/   by-path/    by-scsibus/ by-scsid/   by-uuid/

[root@xenserver-master ~]# ll /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 10 Sep  4 09:37 root-zjlmllpm -> ../../sda1

[root@xenserver-master ~]# ll /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Sep  4 09:37 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root  9 Sep  4 09:37 pci-0000:00:1f.2-scsi-3:0:0:0 -> ../../sdb

[root@xenserver-master ~]# ll /dev/disk/by-scsibus/
total 0
lrwxrwxrwx 1 root root 9 Sep  4 09:37 SATA_WDC_WD5001AALS-_WD-WMAYP0040258-3:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 9 Sep  4 09:37 SATA_WDC_WD5001AALS-_WD-WMAYP0061640-1:0:0:0 -> ../../sda

[root@xenserver-master ~]# ll /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0040258 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part3 -> ../../sda3

[root@xenserver-master ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0040258 host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 name-label="Backup Storage" shared=false type=lvm
The SR operation cannot be performed because a device underlying the SR is in use by the host.


[root@xenserver-master ~]# ll /dev/disk/by-scsi
by-scsibus/ by-scsid/   

[root@xenserver-master ~]# ll /dev/disk/by-scsi
by-scsibus/ by-scsid/   

[root@xenserver-master ~]# ll /dev/disk/by-scsid/
total 0
drwxr-xr-x 2 root root 60 Sep  4 09:37 ddf1_4c5349202020202080862925000000004711471100001450
drwxr-xr-x 2 root root 60 Sep  4 09:37 SATA_WDC_WD5001AALS-_WD-WMAYP0040258
drwxr-xr-x 2 root root 60 Sep  4 09:37 SATA_WDC_WD5001AALS-_WD-WMAYP0061640

[root@xenserver-master ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-scsid/SATA_WDC_WD5001AALS-_WD-WMAYP0040258 host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 name-label="Backup Storage" shared=false type=lvm
The SR operation cannot be performed because a device underlying the SR is in use by the host.

 
[root@xenserver-master ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-scsibus/SATA_WDC_WD5001AALS-_WD-WMAYP0040258-3:0:0:0 host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 name-label="Backup Storage" shared=false type=lvm
The SR operation cannot be performed because a device underlying the SR is in use by the host.

[root@xenserver-master ~]# ll /dev/disk/by-
by-id/      by-label/   by-path/    by-scsibus/ by-scsid/   by-uuid/    
[root@xenserver-master ~]# ll /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 10 Sep  4 09:37 root-zjlmllpm -> ../../sda1
[root@xenserver-master ~]# ll /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Sep  4 09:37 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  4 09:37 pci-0000:00:1f.2-scsi-1:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root  9 Sep  4 09:37 pci-0000:00:1f.2-scsi-3:0:0:0 -> ../../sdb
[root@xenserver-master ~]# ll /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Sep  4 09:37 477f9ef1-8f6a-45eb-af23-6c0c1ca1efbf -> ../../sda1

[root@xenserver-master ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-path/pci-0000:00:1f.2-scsi-3:0:0:0 host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 name-label="Backup Storage" shared=false type=lvm
The SR operation cannot be performed because a device underlying the SR is in use by the host.

[root@xenserver-master ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-scsid/ddf1_4c5349202020202080862925000000004711471100001450 host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 name-label="Backup Storage" shared=false type=lvm
The SR operation cannot be performed because a device underlying the SR is in use by the host.

[root@xenserver-master ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 500.1 GB, 500107862016 bytes
256 heads, 63 sectors/track, 60563 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60564   488386583+  ee  EFI GPT

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/dm-0: 498.9 GB, 498999492608 bytes
255 heads, 63 sectors/track, 60666 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
[root@xenserver-master ~]# cat /proc/partitions 
major minor  #blocks  name

   7        0      52378 loop0
   8        0  488386584 sda
   8        1    4193297 sda1
   8        2    4193297 sda2
   8        3  479996935 sda3
   8       16  488386584 sdb
 252        0  487304192 dm-0
 252        1       4096 dm-1
[root@xenserver-master ~]# ll /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0040258 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  4 09:37 scsi-SATA_WDC_WD5001AALS-_WD-WMAYP0061640-part3 -> ../../sda3

[root@xenserver-master ~]# ll /dev/mapper/
control                                                      VG_XenStorage--e8fe919f--5899--6432--3429--f571180fc308-MGT
ddf1_4c5349202020202080862925000000004711471100001450 

Namun tidak ada satupun perintah diatas yang berhasil me-create sebuah SR LVM yang baru. Maka saya terpaksa menggunakan cara saya sebelumnya walaupun cara ini tidak ada di dalam Citrix XenServer Guide maupun pedoman langsung dari website citrix.

[root@xenserver-master ~]# xe sr-create host-uuid=e8d62a67-23b6-4a27-b276-f4129e3bcf48 content-type=user name-label="Backup Storage" shared=false device-config:device=/dev/dm-0 type=lvm
cea7f560-d527-daf3-1f03-749231a04912
[root@xenserver-master ~]# xe pbd-list sr-name-label=Backup\ Storage 
uuid ( RO)                  : 66c86cae-e662-2b7c-2707-71e19d056de6
             host-uuid ( RO): e8d62a67-23b6-4a27-b276-f4129e3bcf48
               sr-uuid ( RO): cea7f560-d527-daf3-1f03-749231a04912
         device-config (MRO): device: /dev/dm-0
    currently-attached ( RO): true


[root@xenserver-master ~]# xe sr-list uuid=cea7f560-d527-daf3-1f03-749231a04912 
uuid ( RO)                : cea7f560-d527-daf3-1f03-749231a04912
          name-label ( RW): Backup Storage
    name-description ( RW): 
                host ( RO): xenserver-master
                type ( RO): lvm
        content-type ( RO): user


[root@xenserver-master ~]# xe vdi-list sr-uuid=cea7f560-d527-daf3-1f03-749231a04912 
[root@xenserver-master ~]# pvs
  PV                                                                VG                                                 Fmt  Attr PSize   PFree  
  /dev/mapper/ddf1_4c5349202020202080862925000000004711471100001450 VG_XenStorage-cea7f560-d527-daf3-1f03-749231a04912 lvm2 a-   464,72G 464,71G
  /dev/sda3                                                         VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308 lvm2 a-   457,75G 457,75G
[root@xenserver-master ~]# vgs
  VG                                                 #PV #LV #SN Attr   VSize   VFree  
  VG_XenStorage-cea7f560-d527-daf3-1f03-749231a04912   1   1   0 wz--n- 464,72G 464,71G
  VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308   1   1   0 wz--n- 457,75G 457,75G
[root@xenserver-master ~]# lvs
  LV   VG                                                 Attr   LSize Origin Snap%  Move Log Copy%  Convert
  MGT  VG_XenStorage-cea7f560-d527-daf3-1f03-749231a04912 -wi-a- 4,00M                                      
  MGT  VG_XenStorage-e8fe919f-5899-6432-3429-f571180fc308 -wi-a- 4,00M                                      
[root@xenserver-master ~]# 

Baiklah untuk tutoril kali ini kita cukupkan sampai disini saja. Pada tutorial selanjutnya insya Allah kita akan me-create sebuah VM baru dan melihat perubahan yang terjadi pada storage. Dan berikut saya berikan skema kondisi terakhir storage yang ada di host xenserver.


Dan gambar dibawah ini adalah penampakan SR "Backup Storage" dari XenCenter.


Tidak ada komentar:

Posting Komentar