I am using Ubuntu 14.04 as my dom0 for Xen hypervisor installed on my server. During Ubuntu installation I used set up LVM option. Now, I see that i have 3 partitions sda1, sda2 and sda5, of which sda5 is set as LVM physical volume. I have a few questions regarding that:
Why is the physical volume full ? I have not installed anything on my server except Xen.
I see that when installing the Ubuntu 14.04 server you allocated 144.1G from the ubuntu-vg
volume group for the dom0 root partition, but also allocated 128G for swap space, assigning all the available space on it (which is why it says allocatable (but full)
.
Are you sure you intended to have such a large swap?
Of the two logical volumes root and swap_1 which one can be expanded or shrunk ?
In the actual situation none of the volumes can be expanded, without shrinking the other. I suggest you reduce the swap to a more suitable size, 8G for instance.
To do that, first make sure to stop using the swap space:
root@ubuntu# swapoff /dev/mapper/ubuntu--vg-swap_1
then use LVM2 tools to resize the logical volume:
root@ubuntu# lvreduce -L 8G /dev/mapper/ubuntu--vg-swap_1
(more examples of shrinking logical volumes at https://www.rootusers.com/lvm-resize-how-to-decrease-an-lvm-partition/)
How do I create a new logical volume when the 2 logical volumes appear to have taken up all the space (magically)?
After you do the previous step, you should now have ~120G available on volume group ubuntu-vg
,
I want to install 4 VMs. Do i need a separate LV for each VM ?
It depends on what you find more flexible:
You can create xen domains with storage based on images, which are standard files inside dom0 root filesystem (in this case you may want to expand the root volume).
or,
You can create xen domains with storage based on LVM volumes. More info on this and examples in https://www.howtoforge.com/using-xen-with-lvm-based-vms-instead-of-image-based-vms-debian-etch