libvirt/src/storage
John Ferlan cafb934db8 logical: Add "--type snapshot" to lvcreate command
A recent lvm change has resulted in a change for the "default" type of
logical volume created when the "--virtualsize" or "--V" is supplied on
the command line (e.g. when the allocation and capacity values of a to
be created volume differ). It seems that at the very least the following
change adjusts the default type:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e0164f21

and the following may also have some impact.

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=87fc3b71

When using the virsh vol-create-as or vol-create xmlfile commands, the
result is that libvirt will now create a "thin logical volume" and a
"thin logical volume pool" rather than just a "thin snapshot logical
volume". For example the following sequence:

  # lvcreate --name test -L 2M -V 5M lvm_test
    Rounding up size to full physical extent 4.00 MiB
    Rounding up size to full physical extent 8.00 MiB
    Logical volume "test" created.
  # lvs lvm_test
    LV    VG       Attr       LSize Pool  Origin Data%  Meta%  Move Log Cpy%Sync Convert
    lvol1 lvm_test twi-a-tz-- 4.00m              0.00   0.98
    test  lvm_test Vwi-a-tz-- 8.00m lvol1        0.00

compared to the former code which had the following:

    LV   VG       Attr       LSize  Pool Origin         Data%  Move Log Cpy%Sync Convert
    test LVM_Test swi-a-s---  4.00m      [test_vorigin]   0.00

Since libvirt doesn't know how to parse the thin logical volume
and pool, it will fail to find the newly created volume and pool
even though it exists in the volume group.

It cannot find since the command used to find/parse returns a thin volume
'test' with no associated device, for example the output is:

  lvol1##UgUwkp-fTFP-C0rc-ufue-xrYh-dkPr-FGPFPx#lvol1_tdata(0)#thin-pool#1#4194304#4194304#4194304#twi-a-tz--
  test##NcaIoH-4YWJ-QKu3-sJc3-EOcS-goff-cThLIL##thin#0#8388608#4194304#8388608#Vwi-a-tz--

as compared to the former which had the following:

      test#[test_vorigin]#Dt5Of3-4WE6-buvw-CWJ4-XOiz-ywOU-YULYw6#/dev/sda3(1300)#linear#1#4194304#4194304#4194304#swi-a-s---

While it's possible to generate code to handle the new thin lv and pool, this
patch will add a "--type snapshot" onto the lvcreate command libvirt uses
in order to "for now" be able to continue to utilize the thin snapshots
2014-12-17 06:14:21 -05:00
..
parthelper.c Remove unnecessary curly brackets in src/storage/ 2014-11-14 17:13:01 +01:00
storage_backend_disk.c storage: Check stderr when matching parted output 2014-12-10 10:55:23 +01:00
storage_backend_disk.h
storage_backend_fs.c storage: backend: Log uid/gid when initializing storage file backend 2014-12-05 10:07:17 +01:00
storage_backend_fs.h storage: add file functions for local and block files 2014-02-14 10:47:57 +01:00
storage_backend_gluster.c storage: backend: Log uid/gid when initializing storage file backend 2014-12-05 10:07:17 +01:00
storage_backend_gluster.h storage: Add storage file backends for gluster 2014-02-14 11:07:23 +01:00
storage_backend_iscsi.c storage: Split out volume wiping as separate backend function 2014-07-17 10:12:34 +02:00
storage_backend_iscsi.h Move functions using iscsiadm to viriscsi.c 2014-03-20 18:04:50 +01:00
storage_backend_logical.c logical: Add "--type snapshot" to lvcreate command 2014-12-17 06:14:21 -05:00
storage_backend_logical.h
storage_backend_mpath.c Remove unnecessary curly brackets in src/storage/ 2014-11-14 17:13:01 +01:00
storage_backend_mpath.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
storage_backend_rbd.c Replace virSecretFree with virObjectUnref 2014-12-02 11:03:41 -05:00
storage_backend_rbd.h
storage_backend_scsi.c storage: Move and rename getVhbaSCSIHostParent 2014-12-01 10:04:19 -05:00
storage_backend_scsi.h storage: Move virStorageBackendSCSIGetHostNumber into iscsi backend 2013-04-08 18:41:06 +08:00
storage_backend_sheepdog.c conf: track sizes directly in source struct 2014-04-02 06:03:00 -06:00
storage_backend_sheepdog.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
storage_backend_zfs.c storage: zfs: implement pool build and delete 2014-09-18 18:08:29 +04:00
storage_backend_zfs.h storage: ZFS support 2014-08-12 19:40:20 +04:00
storage_backend.c virstoragefile: Have virStorageFileResize use safezero 2014-12-16 13:11:35 -05:00
storage_backend.h storage: Implement storage driver helper to chown disk images 2014-07-24 09:58:59 +02:00
storage_driver.c storage: Fix printing/casting of uid_t/gid_t 2014-12-08 11:36:29 +01:00
storage_driver.h storage: Introduce storagePoolLookupByTargetPath 2014-12-02 17:51:57 +01:00