stackhpc / ansible-role-libvirt-vm

This role configures and creates VMs on a KVM hypervisor.
128 stars 67 forks source link

Fix lvm #62

Open roumano opened 3 years ago

roumano commented 3 years ago

Fix #61

roumano commented 3 years ago

Hi, i wanted to use the type=volume but see my details in the issue opened #61 , it's not working So, it why you see my proposed PR...

I have tested (again) with these variables :

On the destination server, the lv is created :

lvs |grep lv_test2
  lv_test2 lvm_pool      -wi-a-----  <9.32g

And the pool is correctly reconize by virsh

virsh pool-info lvm_pool
Name:           lvm_pool
UUID:           3f71157d-8145-45ed-a6de-ae8a077eae2d
State:          running
Persistent:     yes
Autostart:      yes
Capacity:       3.27 TiB
Allocation:     37.27 GiB
Available:      3.24 TiB

virsh vol-list lvm_pool
 Name       Path
------------------------------------
 lv_test1   /dev/lvm_pool/lv_test1
 lv_test2   /dev/lvm_pool/lv_test2
 lv_vm1     /dev/lvm_pool/lv_vm1
 lv_vm3     /dev/lvm_pool/lv_vm3
markgoddard commented 3 years ago

That's a shame. I had a quick search for issues but I don't really have time to investigate. If you want to add support for block devices, we can do that as a workaround.

For type=block, I think we should specify a path to a device, rather than specifying a pool. In this case, we would set dev=/dev/lvm_pool/ns3