[ovirt-users] lvscan on rhv host

Nir Soffer nsoffer at redhat.com
Sun Mar 5 00:34:04 UTC 2017


On Sun, Mar 5, 2017 at 1:03 AM, Marcin Kruk <askifyouneed at gmail.com> wrote:
> Could somebody give me a links to doc or explain behavior of lv volumes in
> RHV 4 cluster, once they are active another time they are incative, and how
> to corelate the lv volumes names with disks of virtual machines, or other
> disks?

On engine side:

- Storage domain has disks
- Disk may have one or more snapshots

On vdsm side:

- Storage domains are lvm volume groups
- Snapshot are logical volumes in the storage domain volume group
  called "volume" in vdsm.
- Disk uuid is stored as logical volume tag in each snapshot
  called "image" in vdsm.

This is correct for block storage (iSCSI, FC). File storage is
completely different
but I guess that you are interested in block storage.

On vdsm side, logical volumes must be inactive unless a logical volume is used
for running vm or for storage operation.

There are special logical volumes (inbox, outbox, master, metadata, ids, leases,
xleases) that are active when a storage domain is active.

To correlate engine and vdsm sides:

1. Find the storage domain uuid using the REST api

    https://server-address/ovirt-engine/api/storagedomains/

2. List lvs in vdsm side

    lvs -o name,tags vg_name

You can see the disk uuid in the IU_<uuid> tags. (Image UUID)

To locate snapshots of particular disk you can use --select

    lvs --select 'lv_tags = { IU_<disk-uuid> }' vg_name

Example:

    # lvs --select 'lv_tags = {
IU_db343be2-f709-4835-b1c5-a1bbdb650b2a }'
aed577ea-d1ca-4ebe-af80-f852c7ce59bb
    LV                                   VG
       Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync
Convert
    91799827-85b8-450d-a521-42de12fa08e6
aed577ea-d1ca-4ebe-af80-f852c7ce59bb -wi-ao---- 1.00g

Finally, you can also use vdsm-tool to show all disks on a storage domain:

    # vdsm-tool dump-volume-chains aed577ea-d1ca-4ebe-af80-f852c7ce59bb

    Images volume chains (base volume first)

    image:    239d9e96-ad7d-4a7d-83af-d593877db11b

             - 93331705-46be-4cb8-9dc2-c1559843fd4a
               status: OK, voltype: SHARED, format: COW, legality:
LEGAL, type: SPARSE


    image:    aab45dbc-c016-4990-b834-ce455bbc4fef

             - ea556b30-e62b-4d66-b832-459a5dd01890
               status: OK, voltype: LEAF, format: RAW, legality:
LEGAL, type: PREALLOCATED


    image:    db343be2-f709-4835-b1c5-a1bbdb650b2a

             - 93331705-46be-4cb8-9dc2-c1559843fd4a
               status: OK, voltype: SHARED, format: COW, legality:
LEGAL, type: SPARSE

             - 91799827-85b8-450d-a521-42de12fa08e6
               status: OK, voltype: LEAF, format: COW, legality:
LEGAL, type: SPARSE


    image:    7324cafc-905f-475e-8217-1a919bcca9e9

             - dfbf69fc-3371-42d4-8298-415a6ad4244a
               status: OK, voltype: LEAF, format: RAW, legality:
LEGAL, type: PREALLOCATED

Nir


More information about the Users mailing list