티스토리 뷰

Citrix XenServer - Seri 1 (Storage)

1. Storage 

Storage pada XenServer dapat berupa EXT3, LVM, NFS, iSCSI, HBA, iSL NetApp, iSL EqualLogic dan iSL EMC VNX. Kesemuanya juga dikenal dengan Storage Repository Format. Disini kita akan membahas Storage Repository yang berasal dari Hardisk Lokal yang berformat LVM. Sebelum melanjutkan pembahasan, lihatlah gambar dibawah ini, yang menjelaskan antara keterkaitan Storage Repository (SR) dengan objek yang terkait.


Gambar 1. Hubungan antara Storage Repository dan Objek Terkait

PBD merepresentasikan interface antara server fisik dengan SR yang terhubung (attached).
SR menggambarkan sebuah storage target tertentu dimana tempat VDI disimpan.
VDI adalah sebuah storage yang bersifat abstrak yang direpresentasikan kepada sebuah Virtual Machine (VM) yang merepresentasikan disk fisik.
VBD adalah konektor objek (mirip dengan PBD) yang memungkinkan pemetaan antara VDI-VDI dengan VM-VM yang ada.

Agar lebih memahami maksud dari istilah-istilah diatas, marilah kita sedikit membedah pemetaan storage pada sebuah host XenServer. Disini saya telah menginstall Citrix XenServer 6.2.0 pada PC Virtual diatas hardisk 20 GB. Struktur hardisk yang terbentuk adalah sebagai berikut.

[root@xenserver1-onVM ~]# fdisk -l

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


Disk /dev/sda: 21.4 GB, 21474836480 bytes
256 heads, 63 sectors/track, 2600 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

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

[root@xenserver1-onVM ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             4,0G  1,9G  2,0G  50% /
none                  381M   16K  381M   1% /dev/shm
/opt/xensource/packages/iso/XenCenter.iso
                       52M   52M     0 100% /var/xen/xc-install

[root@xenserver1-onVM ~]# ll /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Sep  1  2014 3251a42e-67dc-456a-82ef-5031c12f360d -> ../../sda1

[root@xenserver1-onVM ~]# ll /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 10 Sep  1  2014 root-vggxxrja -> ../../sda1

[root@xenserver1-onVM ~]# ll /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Sep  1  2014 pci-0000:00:07.1-scsi-1:0:0:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 Sep  1  2014 pci-0000:00:10.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  1  2014 pci-0000:00:10.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep  1  2014 pci-0000:00:10.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  1  2014 pci-0000:00:10.0-scsi-0:0:0:0-part3 -> ../../sda3
 
[root@xenserver1-onVM ~]# cat /proc/partitions 
major minor  #blocks  name

   7        0      52378 loop0
   8        0   20971520 sda
   8        1    4193297 sda1
   8        2    4193297 sda2
   8        3   12581871 sda3
 252        0       4096 dm-0

[root@xenserver1-onVM ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  PV Size               12,00 GB / not usable 9,14 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              3069
  Free PE               3068
  Allocated PE          1
  PV UUID               k4hA6N-sABZ-7Itk-FVcQ-2Sbp-3llU-cNefGw
   
[root@xenserver1-onVM ~]# vgdisplay
  --- Volume group ---
  VG Name               VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  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               11,99 GB
  PE Size               4,00 MB
  Total PE              3069
  Alloc PE / Size       1 / 4,00 MB
  Free  PE / Size       3068 / 11,98 GB
  VG UUID               xQXGog-x4Vt-0x3w-HCQu-SMXu-phun-MSioFc
   
[root@xenserver1-onVM ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e/MGT
  VG Name                VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  LV UUID                oNz7MX-Opll-5Y73-QCRf-11XD-mERP-QgSaBh
  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:0

Lihatlah bahwa partisi hardisk dibagi menjadi 3. Hardisk ini dikenali sebagai "/dev/sda" dengan kapasitas 21,4GB. Partisi yang bisa dilihat oleh perintah "fdisk" hanyalah partisi "/dev/sda1" yang berukuran 4GB. Untuk melihat seluruh partisi hardisk digunakan perintah "ll /dev/disk/by-path". Kemudian kita lihat lagi output dari perintah "cat /proc/partitions" memperlihatkan kapasitas partisi-partisi yang ada. Dan yang terakhir adalah perintah "pvdisplay", "vgdisplay" dan "lvdisplay" untuk melihat informasi-informasi dari partisi-partisi LVM yang dibentuk.

Kemudian kita akan melihat keterkaitan antara XenServer Host, PBD, SR, VDI, VBD dan VM. Untuk itu pertama-tama kita harus melihat informasi host XenServer yang sedang kita gunakan ini :

[root@xenserver1-onVM ~]# xe host-list
uuid ( RO)                : 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
          name-label ( RW): xenserver1-onVM
    name-description ( RW): Default install of XenServer

Yang perlu dicatat dari keterangan yang dihasilkan adalah host-id (uuid). Ini sangat penting untuk diketahui dan diingat. 


Physical Block Device (PBD)

Untuk melihat secara detail informasi PBD yang ada ketikkan perintah-perintah berikut :

[root@xenserver1-onVM ~]# xe pbd-list params=all 
uuid ( RO)                  : 1ee534d0-9039-e909-b168-2918fa59a397
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 0e044c79-b607-da8c-9a57-c3428db2ad79
         sr-name-label ( RO): DVD drives
         device-config (MRO): location: /dev/xapi/cd
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156


uuid ( RO)                  : f80e90f9-5db0-2fc9-c762-1d99e34e4d08
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
         sr-name-label ( RO): XenServer Tools
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156


uuid ( RO)                  : 6e9f37f7-dcd1-94bd-2f25-98b46835a9d6
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 2097e602-47db-a6ca-9dee-a462f1836d6e
         sr-name-label ( RO): Local storage
         device-config (MRO): device: /dev/sda3
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156


uuid ( RO)                  : 8db9cd7e-a107-8ff2-769c-537240b1a370
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): f8cba5eb-438f-95d5-cd5e-16edb8ce734a
         sr-name-label ( RO): Removable storage
         device-config (MRO): location: /dev/xapi/block
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156

Jadi secara default, pada saat instalasi XenServer membuat 4 SR seperti output perintah diatas, yang juga tentunya membuat PBD yang menghubungkannya dengan host XenServer itu sendiri. Dari sini kita dapat menggambarkan informasi storage pada host xenserver sebagai berikut.

Tampak masing-masing menunjukkan nomor id PBD tersebut (uuid), Host ID XenServer (host-uuid), SR ID (sr-uuid) dan lain-lainnya yang terkait.


Storage Repository
  
Tahap selanjutnya kita akan memeriksa informasi SR yang ada. Gunakan SR Command untuk melihat informasi-informasi setiap SR yang ada. 

root@xenserver1-onVM ~]# xe sr-
sr-create                         sr-param-clear 
sr-destroy                        sr-param-get 
sr-disable-database-replication   sr-param-list 
sr-enable-database-replication    sr-param-remove 
sr-forget                         sr-param-set 
sr-introduce                      sr-probe 
sr-list                           sr-scan 
sr-param-add                      sr-update 

[root@xenserver1-onVM ~]# xe sr-list params=all
uuid ( RO)                    : 2097e602-47db-a6ca-9dee-a462f1836d6e
              name-label ( RW): Local storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.create; VDI.snapshot; PBD.create; PBD.destroy; plug; update; VDI.destroy; scan; VDI.clone; VDI.resize; unplug
      current-operations (SRO): 
                    VDIs (SRO): 
                    PBDs (SRO): 6e9f37f7-dcd1-94bd-2f25-98b46835a9d6
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): 4194304
           physical-size ( RO): 12872318976
                    type ( RO): lvm
            content-type ( RO): user
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Local storage; i18n-key: local-storage
               sm-config (MRO): allocation: thick; use_vhd: true; devserial: 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


