growvols, enforce pvcreate and overwrite old VG signature
In some situations, when growvols run on disk which was already used or growvols runs on the same driver, pvcreate finds old VG signature and refuse to re-create PV on a block device. [ERROR] Running command failed: cmd "pvcreate /dev/sda6", stdout "", stderr " Can't initialize physical volume "/dev/sda6" of volume group "vg" without "-ff" /dev/sda6: physical volume not initialized. Closes-Bug: 2069487 Change-Id: Ie8e0641d5637e8c0c2edb23e820bc7961b7d319b
This commit is contained in:
parent
ac180b9ac6
commit
34cc4c5fb9
@ -577,6 +577,8 @@ def main(argv):
|
||||
|
||||
commands.append(Command([
|
||||
'pvcreate',
|
||||
'-ff',
|
||||
'--yes',
|
||||
dev_path
|
||||
], 'Initialize %s for use by LVM' % devname))
|
||||
|
||||
|
@ -726,7 +726,7 @@ class TestGrowvols(base.BaseTestCase):
|
||||
mock.call(['sgdisk', '--new=5:79267840:488265727',
|
||||
'--change-name=5:growvols', '/dev/sda']),
|
||||
mock.call(['partprobe']),
|
||||
mock.call(['pvcreate', '/dev/sda5']),
|
||||
mock.call(['pvcreate', '-ff', '--yes', '/dev/sda5']),
|
||||
mock.call(['vgextend', 'vg', '/dev/sda5']),
|
||||
mock.call(['lvextend', '--size', '+209404821504B',
|
||||
'/dev/mapper/vg-lv_root', '/dev/sda5']),
|
||||
@ -757,7 +757,7 @@ class TestGrowvols(base.BaseTestCase):
|
||||
mock.call(['sgdisk', '--new=5:79267840:488265727',
|
||||
'--change-name=5:growvols', '/dev/sda']),
|
||||
mock.call(['partprobe']),
|
||||
mock.call(['pvcreate', '/dev/sda5']),
|
||||
mock.call(['pvcreate', '-ff', '--yes', '/dev/sda5']),
|
||||
mock.call(['vgextend', 'vg', '/dev/sda5']),
|
||||
mock.call(['lvextend', '--size', '+41880125440B',
|
||||
'/dev/mapper/vg-lv_home', '/dev/sda5']),
|
||||
@ -828,7 +828,7 @@ class TestGrowvols(base.BaseTestCase):
|
||||
mock.call(['sgdisk', '--new=5:79267840:488265727',
|
||||
'--change-name=5:growvols', '/dev/sda']),
|
||||
mock.call(['partprobe']),
|
||||
mock.call(['pvcreate', '/dev/sda5']),
|
||||
mock.call(['pvcreate', '-ff', '--yes', '/dev/sda5']),
|
||||
mock.call(['vgextend', 'vg', '/dev/sda5']),
|
||||
mock.call(['lvextend', '--poolmetadatasize', '+1073741824B',
|
||||
'vg/lv_thinpool']),
|
||||
@ -877,7 +877,7 @@ class TestGrowvols(base.BaseTestCase):
|
||||
'--change-name=6:growvols', '/dev/dm-0']),
|
||||
mock.call(['multipath', '-r']),
|
||||
mock.call(['partprobe']),
|
||||
mock.call(['pvcreate', '/dev/mapper/mpatha6']),
|
||||
mock.call(['pvcreate', '-ff', '--yes', '/dev/mapper/mpatha6']),
|
||||
mock.call(['vgextend', 'vg', '/dev/mapper/mpatha6']),
|
||||
mock.call(['lvextend', '--poolmetadatasize', '+1073741824B',
|
||||
'vg/lv_thinpool']),
|
||||
|
Loading…
x
Reference in New Issue
Block a user