概述
This module creates, removes or resizes volume groups.
创建、删除卷组以及动态改变卷组大小。
常用模块
vg : The name of the volume group
要创建的卷组名称
pvs : List of comma-separated devices to use as physical devices in this volume group.
Required when creating or resizing volume group. The module will take care of running pvcreate if needed.
要加入到卷组中的物理卷列表
pesize : The size of the physical extent. `pesize’ must be a power of 2 of at least 1 sector (where the sector size is the largest sector size of the PVs currently used in the VG), or at least 128KiB. Since Ansible 2.6, pesize can be optionally suffixed by a UNIT (k/K/m/M/g/G), default unit is megabyte. [Default: 4]
指定pe大小,默认值是4M,默认单位是M。
state : Control if the volume group exists. (Choices: absent, present)[Default: present]
模块状态,absent代表删除,present代表新建,默认是present。
示例
案例1:创建卷组(vg.services)并且将物理卷sdb1加入到卷组中,指定pe大小为32M。
- name: Create a volume group on top of /dev/sdb1 with physical extent size = 32MB
lvg:
vg: vg.services
pvs: /dev/sdb1
pesize: 32
指定PE的时候没有单位
[root@control ~]# ansible classroom -m lvg -a 'vg=vg.services pvs=/dev/sdb1 pesize=32'
classroom | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true