uuid ( RO)                    : 15e44ca5-f155-6c39-04fd-9d0465e2e297
              name-label ( RW): XenServer Tools
        name-description ( RW): XenServer Tools ISOs
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): PBD.create; PBD.destroy; plug; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 51b6a248-2012-4acc-a874-2b1c7f58d3e6; cdf47bbf-8082-4f92-9bdd-af704e327ce4
                    PBDs (SRO): f80e90f9-5db0-2fc9-c762-1d99e34e4d08
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): -1
           physical-size ( RO): -1
                    type ( RO): iso
            content-type ( RO): iso
                  shared ( RW): true
           introduced-by ( RO): <not in database>
            other-config (MRW): xensource_internal: true; xenserver_tools_sr: true; i18n-key: xenserver-tools; i18n-original-value-name_label: XenServer Tools; i18n-original-value-name_description: XenServer Tools ISOs
               sm-config (MRO): 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


uuid ( RO)                    : 0e044c79-b607-da8c-9a57-c3428db2ad79
              name-label ( RW): DVD drives
        name-description ( RW): Physical DVD drives
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 4f9ffe88-37b9-4518-a93a-673da0a947e3
                    PBDs (SRO): 1ee534d0-9039-e909-b168-2918fa59a397
      virtual-allocation ( RO): 1073741312
    physical-utilisation ( RO): 1073741312
           physical-size ( RO): 1073741312
                    type ( RO): udev
            content-type ( RO): iso
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_description: Physical DVD drives; i18n-original-value-name_label: DVD drives; i18n-key: local-hotplug-cd
               sm-config (MRO): type: cd
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


uuid ( RO)                    : f8cba5eb-438f-95d5-cd5e-16edb8ce734a
              name-label ( RW): Removable storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 
                    PBDs (SRO): 8db9cd7e-a107-8ff2-769c-537240b1a370
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): 0
           physical-size ( RO): 0
                    type ( RO): udev
            content-type ( RO): disk
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Removable storage; i18n-key: local-hotplug-disk
               sm-config (MRO): type: block
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 

Beberapa informasi yang perlu kita perhatikan adalah sebagai berikut.
name-label : "Nama Label SR"
host : "Host yang terhubung dengan SR"
allowed-operations : " Operasi yang dapat dilakukan pada SR ini"
VDI : "File VDI yang terhubung dengan SR ini" 
PBDs : "PBD yang menghubungkan SR dengan Host / Server Fisik"
physical-size : "Ukuran kapasitas SR"
type : "Tipe SR -> lvm/udev/iso"
content-type : "Tipe konten yang mengisi SR -> user/iso/disk"
other-config : "Konfigurasi-konfigurasi yang lain"

Kita dapat melihat informasi SR melalui XenCenter seperti gambar-gambar berikut.




SR jenis ISO berguna untuk menghandle CD Image yang disimpan sebagai sebuah file dalam format ISO. SR jenis ini sangat berguna untuk menciptakan librari-librari ISO yang di-share.  Untuk SR yang menyimpan sebuah librari file-file ISO, maka parameter "content-type" harus di-set "iso". Contoh perintah berikut untuk meng-create sebuah SR berjenis ISO yang menyimpan file-file ISO :

[root@xenserver1-onVM ~]# xe sr-create host-uuid=6cd51734-00e6-4636-a3d5-a9c9eb7dc367 content-type=iso type=iso name-label="Contoh SR ISO" device-config:location=<nfs server:path>

Secara default, XenServer telah membuat SR bertipe ISO saat petama kali instalasi dilakukan. Terlihat pada keterangan sebelumnya SR ISO ini memiliki id "15e44ca5-f155-6c39-04fd-9d0465e2e297". Untuk melihat SR ini, ketikkan perintah seperti dibawah ini.

[root@xenserver1-onVM ~]# xe sr-list uuid=15e44ca5-f155-6c39-04fd-9d0465e2e297 params=all
uuid ( RO)                    : 15e44ca5-f155-6c39-04fd-9d0465e2e297
              name-label ( RW): XenServer Tools
        name-description ( RW): XenServer Tools ISOs
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): PBD.create; PBD.destroy; plug; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 51b6a248-2012-4acc-a874-2b1c7f58d3e6; cdf47bbf-8082-4f92-9bdd-af704e327ce4
                    PBDs (SRO): f80e90f9-5db0-2fc9-c762-1d99e34e4d08
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): -1
           physical-size ( RO): -1
                    type ( RO): iso
            content-type ( RO): iso
                  shared ( RW): true
           introduced-by ( RO): <not in database>
            other-config (MRW): xensource_internal: true; xenserver_tools_sr: true; i18n-key: xenserver-tools; i18n-original-value-name_label: XenServer Tools; i18n-original-value-name_description: XenServer Tools ISOs
               sm-config (MRO): 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe pbd-list sr-uuid=15e44ca5-f155-6c39-04fd-9d0465e2e297 
uuid ( RO)                  : f80e90f9-5db0-2fc9-c762-1d99e34e4d08
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
               sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true


[root@xenserver1-onVM ~]# xe pbd-list uuid=f80e90f9-5db0-2fc9-c762-1d99e34e4d08 
uuid ( RO)                  : f80e90f9-5db0-2fc9-c762-1d99e34e4d08
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
               sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true

SR ini terkait dengan lokasi "/opt/xensource/packages/iso" (device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true). Sekarang kita lihat lokasi tersebut. 

[root@xenserver1-onVM ~]# ls -l /opt/xensource/packages/iso/
total 168960
-rw-r--r-- 1  500  513  53635072 Jun 14  2013 XenCenter.iso
-rw-r--r-- 1 root root 119197696 Jun 14  2013 xs-tools-6.2.0.iso

