RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1171805 - vgimportclone doesn't work in RHEL 6.6
Summary: vgimportclone doesn't work in RHEL 6.6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.6
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Peter Rajnoha
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-08 16:18 UTC by Konstantin Volkov
Modified: 2019-08-15 04:08 UTC (History)
8 users (show)

Fixed In Version: lvm2-2.02.117-1.el6
Doc Type: Bug Fix
Doc Text:
The vgimportclone script makes some assumptions about the content of the lvm2 configuration file(s) on the system. In some cases, one or more of these assumptions is false and may cause the script to fail. We have rewritten the problematic portion of the script to make it more robust. In technical terms, we now use a new 'dumpconfig' feature to manipulate the configuration file instead of 'awk'.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:37:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
lvm.conf (57.07 KB, text/plain)
2014-12-09 11:28 UTC, Konstantin Volkov
no flags Details
vzimportclone (2.77 KB, text/plain)
2014-12-09 11:29 UTC, Konstantin Volkov
no flags Details
vgimportclone-d.log (2.15 KB, text/plain)
2014-12-09 11:45 UTC, Konstantin Volkov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1411 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2015-07-20 18:06:52 UTC

Description Konstantin Volkov 2014-12-08 16:18:33 UTC
vgimportclone doesn't work in RHEL 6.6

Version-Release number of selected component (if applicable):
[root@rhel66 ~]# rpm -qa lvm2
lvm2-2.02.111-2.el6_6.1.x86_64

How reproducible:
Always.

Steps to Reproduce:

1. Check existing VGs:
[root@rhel66 ~]# vgs
  VG          #PV #LV #SN Attr   VSize  VFree
  vg_rhel66     1   3   0 wz--n- 63,51g    0 
  vg_test       1   1   0 wz--n- 64,00g    0 

2. Try to rename a VG:
[root@rhel66 ~]# vgimportclone --basevgname vg_test2 /dev/sdb
Fatal: Temporary lvm.conf must contain 'filter' config.
[root@rhel66 ~]# echo $?
5

Actual results:
vgimportclone fails to rename an existing VG (error 5).

Expected results:
vgimportclone successfully renames an existing VG.

Additional info:
On lvm2 from RHEL 6.5 (lvm2-2.02.100-8.el6) all works as expected

Comment 2 Alasdair Kergon 2014-12-08 18:33:50 UTC
1) Please supply the output of 'bash -x vgimportclone...'

2) Please supply a copy of your LVM configuration file(s) e.g. /etc/lvm/lvm.conf

Comment 3 Alasdair Kergon 2014-12-08 18:40:04 UTC
You could also run with -d and look for the files in the temporary subdirectory it uses.

Comment 4 Konstantin Volkov 2014-12-09 11:28:11 UTC
Created attachment 966196 [details]
lvm.conf

Comment 5 Konstantin Volkov 2014-12-09 11:29:01 UTC
Created attachment 966197 [details]
vzimportclone

vzimportclone.log

Comment 6 Konstantin Volkov 2014-12-09 11:45:27 UTC
Created attachment 966200 [details]
vgimportclone-d.log

vgimportclone-d.log

Comment 7 Alasdair Kergon 2014-12-09 14:14:38 UTC
Thanks for that - I've reproduced this.
Since that script was written, we've enhanced 'dumpconfig' and might be able to use a new option instead of the 'awk' which is going wrong.

Comment 9 Alasdair Kergon 2014-12-09 17:53:58 UTC
As a workaround, try uncommenting the line in lvm.conf:
  filter = [ "a/.*/" ]

(but there are several problems with the awk statement)

Comment 10 Peter Rajnoha 2014-12-10 13:22:48 UTC
This patch replaces the awk with dumpconfig to generate temporary lvm.conf for use in vgimportclone script:

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

There was also another bug and that is the vgimportclone did not call pvscan --cache to notify lvmetad about changes if lvmetad is used:

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

Comment 12 Nenad Peric 2015-04-13 18:21:52 UTC
[root@tardis-02 fd]# lvcreate -L3G -n volume vg
  Logical volume "volume" created.
[root@tardis-02 fd]# dd if=/dev/sdb2 of=/dev/sdc2 
39054015+0 records in
39054015+0 records out
19995655680 bytes (20 GB) copied, 315.655 s, 63.3 MB/s

[root@tardis-02 fd]# pvs -a -o+pv_uuid
  Found duplicate PV Sf85Osj554iody2xe3aHN8LJp3ihjfL7: using /dev/sdc2 not /dev/sdb2
  PV                       VG          Fmt  Attr PSize   PFree  PV UUID  
/dev/sdb2                                 ---       0      0  Sf85Os-j554-iody-2xe3-aHN8-LJp3-ihjfL7
  /dev/sdb3                                 ---       0      0                                        
  /dev/sdb5                                 ---       0      0                                        
  /dev/sdb6                                 ---       0      0                                        
  /dev/sdc1                                 ---       0      0                                        
  /dev/sdc2                vg          lvm2 a--   18.62g 15.62g Sf85Os-j554-iody-2xe3-aHN8-LJp3-ihjfL7


[root@tardis-02 fd]# vgimportclone -n oldvg /dev/sdc2
  Found duplicate PV Sf85Osj554iody2xe3aHN8LJp3ihjfL7: using /dev/sdc2 not /dev/sdb2
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  Physical volume "/tmp/snap.pzwaQnM1/vgimport0" changed
  1 physical volume changed / 0 physical volumes not changed
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  Volume group "vg" successfully changed
  Volume group "vg" successfully renamed to "oldvg"
  Reading all physical volumes.  This may take a while...
  Found volume group "oldvg" using metadata type lvm2
  Found volume group "vg" using metadata type lvm2
  Found volume group "vg_tardis02" using metadata type lvm2
[root@tardis-02 fd]# echo $?
0

[root@tardis-02 fd]# vgs
  VG          #PV #LV #SN Attr   VSize   VFree 
  oldvg         1   1   0 wz--n-  18.62g 15.62g
  vg            1   1   0 wz--n-  18.62g 15.62g
  vg_tardis02   1   3   0 wz--n- 278.88g     0 
[root@tardis-02 fd]# lvs -a
  LV      VG          Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  volume  oldvg       -wi-------   3.00g                                                    
  volume  vg          -wi-a-----   3.00g                     


Marking VERIFIED with:

lvm2-2.02.118-1.el6.x86_64

Comment 13 errata-xmlrpc 2015-07-22 07:37:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1411.html


Note You need to log in before you can comment on or make changes to this bug.