ansible lvg模块详解

概述

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
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值