Ternyata pada lokasi ini berisi 2 file ISO. yaitu XenCenter.iso dan xs-tools.iso.  XenCenter.iso berisi file installer XenCenter.msi, dengan cara lain anda dapat mengambil file installer ini atau bahkan file XenCenter.iso sekalian, yaitu dengan cara mengakses IP address host xenserver melalui web browser. xs-tools.iso berisi driver-driver yang diperlukan oleh guest / VM baik Windows maupun linux. Seperti gambar sebelumnya, pada XenCenter kita tidak dapat melihat SR ber-tipe ISO ini. 

Kemudian kita lihat pada SR berikutnya yaitu yang bertipe "udev". Disana terdapat 2 SR yang bertipe "udev" seperti keterangan dari ouput perintah dibawah ini.

[root@xenserver1-onVM ~]# xe sr-list type=udev 
uuid ( RO)                : 0e044c79-b607-da8c-9a57-c3428db2ad79
          name-label ( RW): DVD drives
    name-description ( RW): Physical DVD drives
                host ( RO): xenserver1-onVM
                type ( RO): udev
        content-type ( RO): iso


uuid ( RO)                : f8cba5eb-438f-95d5-cd5e-16edb8ce734a
          name-label ( RW): Removable storage
    name-description ( RW): 
                host ( RO): xenserver1-onVM
                type ( RO): udev
        content-type ( RO): disk

Jadi ada 2 SR yang bertipe "udev", yang satu dengan jenis konten "iso" (content-type (RO) : iso) dan yang satunya berjenis konten "disk" (content-type (RO) : disk). Untuk SR jenis "udev" dengan "content-type=iso", maka SR ini terhubung ke CD/DVD drive dari host server. Apabila kita memasukkan sebuah CD yang berisi file, misalnya CD installer Windows 7, maka pada SR ini akan menunjukkan besar kapasitas CD Installer tersebut, seperti berikut.

[root@xenserver1-onVM ~]# xe sr-list type=udev params=all uuid=0e044c79-b607-da8c-9a57-c3428db2ad79 
uuid ( RO)                    : 0e044c79-b607-da8c-9a57-c3428db2ad79
              name-label ( RW): DVD drives
        name-description ( RW): Physical DVD drives
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 4f9ffe88-37b9-4518-a93a-673da0a947e3
                    PBDs (SRO): 1ee534d0-9039-e909-b168-2918fa59a397
      virtual-allocation ( RO): 2539749376
    physical-utilisation ( RO): 2539749376
           physical-size ( RO): 2539749376
                    type ( RO): udev
            content-type ( RO): iso
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_description: Physical DVD drives; i18n-original-value-name_label: DVD drives; i18n-key: local-hotplug-cd
               sm-config (MRO): type: cd
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 

Pada XenCenter informasi ini akan terlihat seperti berikut.

Sekarang kita lihat pada SR "udev" yang lainnya, yaitu yang parameter "content-type" nya adalah "disk". Ini adalah SR yang menangani perangkat plug-in yang disambungkan ke Host XenServer / PC Server itu sendiri, misalnya USB Flashdisk. Perhatikan output perintah berikut ini.

[root@xenserver1-onVM ~]# xe sr-list type=udev params=all uuid=f8cba5eb-438f-95d5-cd5e-16edb8ce734a 
uuid ( RO)                    : f8cba5eb-438f-95d5-cd5e-16edb8ce734a
              name-label ( RW): Removable storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 
                    PBDs (SRO): 8db9cd7e-a107-8ff2-769c-537240b1a370
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): 0
           physical-size ( RO): 0
                    type ( RO): udev
            content-type ( RO): disk
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Removable storage; i18n-key: local-hotplug-disk
               sm-config (MRO): type: block
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 

Sekarang apa yang terjadi jika saya me-colokkan sebuah USB Flashdisk 8 GB ke salah satu port host xenserver / pc server tersebut ?. Perhatikan output perintah yang sama dengan diatas, setelah saya benar-benar men-colokkan USB Flashdisk 8 GB ke salah satu port USB host xenserver.

[root@xenserver1-onVM ~]# xe sr-list type=udev params=all uuid=f8cba5eb-438f-95d5-cd5e-16edb8ce734a 
uuid ( RO)                    : f8cba5eb-438f-95d5-cd5e-16edb8ce734a
              name-label ( RW): Removable storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 59588cbe-cd14-4bcf-819b-1ff6ebf00edc
                    PBDs (SRO): 8db9cd7e-a107-8ff2-769c-537240b1a370
      virtual-allocation ( RO): 8099201024
    physical-utilisation ( RO): 8099201024
           physical-size ( RO): 8099201024
                    type ( RO): udev
            content-type ( RO): disk
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Removable storage; i18n-key: local-hotplug-disk
               sm-config (MRO): type: block
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 

Ternyata dari keterangan diatas parmeter "physical-size" pun berubah dengan menunjukkan kapasitas sekitar 8 GB. Selain itu "virtual-allocation" dan "physical-utilisation" juga menunjukkan angka yang sama yaitu sekitar 8 GB. Pada XenCenter, SR ini akan terlihat sebagai berikut.

Yang terakhir adalah SR dengan tipe "lvm". SR ini adalah terkait dengan sebuah partisi LVM di host xenserver. Untuk melihat detail SR lvm ini ketikkan perintah berikut. 


[root@xenserver1-onVM ~]# xe sr-list type=lvm
uuid ( RO)                : 2097e602-47db-a6ca-9dee-a462f1836d6e
          name-label ( RW): Local storage
    name-description ( RW): 
                host ( RO): xenserver1-onVM
                type ( RO): lvm
        content-type ( RO): user


[root@xenserver1-onVM ~]# xe sr-list uuid=2097e602-47db-a6ca-9dee-a462f1836d6e params=all
uuid ( RO)                    : 2097e602-47db-a6ca-9dee-a462f1836d6e
              name-label ( RW): Local storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.create; VDI.snapshot; PBD.create; PBD.destroy; plug; update; VDI.destroy; scan; VDI.clone; VDI.resize; unplug
      current-operations (SRO): 
                    VDIs (SRO): 
                    PBDs (SRO): 6e9f37f7-dcd1-94bd-2f25-98b46835a9d6
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): 4194304
           physical-size ( RO): 12872318976
                    type ( RO): lvm
            content-type ( RO): user
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Local storage; i18n-key: local-storage
               sm-config (MRO): allocation: thick; use_vhd: true; devserial: 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW):

Pada keterangan diatas kapasitas yang dimiliki adalah sebesar 12872318976 bytes atau sama dengan  11,98828125 GB (karena 1024 bytes = 1KB, 1024 KB = 1 MB, 1024 MB = 1 GB, 1024 GB = 1 TB, 1024 TB = 1 PB). Sebelumnya telah kita ketahui bahwa partisi "/dev/sda3" adalah sebesar 12 GB dan Volume Group yang dibentuk dari partisi ini memiliki kapasitas sebesar 11,98 GB. Untuk melihat hubungan antara SR lvm ini dengan PBD, Host dan hardisk real-nya, maka gunakan perintah-perintah berikut.

