ansible lvg模块详解

本文详细介绍了Ansible中的lvg模块,用于创建、删除和调整Linux卷组的大小。主要内容包括卷组的基本概念,如卷组名称(vg)、物理设备(pvs)和物理扩展大小(pesize)。此外,还提供了多个示例,展示如何使用该模块创建和管理卷组,以及注意事项,如PE大小的设定和单位。
摘要由CSDN通过智能技术生成

概述

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值