Hello, this is my example:
export DIB_BLOCK_DEVICE_CONFIG=$(cat mylvm_centos8_nmsf.yaml)
this is my mylvm_centos8_nmsf.yaml:
- local_loop:
name: image0
size: 30G
- partitioning:
base: image0
label: mbr
partitions:
- name: root
flags: [ boot,primary ]
size: 100%
- lvm:
name: lvm
base: [root]
pvs:
- name: pv
base: root
vgs:
- name: vg_rootcentos8
base: ["pv"]
lvs:
- name: lv_root
base: vg_rootcentos8
size: 5000M
- name: lv_var
base: vg_rootcentos8
size: 5000M
- name: lv_usr
base: vg_rootcentos8
size: 5000M
- name: lv_swap
base: vg_rootcentos8
size: 2000M
- name: lv_tmp
base: vg_rootcentos8
size: 1500M
- name: lv_appserv
base: vg_rootcentos8
size: 8000M
- mkfs:
name: mkfs_root
base: lv_root
label: "img-rootfs"
type: "ext4"
mount:
mount_point: /
fstab:
options: "noacl,errors=remount-ro"
fsck-passno: 1
- mkfs:
name: mkfs_var
base: lv_var
type: "ext4"
mount:
mount_point: /var
fstab:
options: "noacl"
fsck-passno: 2
- mkfs:
name: mkfs_usr
base: lv_usr
type: "ext4"
mount:
mount_point: /usr
fstab:
options: "noacl"
fsck-passno: 2
- mkfs:
name: mkfs_swap
base: lv_swap
type: "ext3"
mount:
mount_point: swap
fstab:
name: swap
options: "swap"
- mkfs:
name: mkfs_tmp
base: lv_tmp
type: "ext4"
mount:
mount_point: /tmp
fstab:
options: "noacl"
fsck-passno: 2
- mkfs:
name: mkfs_appserv
base: lv_appserv
type: "ext4"
mount:
mount_point: /appserv
fstab:
options: "noacl"
fsck-passno: 2
After creating the image I modified it as follows:
guestfish -a /tmp/centos8_nmsf_ansible_heat.qcow2 -i mkswap-L mkfs_swap /dev/vg_rootcentos8/lv_swap