[root@xenserver1-onVM ~]# xe pbd-list sr-uuid=2097e602-47db-a6ca-9dee-a462f1836d6e params=all 
uuid ( RO)                  : 6e9f37f7-dcd1-94bd-2f25-98b46835a9d6
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 2097e602-47db-a6ca-9dee-a462f1836d6e
         sr-name-label ( RO): Local storage
         device-config (MRO): device: /dev/sda3
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156


[root@xenserver1-onVM ~]# cat /proc/partitions major minor  #blocks  name

   7        0      52378 loop0
   8        0   20971520 sda
   8        1    4193297 sda1
   8        2    4193297 sda2
   8        3   12581871 sda3
 252        0       4096 dm-0
[root@xenserver1-onVM ~]# pvdisplay 
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  PV Size               12,00 GB / not usable 9,14 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              3069
  Free PE               3068
  Allocated PE          1
  PV UUID               k4hA6N-sABZ-7Itk-FVcQ-2Sbp-3llU-cNefGw
   
[root@xenserver1-onVM ~]# vgdisplay 
  --- Volume group ---
  VG Name               VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  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               11,99 GB
  PE Size               4,00 MB
  Total PE              3069
  Alloc PE / Size       1 / 4,00 MB
  Free  PE / Size       3068 / 11,98 GB
  VG UUID               xQXGog-x4Vt-0x3w-HCQu-SMXu-phun-MSioFc
   
[root@xenserver1-onVM ~]# lvdisplay 
  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e/MGT
  VG Name                VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  LV UUID                oNz7MX-Opll-5Y73-QCRf-11XD-mERP-QgSaBh
  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:0

Pada XenCenter kita dapat melihat SR lvm ini seperti pada gambar dibawah ini.



Virtual Disk Image (VDI)

Untuk melihat VDI yang telah tersedia pada xenserver gunakan perintah dibawah ini.

[root@xenserver1-onVM ~]# xe vdi-list 
uuid ( RO)                : 51b6a248-2012-4acc-a874-2b1c7f58d3e6
          name-label ( RW): xs-tools.iso
    name-description ( RW): 
             sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
        virtual-size ( RO): 119197696
            sharable ( RO): false
           read-only ( RO): true


uuid ( RO)                : 4f9ffe88-37b9-4518-a93a-673da0a947e3
          name-label ( RW): SCSI 2:0:0:0
    name-description ( RW): NECVMWar model VMware IDE CDR10 rev 1.00 type 5
             sr-uuid ( RO): 0e044c79-b607-da8c-9a57-c3428db2ad79
        virtual-size ( RO): 2539749376
            sharable ( RO): false
           read-only ( RO): true


uuid ( RO)                : cdf47bbf-8082-4f92-9bdd-af704e327ce4
          name-label ( RW): XenCenter.iso
    name-description ( RW): 
             sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
        virtual-size ( RO): 53635072
            sharable ( RO): false
           read-only ( RO): true

Tampak bahwa ada 3 VDI yang telah dibuat secara default saat instalasi XenServer. Yang pertama adalah VDI dengan name-label = xs-tools.iso. Kita akan melihat secara detail informasi VDI ini beserta keterkaitannya dengan SR, PBD, Host.

[root@xenserver1-onVM ~]# xe vdi-list params=all uuid=51b6a248-2012-4acc-a874-2b1c7f58d3e6 
uuid ( RO)                    : 51b6a248-2012-4acc-a874-2b1c7f58d3e6
              name-label ( RW): xs-tools.iso
        name-description ( RW): 
           is-a-snapshot ( RO): false
             snapshot-of ( RO): <not in database>
               snapshots ( RO): 
           snapshot-time ( RO): 19700101T00:00:00Z
      allowed-operations (SRO): forget; copy; snapshot
      current-operations (SRO): 
                 sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
           sr-name-label ( RO): XenServer Tools
               vbd-uuids (SRO): 
         crashdump-uuids (SRO): 
            virtual-size ( RO): 119197696
    physical-utilisation ( RO): 119197696
                location ( RO): xs-tools-6.2.0.iso
                    type ( RO): User
                sharable ( RO): false
               read-only ( RO): true
            storage-lock ( RO): false
                 managed ( RO): true
                  parent ( RO): <not in database>
                 missing ( RO): false
            other-config (MRW): 
           xenstore-data (MRO): 
               sm-config (MRO): xs-tools-build: 0; xs-tools: true; xs-tools-version: 6.2.0
                 on-boot ( RW): persist
           allow-caching ( RW): false
         metadata-latest ( RO): false
        metadata-of-pool ( RO): <not in database>
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe sr-list name-label=XenServer\ Tools params=all
uuid ( RO)                    : 15e44ca5-f155-6c39-04fd-9d0465e2e297
              name-label ( RW): XenServer Tools
        name-description ( RW): XenServer Tools ISOs
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): PBD.create; PBD.destroy; plug; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 51b6a248-2012-4acc-a874-2b1c7f58d3e6; cdf47bbf-8082-4f92-9bdd-af704e327ce4
                    PBDs (SRO): f80e90f9-5db0-2fc9-c762-1d99e34e4d08
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): -1
           physical-size ( RO): -1
                    type ( RO): iso
            content-type ( RO): iso
                  shared ( RW): true
           introduced-by ( RO): <not in database>
            other-config (MRW): xensource_internal: true; xenserver_tools_sr: true; i18n-key: xenserver-tools; i18n-original-value-name_label: XenServer Tools; i18n-original-value-name_description: XenServer Tools ISOs
               sm-config (MRO): 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe pbd-list uuid=f80e90f9-5db0-2fc9-c762-1d99e34e4d08 params=all 
uuid ( RO)                  : f80e90f9-5db0-2fc9-c762-1d99e34e4d08
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
         sr-name-label ( RO): XenServer Tools
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156


[root@xenserver1-onVM ~]# ls -l /opt/xensource/packages/iso/
total 168960
-rw-r--r-- 1  500  513  53635072 Jun 14  2013 XenCenter.iso
-rw-r--r-- 1 root root 119197696 Jun 14  2013 xs-tools-6.2.0.iso

