Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error executing action create on resource 'lvm_physical_volume['/dev/sdb']' #99

Open
bcorner13 opened this issue Jun 9, 2016 · 2 comments

Comments

@bcorner13
Copy link

Cookbook version

2.1

Chef-client version

version 12.8.1

Platform Details

Red Hat Enterprise Linux Server release 6.7 (Santiago)

Scenario:

execute lvm_physical_volume physical_volumes.to_s on subsequent executions of the chef client

Steps to Reproduce:

lvm_physical_volume physical_volumes.to_s

lvm_volume_group group.to_s do
physical_volumes physical_volumes.to_s
end

lvm_logical_volume name.to_s do
group group.to_s
size size.to_s
filesystem filesystem.to_s
mount_point mount_point.to_s
if stripes.to_i > 0
stripes = stripes.to_s
end
end

If I comment out the lvm_physical_volume it completes. So its not detecting that the pvcreate has already been run.

Expected Result:

to see the pvcreate has already been executed and continue execution of cookbook.

Actual Result:

================================================================================
Error executing action `create` on resource 'lvm_physical_volume['/dev/sdb']'
================================================================================

LVM::External::ExternalFailure
------------------------------
Fatal error, `/sbin/lvm pvcreate '/dev/sdb'` returned 5 with 'Can't initialize physical volume "/dev/sdb" of volume group "vg01" without -ff'
@tas50 tas50 added the Type: Bug label Jan 4, 2017
@fooshards
Copy link

provide pvdisplay lsblk output please

Marking -ff implies that you need to force pvcreate, aka a phys volume has already been created on that block device

@sconicelli
Copy link

Hello @fooshards , I am unfortunately running into the same issue... is there a way to "force" the pvcreate in this type of situation? I have a VG that already exists and I am trying to add the physical volume to the VG. I've added the "wipe_signatures true" attribute in my code but am still getting the same error as @bcorner13... not sure if this is the appropriate way to resolve this issue, or if there is something else I could be missing?

Error:
Chef Client failed. 0 resources updated in 56 seconds [2023-08-23T21:01:27+02:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out [2023-08-23T21:01:27+02:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2023-08-23T21:01:27+02:00] FATAL: LVM::External::ExternalFailure: lvm_physical_volume[/dev/nvme3n1] (srv_000033_sap::incl-sap_storage line 233) had an error: LVM::External::ExternalFailure: Fatal error, /sbin/lvm pvcreate /dev/nvme3n1 -qq returned 5 with 'Can't initialize physical volume "/dev/sdj" of volume group "vgoriglog" without -ff /dev/sdj: physical volume not initialized.'

Using version 6.1.0 of the LVM cookbook...

The following code block is what is failing:
` # create vol grp and lv
lvm_volume_group vg_name do
# physical_volumes /dev/nvme4n1 /dev/nvme5n1 /dev/nvme6n1
physical_volumes my_bds
# This is needed to allow lvm to create additional volumes within one volume group
wipe_signatures true

            # create logical volume within vg block
            logical_volume lv_name do
              # size 100%FREE, or Size of the volume, including units (k, K, m, M, g, G, t, T)
              size lv_size
              # filesystem xfs
              filesystem fstype
              # filesystem params 
              # (new as of v1.2.0 to manage 1k block size where necessary since default is 4k)
              # E.g., fs_params var can be set to "-b size=1024"
              filesystem_params fsparams unless missing?(fsparams)
              # mount_point /my/mountpoint
              mount_point lv_mountpoint
              # stripes 3
              stripes lv_stripes unless missing?(lv_stripes)
              # stripesize 256
              stripe_size lv_stripesize unless missing?(lv_stripesize)
            end
          end`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants