![Puppet:无法添加物理卷](https://linux22.com/image/646128/Puppet%EF%BC%9A%E6%97%A0%E6%B3%95%E6%B7%BB%E5%8A%A0%E7%89%A9%E7%90%86%E5%8D%B7.png)
我想在 Puppet 中创建一个物理卷。以下是我的代码
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'.
已经创建了“/dev/sdb1”,并且还在“/dev/sdb1/vg03”下创建了卷组
所以我改变了我的代码如下
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.
我是 puppet 和 unix 管理的新手。
答案1
Physical volume '/dev/sdb1' is already in volume group 'vg03'
<-- 该磁盘是或曾经是卷组的一部分。请先将其从其他卷组中删除。