linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Read LVM structure of a virtual machine disk image
@ 2014-06-30  8:36 Matteo Lanati
  2014-06-30  9:30 ` Zdenek Kabelac
  0 siblings, 1 reply; 3+ messages in thread
From: Matteo Lanati @ 2014-06-30  8:36 UTC (permalink / raw)
  To: linux-lvm

Hi all,

I have a file containing a disk image of a virtual machine. One of the partitions is LVM.
I would like to read the information in there (i.e. the volume group name or the list of logical volumes) from the file itself without exposing the device through kpartx and/or qemu-nbd.
My problem is that on the same physical host I could have multiple copies of the same virtual machine running, using same VGs and LVs. Even the UUID would be the same, hence the impossibility to distinguish the two virtual machines anymore.
Of course, if I could check beforehand the structure of the disk image I could take a different decision and avoid errors.
Thanks,

Matteo
 

A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year.

Andrew S. Tanenbaum, Computer Networks, 2003, Introduction, page 14

Linux registered user #463400

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Read LVM structure of a virtual machine disk image
  2014-06-30  8:36 [linux-lvm] Read LVM structure of a virtual machine disk image Matteo Lanati
@ 2014-06-30  9:30 ` Zdenek Kabelac
  2014-06-30 15:10   ` Matteo Lanati
  0 siblings, 1 reply; 3+ messages in thread
From: Zdenek Kabelac @ 2014-06-30  9:30 UTC (permalink / raw)
  To: LVM general discussion and development

Dne 30.6.2014 10:36, Matteo Lanati napsal(a):
> Hi all,
>
> I have a file containing a disk image of a virtual machine. One of the partitions is LVM.
> I would like to read the information in there (i.e. the volume group name or the list of logical volumes) from the file itself without exposing the device through kpartx and/or qemu-nbd.
> My problem is that on the same physical host I could have multiple copies of the same virtual machine running, using same VGs and LVs. Even the UUID would be the same, hence the impossibility to distinguish the two virtual machines anymore.
> Of course, if I could check beforehand the structure of the disk image I could take a different decision and avoid errors.
> Thanks,


That's why there is a 'filter' setting in your lvm.conf.

You may set different device filter for each lvm command.

You could either use '--config' option with each lvm command where you set 
your filter to view only given device - or eventually with latest versions you 
may try to use profiles.

It's a users' fault to pass multiple same devices to lvm - it's mandatory to 
use different UUIDs, and it's upto user to choose how to achieve it. There is 
no way for lvm2 to resolve this inconsistency in come 'always-be-smart' way...

Zdenek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Read LVM structure of a virtual machine disk image
  2014-06-30  9:30 ` Zdenek Kabelac
@ 2014-06-30 15:10   ` Matteo Lanati
  0 siblings, 0 replies; 3+ messages in thread
From: Matteo Lanati @ 2014-06-30 15:10 UTC (permalink / raw)
  To: LVM general discussion and development

Hi Zdenek,

thanks a lot for your input, I would have never figure that out by myself ;-)
All the best,

Matteo




A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year.

Andrew S. Tanenbaum, Computer Networks, 2003, Introduction, page 14

Linux registered user #463400

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-30 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30  8:36 [linux-lvm] Read LVM structure of a virtual machine disk image Matteo Lanati
2014-06-30  9:30 ` Zdenek Kabelac
2014-06-30 15:10   ` Matteo Lanati

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).