Lihatlah bahwa VDI ini bermuara pada file iso yang ada di host xenserver, yaitu /opt/xensource/packages/iso/xs-tools-6.2.0.iso. Begitulah pemetaan VDI di dalam XenServer 6.2.0 ini. Sebuah file image dengan format iso pun di representasikan sebagai sebuah VDI. Nanti Seluruh VM yang akan mengakses file image ISO ini tidak akan mengakses secara langsung ke folder "/opt/xensource/packages/iso/" melainkan akan mengakses ke VDI ini yang kemudian akan dipetakan oleh xenserver ke direktori tersebut. 
Yang kedua adalah VDI yang dipetakan ke CD/DVD drive host xenserver. Kita akan melihat keterkaitannya dengan SR, PBD dan Host, sehingga setiap VM yang mengakses VDI ini akan dipetakan langsung menuju ke CD/DVD drive milik host xenserver / pc server. Gunakan perintah berikut untuk melihat keterkaitannya.

[root@xenserver1-onVM ~]# xe vdi-list uuid=4f9ffe88-37b9-4518-a93a-673da0a947e3 params=all
uuid ( RO)                    : 4f9ffe88-37b9-4518-a93a-673da0a947e3
              name-label ( RW): SCSI 2:0:0:0
        name-description ( RW): NECVMWar model VMware IDE CDR10 rev 1.00 type 5
           is-a-snapshot ( RO): false
             snapshot-of ( RO): <not in database>
               snapshots ( RO): 
           snapshot-time ( RO): 19700101T00:00:00Z
      allowed-operations (SRO): forget; update; copy; snapshot
      current-operations (SRO): 
                 sr-uuid ( RO): 0e044c79-b607-da8c-9a57-c3428db2ad79
           sr-name-label ( RO): DVD drives
               vbd-uuids (SRO): 
         crashdump-uuids (SRO): 
            virtual-size ( RO): 2539749376
    physical-utilisation ( RO): 2539749376
                location ( RO): /dev/xapi/cd/sr0
                    type ( RO): User
                sharable ( RO): false
               read-only ( RO): true
            storage-lock ( RO): false
                 managed ( RO): true
                  parent ( RO): <not in database>
                 missing ( RO): false
            other-config (MRW): 
           xenstore-data (MRO): 
               sm-config (MRO): hotplugged_at: 2014-09-02T06:13:34Z
                 on-boot ( RW): persist
           allow-caching ( RW): false
         metadata-latest ( RO): false
        metadata-of-pool ( RO): <not in database>
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe sr-list VDIs=4f9ffe88-37b9-4518-a93a-673da0a947e3 params=all
uuid ( RO)                    : 0e044c79-b607-da8c-9a57-c3428db2ad79
              name-label ( RW): DVD drives
        name-description ( RW): Physical DVD drives
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 4f9ffe88-37b9-4518-a93a-673da0a947e3
                    PBDs (SRO): 1ee534d0-9039-e909-b168-2918fa59a397
      virtual-allocation ( RO): 2539749376
    physical-utilisation ( RO): 2539749376
           physical-size ( RO): 2539749376
                    type ( RO): udev
            content-type ( RO): iso
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_description: Physical DVD drives; i18n-original-value-name_label: DVD drives; i18n-key: local-hotplug-cd
               sm-config (MRO): type: cd
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe pbd-list uuid=1ee534d0-9039-e909-b168-2918fa59a397  params=all 
uuid ( RO)                  : 1ee534d0-9039-e909-b168-2918fa59a397
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 0e044c79-b607-da8c-9a57-c3428db2ad79
         sr-name-label ( RO): DVD drives
         device-config (MRO): location: /dev/xapi/cd
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156

Dan VDI yang terakhir adalah VDI yang akan dipetakan ke file XenCenter.iso. Gunakan perintah berikut ini untuk melihat keterkaitan antara VDI tersebut dengan SR, PBD dan Host.

[root@xenserver1-onVM ~]# xe vdi-list uuid=cdf47bbf-8082-4f92-9bdd-af704e327ce4 params=all
uuid ( RO)                    : cdf47bbf-8082-4f92-9bdd-af704e327ce4
              name-label ( RW): XenCenter.iso
        name-description ( RW): 
           is-a-snapshot ( RO): false
             snapshot-of ( RO): <not in database>
               snapshots ( RO): 
           snapshot-time ( RO): 19700101T00:00:00Z
      allowed-operations (SRO): forget; copy; snapshot
      current-operations (SRO): 
                 sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
           sr-name-label ( RO): XenServer Tools
               vbd-uuids (SRO): 
         crashdump-uuids (SRO): 
            virtual-size ( RO): 53635072
    physical-utilisation ( RO): 53635072
                location ( RO): XenCenter.iso
                    type ( RO): User
                sharable ( RO): false
               read-only ( RO): true
            storage-lock ( RO): false
                 managed ( RO): true
                  parent ( RO): <not in database>
                 missing ( RO): false
            other-config (MRW): 
           xenstore-data (MRO): 
               sm-config (MRO): 
                 on-boot ( RW): persist
           allow-caching ( RW): false
         metadata-latest ( RO): false
        metadata-of-pool ( RO): <not in database>
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe sr-list uuid=15e44ca5-f155-6c39-04fd-9d0465e2e297 params=all
uuid ( RO)                    : 15e44ca5-f155-6c39-04fd-9d0465e2e297
              name-label ( RW): XenServer Tools
        name-description ( RW): XenServer Tools ISOs
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): PBD.create; PBD.destroy; plug; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 51b6a248-2012-4acc-a874-2b1c7f58d3e6; cdf47bbf-8082-4f92-9bdd-af704e327ce4
                    PBDs (SRO): f80e90f9-5db0-2fc9-c762-1d99e34e4d08
      virtual-allocation ( RO): 0
    physical-utilisation ( RO): -1
           physical-size ( RO): -1
                    type ( RO): iso
            content-type ( RO): iso
                  shared ( RW): true
           introduced-by ( RO): <not in database>
            other-config (MRW): xensource_internal: true; xenserver_tools_sr: true; i18n-key: xenserver-tools; i18n-original-value-name_label: XenServer Tools; i18n-original-value-name_description: XenServer Tools ISOs
               sm-config (MRO): 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe pbd-list uuid=f80e90f9-5db0-2fc9-c762-1d99e34e4d08 params=all 
uuid ( RO)                  : f80e90f9-5db0-2fc9-c762-1d99e34e4d08
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
         sr-name-label ( RO): XenServer Tools
         device-config (MRO): location: /opt/xensource/packages/iso; legacy_mode: true
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156

Jadi dari ke 3 VDI diatas kita sudah mengetahui bahwa ada 3 fungsi VDI ini, yaitu :
  1. VDI dengan uuid=51b6a248-2012-4acc-a874-2b1c7f58d3e6, disediakan bagi VM-VM untuk mengakses file xs-tools.iso, yang di host file tersebut berlokasi di "/opt/xensource/packages/iso/".
  2. VDI dengan uuid=cdf47bbf-8082-4f92-9bdd-af704e327ce4, disediakan oleh xenserver bagi VM-VM yang ada, agar bisa mengakses file XenCenter.iso yang juga berlokasi di "/opt/xensource/packages/iso/". Bahkan file iso ini bisa diakses oleh host yang 1 layer dengan host xenserver itu sendiri, guna mengambil file installer XenCenter.
  3. VDI dengan uuid=4f9ffe88-37b9-4518-a93a-673da0a947e3, disediakan oleh XenServer bagi VM-VM agar bisa mengakses CD/DVD Drive yang dimiliki langsung oleh host xenserver itu sendiri (PC Server).
