Expand local Citrix Hypervisor Storage 7.x / 8.x

Expand local Citrix Hypervisor Storage

Hier onder wordt beschreven hoe een Citrix Hypervisor de local Storage van een RAID1, 5 of 10 wordt uitgebreid binnen een Citrix Hypervisor van +-30GB naar +-60GB. Op een HP Server als voorbeeld zul je eerst de RAID set moeten vergroten als dit gebeurd is kan het volume binnen een Citrix Hypervisor vergroot worden. Dit kan allen als de VM down zijn, de server heeft een Reboot nodig.

[root@XEN-SRV-14 ~]# pvscan
PV /dev/sda3 VG XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc lvm2 [28.48 GiB / 0 free]
Total: 1 [28.48 GiB] / in use: 1 [28.48 GiB] / in no VG: 0 [0 ]
[root@XEN-SRV-14 ~]#

[root@XEN-SRV-14 ~]# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.6

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 209715200 sectors, 100.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F38B7347-1E89-4FA0-80D9-0A3004FD4B4C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 209715166
Partitions will be aligned on 2048-sector boundaries
Total free space is 62916574 sectors (30.0 GiB)

Number Start (sector) End (sector) Size Code Name
1 46139392 83888127 18.0 GiB 0700
2 8390656 46139391 18.0 GiB 0700
3 87033856 146800606 28.5 GiB 8E00
4 83888128 84936703 512.0 MiB EF02
5 2048 8390655 4.0 GiB 0700
6 84936704 87033855 1024.0 MiB 8200

Command (? for help): d
Partition number (1-6): 3

Command (? for help): n
Partition number (3-128, default 3): 3
First sector (34-209715166, default = 87033856) or {+-}size{KMGTP}: 87033856
Last sector (87033856-209715166, default = 209715166) or {+-}size{KMGTP}:enter
Current type is ‘Linux filesystem’
Hex code or GUID (L to show codes, Enter = 8300): 8E00
Changed type of partition to ‘Linux LVM’

Command (? for help): p
Disk /dev/sda: 209715200 sectors, 100.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F38B7347-1E89-4FA0-80D9-0A3004FD4B4C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 209715166
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 46139392 83888127 18.0 GiB 0700
2 8390656 46139391 18.0 GiB 0700
3 87033856 209715166 58.5 GiB 8E00 Linux LVM
4 83888128 84936703 512.0 MiB EF02
5 2048 8390655 4.0 GiB 0700
6 84936704 87033855 1024.0 MiB 8200

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

[root@XEN-SRV-14 ~]#reboot

[root@XEN-SRV-14 ~]# pvresize /dev/sda3 –config global{metadata_read_only=0}
Physical volume “/dev/sda3” changed
1 physical volume(s) resized / 0 physical volume(s) not resized

[root@XEN-SRV-14 ~]# pvscan
PV /dev/sda3 VG XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc lvm2 [58.48 GiB / 30.00 GiB free]
Total: 1 [58.48 GiB] / in use: 1 [58.48 GiB] / in no VG: 0 [0 ]

[root@XEN-SRV-14 ~]# lvdisplay
— Logical volume —
LV Path /dev/XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc
LV Name bf485a05-f029-c203-9ae4-43aa4deda6dc
VG Name XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc
LV UUID fQ6Jek-knk1-UV0S-V130-7bPu-IqQc-FgEAEE
LV Write Access read/write
LV Creation host, time localhost, 2021-02-08 14:21:20 +0100
LV Status available
# open 1
LV Size 28.48 GiB
Current LE 7292
Segments 1
Allocation inherit
Read ahead sectors auto

  • currently set to 256
    Block device 253:0 [root@XEN-SRV-14 ~]# lvresize /dev/XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc -l +100%FREE –config global{metadata_read_only=0}
    Size of logical volume XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc changed from 28.48 GiB (7292 extents) to 58.48 GiB (14972 extents).
    Logical volume bf485a05-f029-c203-9ae4-43aa4deda6dc successfully resized.
    [root@XEN-SRV-14 ~]# lvdisplay
    — Logical volume —
    LV Path /dev/XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc
    LV Name bf485a05-f029-c203-9ae4-43aa4deda6dc
    VG Name XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc
    LV UUID fQ6Jek-knk1-UV0S-V130-7bPu-IqQc-FgEAEE
    LV Write Access read/write
    LV Creation host, time localhost, 2021-02-08 14:21:20 +0100
    LV Status available open 1 LV Size 58.48 GiB
    Current LE 14972
    Segments 1
    Allocation inherit
    Read ahead sectors auto
  • currently set to 256
    Block device 253:0
    ?

[root@XEN-SRV-14 ~]# resize2fs /dev/XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc is mounted on /run/sr-mount/bf485a05-f029-c203-9ae4-43aa4deda6dc; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 4
The filesystem on /dev/XSLocalEXT-bf485a05-f029-c203-9ae4-43aa4deda6dc/bf485a05-f029-c203-9ae4-43aa4deda6dc is now 15331328 blocks long.

[root@XEN-SRV-14 ~]# xe sr-scan uuid=bf485a05-f029-c203-9ae4-43aa4deda6dc
[root@XEN-SRV-14 ~]#

[root@XEN-SRV-14 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 289M 0 289M 0% /dev
tmpfs 298M 36K 298M 1% /dev/shm
tmpfs 298M 788K 298M 1% /run
tmpfs 298M 0 298M 0% /sys/fs/cgroup
/dev/sda1 18G 1.7G 16G 10% /
xenstore 298M 0 298M 0% /var/lib/xenstored
/dev/loop0 44M 44M 0 100% /var/xen/xc-install
/dev/sda5 3.9G 54M 3.6G 2% /var/log
/dev/mapper/XSLocalEXT–bf485a05–f029–c203–9ae4–43aa4deda6dc-bf485a05–f029–c203–9ae4–43aa4deda6dc 58G 52M 55G 1% /run/sr-mount/bf485a05-f029-c203-9ae4-43aa4deda6dc
tmpfs