Re: [ovirt-users] lvscan on rhv host

2017-03-06 Thread Nir Soffer
On Mon, Mar 6, 2017 at 1:03 AM, Marcin Kruk  wrote:

Please reply to the list, other users may find this discussion valuable.

> 1. perfect and clear explanation
> 2. Could you explain "These are probably OVF_STORE volumes, used to keep vms
> ovs.", what is vms ovs,
> and what valuable information is in te ovf file which you extracted?

OVF is standard format for describing a VM:
https://en.wikipedia.org/wiki/Open_Virtualization_Format

All the VM that have a disk on a storage domain are stored in
the OVF_STORE disks using OVF format, so you can restore
all the VM from storage if you lost your engine database.

Or, if you want to move entire storage domain from one setup to another,
you can detach the storage domain from one setup, attach to the other
setup, and import all the VMs.

The OVF is also used by hosted engine to obtain engine vm setup from
storage, and start the engine vm after a host is rebooted.

> 3. perfect and clear
> Thank you
>
> 2017-03-05 12:32 GMT+01:00 Nir Soffer :
>>
>> On Sun, Mar 5, 2017 at 10:08 AM, Marcin Kruk 
>> wrote:
>> > VDSM side, means RHV HOST side, right?
>> > I missed LVM tags, so the command:
>> > lvs -o vg_name,name,lv_tags is very helpful, thanks.
>> >
>> > 1. Is it a tool in command line to show: disk ID, alias, atached to
>> > fields?
>>
>> No, you need to extract this info manually.
>>
>> Here is an example
>>
>> # lvs -o lv_name,size,attr,tags aed577ea-d1ca-4ebe-af80-f852c7ce59bb
>>   LV   LSize   Attr   LV Tags
>>   91799827-85b8-450d-a521-42de12fa08e6   1.00g -wi-ao
>>
>> IU_db343be2-f709-4835-b1c5-a1bbdb650b2a,MD_8,PU_93331705-46be-4cb8-9dc2-c1559843fd4a
>>   93331705-46be-4cb8-9dc2-c1559843fd4a   3.00g -wi-ao
>>
>> IU_239d9e96-ad7d-4a7d-83af-d593877db11b,MD_7,PU_----
>>   dfbf69fc-3371-42d4-8298-415a6ad4244a 128.00m -wi---
>>
>> IU_7324cafc-905f-475e-8217-1a919bcca9e9,MD_5,PU_----
>>   ea556b30-e62b-4d66-b832-459a5dd01890 128.00m -wi---
>>
>> IU_aab45dbc-c016-4990-b834-ce455bbc4fef,MD_4,PU_----
>>   ids  128.00m -wi-ao
>>   inbox128.00m -wi-a-
>>   leases 2.00g -wi-a-
>>   master 1.00g -wi-ao
>>   metadata 512.00m -wi-a-
>>   outbox   128.00m -wi-a-
>>   xleases1.00g -wi-a-
>>
>> What is dfbf69fc-3371-42d4-8298-415a6ad4244a?
>>
>> MD_5 means this volume metadata is at offset 5 * 512 in
>> 143dc2d0-8e1a-4b95-a306-2a26a7b4832f metadata
>>
>> # dd if=/dev/aed577ea-d1ca-4ebe-af80-f852c7ce59bb/metadata bs=512 count=1
>> skip=5
>>
>> # dd if=/dev/aed577ea-d1ca-4ebe-af80-f852c7ce59bb/metadata bs=512 count=1
>> skip=5
>> DOMAIN=aed577ea-d1ca-4ebe-af80-f852c7ce59bb
>> CTIME=1487525999
>> FORMAT=RAW
>> DISKTYPE=2
>> LEGALITY=LEGAL
>> SIZE=262144
>> VOLTYPE=LEAF
>> DESCRIPTION={"Updated":true,"Size":30720,"Last Updated":"Fri Feb 24
>> 20:49:24 EST 2017","Storage
>> Domains":[{"uuid":"aed577ea-d1ca-4ebe-af80-f852c7ce59bb"}],"Disk
>> Description":"OVF_STORE"}
>> IMAGE=7324cafc-905f-475e-8217-1a919bcca9e9
>> PUUID=----
>> MTIME=0
>> POOL_UUID=
>> TYPE=PREALLOCATED
>> GEN=0
>> EOF
>> 1+0 records in
>> 1+0 records out
>> 512 bytes (512 B) copied, 0.00146441 s, 350 kB/s
>>
>> So this is OVF_STORE disk, see bellow
>>
>> >
>> > 2. I found information about metadata, outbox etc volumes,
>> > but I can not find info about lvm volumes with 128 MiB size.
>> > Are these any metadata volumes? ex: from lvscan:
>> > ACTIVE
>> >
>> > '/dev/b41214a0-4748-47a8-85f2-9ad1e573ab10/57e904c5-3267-4d94-a52c-babb06912d90'
>> > [128.00 MiB] inherit' [128.00 MiB] inherit?
>>
>> These are probably OVF_STORE volumes, used to keep vms ovs.
>>
>> You can extract the data from these volumes like this:
>>
>> lvchange -ay
>> aed577ea-d1ca-4ebe-af80-f852c7ce59bb/dfbf69fc-3371-42d4-8298-415a6ad4244a
>>
>> # tar tvf
>> /dev/aed577ea-d1ca-4ebe-af80-f852c7ce59bb/dfbf69fc-3371-42d4-8298-415a6ad4244a
>> -rw-r--r-- 0/0 138 2017-02-25 03:49 info.json
>> -rw-r--r-- 0/0   11068 2017-02-25 03:49
>> 55e347d5-4074-4408-b782-c43011483845.ovf
>> -rw-r--r-- 0/0   10306 2017-02-25 03:49
>> bcb03d22-0799-4b0e-bcb3-f69954e6f5eb.ovf
>>
>> # tar xvf
>> /dev/aed577ea-d1ca-4ebe-af80-f852c7ce59bb/dfbf69fc-3371-42d4-8298-415a6ad4244a
>> bcb03d22-0799-4b0e-bcb3-f69954e6f5eb.ovf
>> bcb03d22-0799-4b0e-bcb3-f69954e6f5eb.ovf
>>
>> # dd if=bcb03d22-0799-4b0e-bcb3-f69954e6f5eb.ovf bs=512 count=1
>> > xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1/;
>>
>> xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData;
>>
>> 

Re: [ovirt-users] lvscan on rhv host

2017-03-04 Thread Nir Soffer
On Sun, Mar 5, 2017 at 1:03 AM, Marcin Kruk  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_ tags. (Image UUID)

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

lvs --select 'lv_tags = { IU_ }' 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
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] lvscan on rhv host

2017-03-04 Thread Marcin Kruk
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?
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users