Create a vmpool on an existing lvm logical volume
I have the very bad habit to create a volume group over which build the pool of
my main disk. Then I suddenly need a lvm pool for my virtual machines with libvirt.
I use this trick: I create a logical volume in the volume group, I place
another volume group inside the aforementioned logic volume and then I create
over it the lvm pool. In commands
% lsblk sdb 8:16 0 5.5T 0 disk └─sdb1 8:17 0 5.5T 0 part └─lvm 254:1 0 5.5T 0 crypt ├─vg-vms 254:2 0 600G 0 lvm ├─vg-data 254:3 0 1.7T 0 lvm ├─vg-Winzozz 254:4 0 30G 0 lvm └─vg-shared 254:5 0 8G 0 lvm
% sudo lvcreate -l 100%FREE vg -n vmpool-me % sudo vgcreate vmpool /dev/mapper/vg-vmpool--me % lsblk sdb 8:16 0 5.5T 0 disk └─sdb1 8:17 0 5.5T 0 part └─lvm 254:1 0 5.5T 0 crypt ├─vg-vms 254:2 0 600G 0 lvm ├─vg-data 254:3 0 1.7T 0 lvm ├─vg-Winzozz 254:4 0 30G 0 lvm ├─vg-shared 254:5 0 8G 0 lvm └─vg-vmpool--me 254:6 0 3.1T 0 lvm % sudo virsh virsh # pool-define-as vmpool logical - - /dev/Terone/vmpool-me vmpool /dev/vmpool Pool vmpool defined virsh # pool-build vmpool Pool vmpool built virsh # pool-start vmpool Pool vmpool started
Obviously, everything is inside a luks encrypted partition 😉