Penggambaran secara grafis mengenai pemetaan antara VDI, SR, PBD dan Host yang telah dijelaskan diatas, seperti terlihat pada gambar berikut ini.
Sampai disini mungkin anda bertanya-tanya, kenapa hanya 2 SR yang memiliki VDI, padahal SR yang tersedia ada 4 ?. Itu sebab di dalam DVD Drive host sudah ada DVD installer Windows 7 yang telah dimasukkan sebelumnya, dan file xs-tools.iso & XenCenter.iso juga sudah tersedia di dalam folder "/opt/xensource/packages/iso". Sekarang coba kita colokkan USB Flashdrive 8 GB, maka akan terbentuk 1 VDI lagi yang terhubung dengan SR "Removable Storage", perhatikan output perintah di bawah ini yang saya lakukan setelah saya men-colokkan USB Flashdrive 8 GB ke USB Port milik Host XenServer.

[root@xenserver1-onVM ~]# xe sr-list params=all name-label=Removable\ storage 
uuid ( RO)                    : f8cba5eb-438f-95d5-cd5e-16edb8ce734a
              name-label ( RW): Removable storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.introduce; PBD.create; PBD.destroy; plug; update; scan; VDI.clone; unplug
      current-operations (SRO): 
                    VDIs (SRO): 3f08bc10-75c9-4d2a-b5bd-8dc60c226ae2
                    PBDs (SRO): 8db9cd7e-a107-8ff2-769c-537240b1a370
      virtual-allocation ( RO): 8099201024
    physical-utilisation ( RO): 8099201024
           physical-size ( RO): 8099201024
                    type ( RO): udev
            content-type ( RO): disk
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Removable storage; i18n-key: local-hotplug-disk
               sm-config (MRO): type: block
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 


[root@xenserver1-onVM ~]# xe vdi-list 
uuid ( RO)                : 51b6a248-2012-4acc-a874-2b1c7f58d3e6
          name-label ( RW): xs-tools.iso
    name-description ( RW): 
             sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
        virtual-size ( RO): 119197696
            sharable ( RO): false
           read-only ( RO): true


uuid ( RO)                : 3f08bc10-75c9-4d2a-b5bd-8dc60c226ae2
          name-label ( RW): USB 4:0:0:0
    name-description ( RW): USB 2.0 model USB Flash Drive rev 1100 type 0
             sr-uuid ( RO): f8cba5eb-438f-95d5-cd5e-16edb8ce734a
        virtual-size ( RO): 8099201024
            sharable ( RO): false
           read-only ( RO): false


uuid ( RO)                : 4f9ffe88-37b9-4518-a93a-673da0a947e3
          name-label ( RW): SCSI 2:0:0:0
    name-description ( RW): NECVMWar model VMware IDE CDR10 rev 1.00 type 5
             sr-uuid ( RO): 0e044c79-b607-da8c-9a57-c3428db2ad79
        virtual-size ( RO): 2539749376
            sharable ( RO): false
           read-only ( RO): true


uuid ( RO)                : cdf47bbf-8082-4f92-9bdd-af704e327ce4
          name-label ( RW): XenCenter.iso
    name-description ( RW): 
             sr-uuid ( RO): 15e44ca5-f155-6c39-04fd-9d0465e2e297
        virtual-size ( RO): 53635072
            sharable ( RO): false
           read-only ( RO): true


[root@xenserver1-onVM ~]# xe vdi-list uuid=3f08bc10-75c9-4d2a-b5bd-8dc60c226ae2 params=all
uuid ( RO)                    : 3f08bc10-75c9-4d2a-b5bd-8dc60c226ae2
              name-label ( RW): USB 4:0:0:0
        name-description ( RW): USB 2.0 model USB Flash Drive rev 1100 type 0
           is-a-snapshot ( RO): false
             snapshot-of ( RO): <not in database>
               snapshots ( RO): 
           snapshot-time ( RO): 19700101T00:00:00Z
      allowed-operations (SRO): forget; update; copy; snapshot
      current-operations (SRO): 
                 sr-uuid ( RO): f8cba5eb-438f-95d5-cd5e-16edb8ce734a
           sr-name-label ( RO): Removable storage
               vbd-uuids (SRO): 
         crashdump-uuids (SRO): 
            virtual-size ( RO): 8099201024
    physical-utilisation ( RO): 8099201024
                location ( RO): /dev/xapi/block/sdb
                    type ( RO): User
                sharable ( RO): false
               read-only ( RO): false
            storage-lock ( RO): false
                 managed ( RO): true
                  parent ( RO): <not in database>
                 missing ( RO): false
            other-config (MRW): 
           xenstore-data (MRO): 
               sm-config (MRO): hotplugged_at: 2014-09-02T08:23:20Z
                 on-boot ( RW): persist
           allow-caching ( RW): false
         metadata-latest ( RO): false
        metadata-of-pool ( RO): <not in database>
                    tags (SRW): 

Lihatlah output perintah diatas, telah tersedia secara otomatis sebuah VDI yang merepresentasikan USB Flashdrive 8 GB pada host. 
Lantas bagai mana VDI yang merepresentasikan "Local Storage" (/dev/sda3) ?. Nah VDI ini nantinya juga akan terbentuk secara otomatis ketika partisi LV dibuat di dalam VG "VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e" (partisi hardisk "/dev/sda3" yang telah dialokasikan menjadi sebuah hardisk LVM), yaitu melalui proses pembuatan sebuah Virtual Machine (VM). Sekarang kita akan membuat sebuah VM, namun sebelumnya kita akan melihat kondisi VBD dan VM yang ada melalui perintah dibawah, walaupun memang sebenarnya kita sudah tahu VBD dan VM itu tidak akan ada karena belum dibuat. Selain itu, kita juga akan melihat kondisi pada partisi LVM sebelum sebuah VM dibuat, untuk mengetahui perubahannya ketika VM kelak telah dibuat. Perhatikan langkah-langkah dibawah ini.

[root@xenserver1-onVM ~]# xe vbd-list 
[root@xenserver1-onVM ~]# xe vm-list 
uuid ( RO)           : 68bb8592-63ed-4e67-9e88-6e6c3594227e
     name-label ( RW): Control domain on host: xenserver1-onVM
    power-state ( RO): running

[root@xenserver1-onVM ~]# xe vm-list params=all
uuid ( RO)                          : 68bb8592-63ed-4e67-9e88-6e6c3594227e
                    name-label ( RW): Control domain on host: xenserver1-onVM
              name-description ( RW): The domain which manages physical devices and manages other domains
                  user-version ( RW): 1
                 is-a-template ( RW): false
                 is-a-snapshot ( RO): false
                   snapshot-of ( RO): <not in database>
                     snapshots ( RO): 
                 snapshot-time ( RO): 19700101T00:00:00Z
                 snapshot-info ( RO): 
                        parent ( RO): <not in database>
                      children ( RO): 
             is-control-domain ( RO): true
                   power-state ( RO): running
                 memory-actual ( RO): 788529152
                 memory-target ( RO): <expensive field>
               memory-overhead ( RO): 8388608
             memory-static-max ( RW): 792723456
            memory-dynamic-max ( RW): 788529152
            memory-dynamic-min ( RW): 788529152
             memory-static-min ( RW): 209715200
              suspend-VDI-uuid ( RW): <not in database>
               suspend-SR-uuid ( RW): <not in database>
                  VCPUs-params (MRW): 
                     VCPUs-max ( RW): 1
              VCPUs-at-startup ( RW): 1
        actions-after-shutdown ( RW): Destroy
          actions-after-reboot ( RW): Destroy
           actions-after-crash ( RW): Destroy
                 console-uuids (SRO): 20fffd3f-d5b0-3bc2-9da9-2e26d0f4ee6e; 75f98992-4bf4-04a5-96c1-e68c4e33bd42
                      platform (MRW): 
            allowed-operations (SRO): changing_dynamic_range
            current-operations (SRO): 
            blocked-operations (MRW): 
           allowed-VBD-devices (SRO): <expensive field>
           allowed-VIF-devices (SRO): <expensive field>
                possible-hosts ( RO): <expensive field>
               HVM-boot-policy ( RW): 
               HVM-boot-params (MRW): 
         HVM-shadow-multiplier ( RW): 1.000
                     PV-kernel ( RW): 
                    PV-ramdisk ( RW): 
                       PV-args ( RW): 
                PV-legacy-args ( RW): 
                 PV-bootloader ( RW): 
            PV-bootloader-args ( RW): 
           last-boot-CPU-flags ( RO): 
              last-boot-record ( RO): <expensive field>
                   resident-on ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
                      affinity ( RW): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
                  other-config (MRW): storage_driver_domain: OpaqueRef:206e752f-90a2-177b-9cba-6e0be5d49159; is_system_domain: true; perfmon: <config><variable><name value="fs_usage"/></variable></config>
                        dom-id ( RO): 0
               recommendations ( RO): 
                 xenstore-data (MRW): 
    ha-always-run ( RW) [DEPRECATED]: false
           ha-restart-priority ( RW): 
                         blobs ( RO): 
                    start-time ( RO): 19700101T00:00:00Z
                  install-time ( RO): 19700101T00:00:00Z
                  VCPUs-number ( RO): 0
             VCPUs-utilisation (MRO): <expensive field>
                    os-version (MRO): <not in database>
            PV-drivers-version (MRO): <not in database>
         PV-drivers-up-to-date ( RO): <not in database>
                        memory (MRO): <not in database>
                         disks (MRO): <not in database>
                      networks (MRO): <not in database>
                         other (MRO): <not in database>
                          live ( RO): <not in database>
    guest-metrics-last-updated ( RO): <not in database>
      cooperative ( RO) [DEPRECATED]: <expensive field>
                          tags (SRW): 
                     appliance ( RW): <not in database>
                   start-delay ( RW): 0
                shutdown-delay ( RW): 0
                         order ( RW): 0
                       version ( RO): 0
                 generation-id ( RO): 8432558538216419376:3927989129555494189

[root@xenserver1-onVM ~]# pvs
  PV         VG                                                 Fmt  Attr PSize  PFree 
  /dev/sda3  VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e lvm2 a-   11,99G 11,98G
[root@xenserver1-onVM ~]# vgs
  VG                                                 #PV #LV #SN Attr   VSize  VFree 
  VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e   1   1   0 wz--n- 11,99G 11,98G
[root@xenserver1-onVM ~]# lvs
  LV   VG                                                 Attr   LSize Origin Snap%  Move Log Copy%  Convert
  MGT  VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e -wi-a- 4,00M                                      

[root@xenserver1-onVM ~]# lvdisplay 
  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e/MGT
  VG Name                VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  LV UUID                oNz7MX-Opll-5Y73-QCRf-11XD-mERP-QgSaBh
  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:0
   
[root@xenserver1-onVM ~]# vgdisplay 
  --- Volume group ---
  VG Name               VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e
  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               11,99 GB
  PE Size               4,00 MB
  Total PE              3069
  Alloc PE / Size       1 / 4,00 MB
  Free  PE / Size       3068 / 11,98 GB
  VG UUID               xQXGog-x4Vt-0x3w-HCQu-SMXu-phun-MSioFc

Upss..s, kenapa kok terdapat sebuah VM di sana ?. Oh iya, memang pada xen, terdapat sebuah Virtual Machine khusus yang disebut Dom 0 atau Domain Zero atau Control Domain, terlihat pada output perintah diatas VM ini memiliki "name-label = Domain control on host: xenserver1-onVM". Ya memang "Dom 0" ini berada pada host "xenServer1-onVM". Nah, apakah "Dom 0" ini ?. "Dom 0" adalah sebuah VM yang memiliki privillege khusus, yaitu dapat mengakses hardware secara langsung. Dom 0 juga menyediakan driver untuk hardware-hardware beserta fungsi lainnya. Semua VM-VM yang berjalan diatas XenServer berinteraksi dengan dunia luar melalui perantara "Dom 0" ini. Hal pertama kali yang dilakukan oleh Xen Hypervisor saat pertama kali boot adalah me-load "Dom 0" ini. Xen Hypervisor tanpa "Dom 0" tidak akan berguna."Dom 0" juga menyediakan virtual disk dan akses network bagi VM Guest (Dom U = Unprivilleged Domain). Mudah-mudahan lain waktu kita bisa membahas mengenai "Dom 0", "Dom U - PV Guest", "Dom U - HVM Guest" dan "Xen Hypervisor".
Kemudian yang perlu dicatat adalah bahwa "vm-list" menunjukkan belum ada VM yang di-create, "vbd-list" menunjukkan belum ada VBD yang dibuat, dan "pvscan" menunjukkan seluruh partisi "/dev/sda3" masih kosong(VFree = 11,98GB) dan "lvscan" maupun "lvdisplay" hanya menunjukkan sebuah LV Default yaitu MGT. Setelah kita membuat sebuah VM baru maka nanti akan ada perubahan pada beberapa resource ini dan insya Allah kita akan melihat keterkaitannya satu sama lain.
Baiklah, kita lanjutkan ke tujuan awal, yaitu membuat sebuah VM. Perhatikan tahapan berikut ini, mulai dari membuat sebuah VM Ubuntu Server 10.04, hingga pada melihat perubahan resource yang ada.

