Extending Volume groups for CINDER

asked 2017-09-02 18:18:22 -0500

Georgios gravatar image

hi TEAM!!

I am writing the below guide for those that might had the same issue with me when the CINDER faces problems with space:

  1. Create an image storage, https://stackoverflow.com/questions/257844/quickly-create-a-large-file-on-a-linux-system (reference Link) Command: fallocate -l 30G /media/project0001.img

  2. Modifying the amount of loopback devices [reference link] (http://www.anthonyldechiaro.com/blog/2010/12/19/lvm-loopback-how-to/ (http://www.anthonyldechiaro.com/blog/...)) To see all the loopback devices: Command: ls -l /dev/loop

In case you need to add new loopback devices, If loopback support is compiled as a module: Command: modprobe loop max_loop=64

To make permanent edit /etc/modules or /etc/modprobe.conf and use add one of the following: loop max_loop=64 options loop max_loop=64

If loopback module is compiled into the kernel you will need to reboot, edit the kernel command-line parameters appending ‘max_loop=64’ to the end.

  1. Check the Volume Group
    Command: vgs output should be like the below:
    VG #PV #LV #SN Attr VSize VFree
    stack-volumes-default 1 0 0 wz--n- 10.01g 10.01g
    stack-volumes-lvmdriver-1 2 9 1 wz--n- 40.00g 31.00g

  2. Check the avaialble loopback devices
    Command: pvscan
    PV /dev/loop1 VG stack-volumes-lvmdriver-1 lvm2 [10.01 GiB / 10.01 GiB free]
    PV /dev/loop0 VG stack-volumes-default lvm2 [10.01 GiB / 10.01 GiB free]
    Total: 2 [20.02 GiB] / in use: 2 [20.02 GiB] / in no VG: 0 [0 ]

Means we can use loop3 up to the maximum number of loop<#>

  1. Link the image with a loopback storage device

    Command: losetup /dev/loop<the number you have created> /media/projecct0001.img

5.Extend the volume group stack-volumes-lvmdriver-1 Command:lvm vgextend "stack-volumes-lvmdriver-1" /dev/loop0 WARNING: dos signature detected on /dev/loop2 at offset 510. Wipe it? [y/n]: y <--Reply y Wiping dos signature on /dev/loop2. Physical volume "/dev/loop2" successfully created

  1. Check the extension Command: vgs
    VG #PV #LV #SN Attr VSize VFree
    stack-volumes-default 1 0 0 wz--n- 10.01g 10.01g
    stack-volumes-lvmdriver-1 4 0 0 wz--n- 100.00g 100.00g
edit retag flag offensive close merge delete