Dem Citrix XenServer eine lokale Festplatte als lokalen Storage hinzufügen
Heute habe ich zwei 1TB Festplatten in meinen Citrix XenServer eingebaut. Die Festplatten wurden im BIOS erkannt, nun musste ich diese dem Citrix XenServer 5.6 noch als lokalen Storage hinzufügen.
Bevor mit dem Tutorial begonnen wird muss ein Backup der VMs erstellt werden falls etwas schief geht!
Die Festplatten sind grundsätzlich vorhanden
fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 499 4008186 83 Linux
/dev/sda2 500 998 4008217+ 83 Linux
/dev/sda3 999 121601 968743597+ 83 Linux
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
So werden die verfügbaren Festplatten angezeigt
ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Jul 23 13:07 scsi-SATA_SAMSUNG_HD103SJS246J90Z453865 -> ../../sdd
lrwxrwxrwx 1 root root 9 Jul 23 13:07 scsi-SATA_SAMSUNG_HD103SJS246J90Z453867 -> ../../sdb
lrwxrwxrwx 1 root root 9 Jul 23 13:07 scsi-SATA_WDC_WD1001FALS-_WD-WMATV2870992 -> ../../sdc
lrwxrwxrwx 1 root root 9 Jul 23 13:07 scsi-SATA_WDC_WD1001FALS-_WD-WMATV2871282 -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 23 13:07 scsi-SATA_WDC_WD1001FALS-_WD-WMATV2871282-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 23 13:07 scsi-SATA_WDC_WD1001FALS-_WD-WMATV2871282-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul 23 13:07 scsi-SATA_WDC_WD1001FALS-_WD-WMATV2871282-part3 -> ../../sda3
Die zwei Samsung Festplatten sdd und sdb sollen dem Citrix XenServer als lokalen Storage hinzugefügt werden.
Jetzt wird je Festplatte ein Physical Volume erstellt
pvcreate /dev/sdb
pvcreate /dev/sdd
Die zwei neuen Physical Volume sind vorhanden
pvdisplay
--- Physical volume ---
PV Name /dev/sdd
VG Name VG_XenStorage-d6fb2d7d-8c33-eda5-5645-a0116400251d
PV Size 931.51 GB / not usable 6.41 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 238464
Free PE 238463
Allocated PE 1
PV UUID 6N5Bfx-UiQ0-KRrJ-jkLD-hVzB-8mZ9-JXKsTW
--- Physical volume ---
PV Name /dev/sdb
VG Name VG_XenStorage-38b07d5b-ecf5-0520-57e8-fa24bfe4e1cf
PV Size 931.51 GB / not usable 6.41 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 238464
Free PE 238463
Allocated PE 1
PV UUID QNeO2f-81Dc-aq1b-i1Fs-hxiO-f6I1-WUdTg9
--- Physical volume ---
PV Name /dev/sda3
VG Name VG_XenStorage-cece6857-dbf2-ebc7-0a87-049bda6709d0
PV Size 923.87 GB / not usable 9.46 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 236507
Free PE 173295
Allocated PE 63212
PV UUID 7AfPF2-O6V7-wRAp-FtHT-GUN0-avM8-AvuIxv
--- Physical volume ---
PV Name /dev/sdc
VG Name VG_XenStorage-cece6857-dbf2-ebc7-0a87-049bda6709d0
PV Size 931.51 GB / not usable 6.41 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 238464
Free PE 0
Allocated PE 238464
PV UUID uIO134-y120-iy13-VDBf-JLEX-vQin-b3B3L3
Der lokale Storage wird erstellt mit
xe sr-create type="lvm" content-type="user" device-config:device="/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SJS246J90Z453867" name-label="Local Storage 1"
xe sr-create type="lvm" content-type="user" device-config:device="/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SJS246J90Z453865" name-lable="Local Storage 2"
und die verschiedenen lokal Storage werden angezeigt mit
xe sr-list type=lvm
uuid ( RO) : d6fb2d7d-8c33-eda5-5645-a0116400251d
name-label ( RW): Local Storage 2
name-description ( RW):
host ( RO): citrixxenserver
type ( RO): lvm
content-type ( RO): user
uuid ( RO) : 38b07d5b-ecf5-0520-57e8-fa24bfe4e1cf
name-label ( RW): Local Storage 1
name-description ( RW):
host ( RO): citrixxenserver
type ( RO): lvm
content-type ( RO): user
uuid ( RO) : cece6857-dbf2-ebc7-0a87-049bda6709d0
name-label ( RW): Local storage
name-description ( RW):
host ( RO): citrixxenserver
type ( RO): lvm
content-type ( RO): user
Die neuen Festplatten sind jetzt hinzugefügt und werden im XenCenter angezeigt.
Update:
Wenn auf dem Citrix Xenserver eine neue VM erstellt wird, kann man auswählen, auf welchem Storage die virtuelle Festplatte der VM liegen soll. Das Bild verdeutlicht das Beispiel.
Auf Local Storage 2 und 1 könnte die virtuelle Festplatte natürlich auch abgelegt werden, wenn diese Storages nicht schon voll wären.
Ich denke, dass so zum Beispiel auch eine externe Festplatte als lokalen Storage dem Citrix XenServer hinzugefügt werden könnte. Getestet habe ich es allerdings nicht.