木偶:无法添加物理卷

我想在Puppet中创build一个物理卷。 以下是我的代码

class lvm::crelvm { physical_volume { '/dev/sdb2': ensure => present } volume_group { 'vg_cas': ensure => present, physical_volumes => '/dev/sdb2', } 

}

但是我得到了下面的错误

  Error: Execution of '/sbin/pvcreate /dev/sdb2' returned 5: Device /dev/sdb2 not found (or igored by filtering). Error: /Stage[main]/Lvm::Crelvm/Physical_volume[/dev/sdb2]/ensure: change from absent to present failed: Execution of '/sbin/pvcreate /dev/sdb2' returned 5: Device /dev/sdb2 not found (or ignored by filtering). Error: Execution of '/sbin/vgcreate vg_cas /dev/sdb2' returned 5: Physical volume /dev/sdb2 not found Device /dev/sdb2 not found (or ignored by filtering). Unable to add physical volume '/dev/sdb2' to volume group 'vg_cas'. Error: /Stage[main]/Lvm::Crelvm/Volume_group[vg_cas]/ensure: change from absent to present failed: Execution of '/sbin/vgcreate vg_cas /dev/sdb2' returned 5: Physical volume /dev/sdb2 not found Device /dev/sdb2 not found (or ignored by filtering). Unable to add physical volume '/dev/sdb2' to volume group 'vg_cas'. 

已经创build了“/ dev / sdb1”,还在/ dev / sdb1 / vg03下创build了卷组

所以我改变了我的代码如下

  class lvm::crelvm { volume_group { 'vg_cas': ensure => present, physical_volumes => '/dev/sdb1', } 

当我编译时,我得到了

  Error: Execution of '/sbin/vgcreate vg_cas /dev/sdb1' returned 5: Physical volume '/dev/sdb1' is already in volume group 'vg03' Unable to add physical volume '/dev/sdb1' to volume group 'vg_cas'. So how can I create new physical volume and add vg_cas volume group on this. 

我是傀儡和unixpipe理员的新手。

Physical volume '/dev/sdb1' is already in volume group 'vg03' < – 该磁盘已经或者已经是卷组的一部分。 先将其从其他卷组中删除。