community.general.aix_lvol 模块 – 配置 AIX LVM 逻辑卷

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。 它不包含在 ansible-core 中。 要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general

要在 playbook 中使用它,请指定:community.general.aix_lvol

概要

  • 此模块创建、删除或调整 AIX 逻辑卷的大小。 受 lvol 模块的启发。

参数

参数

注释

copies

整数

逻辑卷的副本数。

最大副本数为 3。

默认值: 1

lv

字符串 / 必需

逻辑卷的名称。

lv_type

字符串

逻辑卷的类型。

默认值: "jfs2"

opts

字符串

要传递给 mklv 命令的自由格式选项。

默认值: ""

policy

字符串

设置物理卷间分配策略。

maximum 将逻辑分区分配到最大数量的物理卷上。

minimum 将逻辑分区分配到最少数量的物理卷上。

选择

  • "maximum" ← (默认)

  • "minimum"

pvs

列表 / 元素=字符串

物理卷列表,例如 hdisk1,hdisk2

默认值: []

size

字符串

逻辑卷的大小,带 [MGT] 单位之一。

state

字符串

控制逻辑卷是否存在。如果 present 并且该卷尚不存在,则需要 size 选项。

选择

  • "absent"

  • "present" ← (默认)

vg

字符串 / 必需

此逻辑卷所属的卷组。

属性

属性

支持

描述

check_mode

支持:完全

可以在 check_mode 中运行,并返回更改的状态预测,而无需修改目标。

diff_mode

支持:

在 diff 模式下,当处于 check_mode 时,将返回有关已更改(或可能需要更改)的详细信息。

示例

- name: Create a logical volume of 512M
  community.general.aix_lvol:
    vg: testvg
    lv: testlv
    size: 512M

- name: Create a logical volume of 512M with disks hdisk1 and hdisk2
  community.general.aix_lvol:
    vg: testvg
    lv: test2lv
    size: 512M
    pvs: [ hdisk1, hdisk2 ]

- name: Create a logical volume of 512M mirrored
  community.general.aix_lvol:
    vg: testvg
    lv: test3lv
    size: 512M
    copies: 2

- name: Create a logical volume of 1G with a minimum placement policy
  community.general.aix_lvol:
    vg: rootvg
    lv: test4lv
    size: 1G
    policy: minimum

- name: Create a logical volume with special options like mirror pool
  community.general.aix_lvol:
    vg: testvg
    lv: testlv
    size: 512M
    opts: -p copy1=poolA -p copy2=poolB

- name: Extend the logical volume to 1200M
  community.general.aix_lvol:
    vg: testvg
    lv: test4lv
    size: 1200M

- name: Remove the logical volume
  community.general.aix_lvol:
    vg: testvg
    lv: testlv
    state: absent

返回值

常见的返回值记录在此处,以下是此模块独有的字段

描述

msg

字符串

描述任务结果的友好消息。

返回: 始终

示例: "已创建逻辑卷 testlv。"

作者

  • Alain Dejoux (@adejoux)