[root@xenserver1-onVM ~]# xe vm-install template=Ubuntu\ Lucid\ Lynx\ 10.04\ \(32-bit\) new-name-label=UbuntuServer10.04-32bit
8a48245e-3724-4bf4-5f33-5d08a619b3fc

[root@xenserver1-onVM ~]# xe vm-list 
uuid ( RO)           : 68bb8592-63ed-4e67-9e88-6e6c3594227e
     name-label ( RW): Control domain on host: xenserver1-onVM
    power-state ( RO): running


uuid ( RO)           : 8a48245e-3724-4bf4-5f33-5d08a619b3fc
     name-label ( RW): UbuntuServer10.04-32bit
    power-state ( RO): halted


[root@xenserver1-onVM ~]# xe vbd-list 
uuid ( RO)             : b75a5450-8029-6954-4681-a368f67438fc
          vm-uuid ( RO): 8a48245e-3724-4bf4-5f33-5d08a619b3fc
    vm-name-label ( RO): UbuntuServer10.04-32bit
         vdi-uuid ( RO): 436c335b-fe2a-45fd-a510-efa8e4e40bf1
            empty ( RO): false
           device ( RO): 


[root@xenserver1-onVM ~]# xe vdi-list uuid=436c335b-fe2a-45fd-a510-efa8e4e40bf1 
uuid ( RO)                : 436c335b-fe2a-45fd-a510-efa8e4e40bf1
          name-label ( RW): 0
    name-description ( RW): Created by template provisioner
             sr-uuid ( RO): 2097e602-47db-a6ca-9dee-a462f1836d6e
        virtual-size ( RO): 8589934592
            sharable ( RO): false
           read-only ( RO): false


[root@xenserver1-onVM ~]# xe sr-list uuid=2097e602-47db-a6ca-9dee-a462f1836d6e params=all
uuid ( RO)                    : 2097e602-47db-a6ca-9dee-a462f1836d6e
              name-label ( RW): Local storage
        name-description ( RW): 
                    host ( RO): xenserver1-onVM
      allowed-operations (SRO): VDI.create; VDI.snapshot; PBD.create; PBD.destroy; plug; update; VDI.destroy; scan; VDI.clone; VDI.resize; unplug
      current-operations (SRO): 
                    VDIs (SRO): 436c335b-fe2a-45fd-a510-efa8e4e40bf1
                    PBDs (SRO): 6e9f37f7-dcd1-94bd-2f25-98b46835a9d6
      virtual-allocation ( RO): 8615100416
    physical-utilisation ( RO): 8619294720
           physical-size ( RO): 12872318976
                    type ( RO): lvm
            content-type ( RO): user
                  shared ( RW): false
           introduced-by ( RO): <not in database>
            other-config (MRW): i18n-original-value-name_label: Local storage; i18n-key: local-storage
               sm-config (MRO): allocation: thick; use_vhd: true; devserial: 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 

[root@xenserver1-onVM ~]# xe pbd-list uuid=6e9f37f7-dcd1-94bd-2f25-98b46835a9d6 params=all 
uuid ( RO)                  : 6e9f37f7-dcd1-94bd-2f25-98b46835a9d6
     host ( RO) [DEPRECATED]: 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
             host-uuid ( RO): 6cd51734-00e6-4636-a3d5-a9c9eb7dc367
       host-name-label ( RO): xenserver1-onVM
               sr-uuid ( RO): 2097e602-47db-a6ca-9dee-a462f1836d6e
         sr-name-label ( RO): Local storage
         device-config (MRO): device: /dev/sda3
    currently-attached ( RO): true
          other-config (MRW): storage_driver_domain: OpaqueRef:d6328904-12d0-dec4-5bc0-366e10e5e156

[root@xenserver1-onVM ~]# lvs
  LV                                       VG                                                 Attr   LSize Origin Snap%  Move Log Copy%  Convert
  MGT                                      VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e -wi-a- 4,00M                                      
  VHD-436c335b-fe2a-45fd-a510-efa8e4e40bf1 VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e -wi--- 8,02G                                      

[root@xenserver1-onVM ~]# vgs
  VG                                                 #PV #LV #SN Attr   VSize  VFree
  VG_XenStorage-2097e602-47db-a6ca-9dee-a462f1836d6e   1   2   0 wz--n- 11,99G 3,96G

[root@xenserver1-onVM ~]# 

Nah, dari keterangan yang dihasilkan diatas, setelah kita me-create sebuah VM baru dari template yang telah tersedia, yaitu VM berjenis Ubuntu 10.04 32bit, yang terjadi adalah kapasitas storage lvm yang otomatis dialokasikan untuk VM ini adalah sebesar 11,99 GB (dapat dilihat dari perintah "vgs" dan "lvs"). Selain itu, juga telah dibuat VBD, VDI, SR dan PBD yang baru yang memetakan storage yang telah dialokasikan bagi Virtual Machine ini.
Sampai disini kita dapat melanjutkan ketahapan berikutnya, yaitu menginstall OS Ubuntu Server 10.04 32bit di VM tersebut. Namun kita tidak akan melanjutkan ke tahapan ini, karena keterbatasan memory yang saya gunakan. Insya Allah kita akan membahas ini pada artikel berikutnya.


Virtual Block Device (VBD)

Karena kita telah meng-create sebuah VM baru, maka sekarang kita dapat melihat keterkaitannya dengan VBD, VDI, SR, PBD dan Host. Sebenarnya disaat kita telah menginstall VM Ubuntu 10.04 32bit seperti diatas, kita juga telah melanjutkan dengan melihat keterkaitan tersebut, maka tidak akan saya ulang, namun saya akan menggambarkan hasil akhirnya yang meng-analogikan keterkaitan antara VM Ubuntu 10.04 32bit dengan VBD, VDI, SR, PBD dan Host. Anda dapat melihatnya seperti gambar dibawah ini.

Apabila anda menghubungkan CD/DVD drive host ke VM Ubuntu, maka akan terbentuk VBD baru yang menghubungkan nya dengan VM, seperti gambar dibawah ini.

Virtual Machine (VM)

VM adalah guest di dalam DOM U. VM yang baru saja kita buat diatas adalah Paravirtualizaton Guest (PV Guest). Cara melihat daftar VM yang tersedia telah diperlihatkan pada penjelasan diatas. Jadi kiranya penjelasan VM sudah cukup jelas.

Demikian dulu tutorial kali ini. Mudah-mudahan tutorial berikutnya segera bisa diterbitkan. Selamat mencoba.

http://havizul.blogspot.kr/2014/09/xenserver-seri-1-storage.html


공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함