Diskimage-builder complex disk setup

Ignazio Cassano ignaziocassano at gmail.com
Sat Mar 21 14:48:16 UTC 2020


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



Il giorno sab 21 mar 2020 alle ore 14:24 Stephen Nemeth <kbaegis at gmail.com>
ha scritto:

> Hi all,
>
> We’re attempting to create user images to deploy with metal^3/ironic.
>
> I’m making almost no headway starting from any of the examples provided
> for the DIB_BLOCK_DEVICE_CONFIG setup.
>
> Is there a repository with practical values located anywhere? I’m finding
> the documentation insufficient to do anything more complicated than a
> single partition setup.
>
> Here’s what I’ve gotten so far. Help greatly appreciated:
>
> ```
> [
>   {
>     "local_loop": {
>       "name": "image0",
>       "size": "20GiB"
>     }
>   },
>   {
>     "partitioning": {
>       "base": "image0",
>       "label": "gpt",
>       "partitions": [
>         {
>           "name": "ESP",
>           "type": "EF00",
>           "size": "16MiB"
>         },
>         {
>           "name": "boot",
>           "type": "EF02",
>           "size": "6GiB"
>         },
>         {
>           "name": "lvm",
>           "type": 8,
>           "size": "100%"
>         }
>       ]
>     }
>   },
>   {
>     "lvm": {
>       "name": "lvm2",
>       "pvs": [
>         {
>           "name": "pv",
>           "options": [
>             "--force"
>           ],
>           "device": "lvm",
>           "base": "image0"
>         }
>       ],
>       "vgs": [
>         {
>           "name": "vg",
>           "base": [
>             "pv"
>           ],
>           "options": [
>             "--force"
>           ]
>         }
>       ],
>       "lvs": [
>         {
>           "name": "root",
>           "base": "vg",
>           "extents": "100%FREE",
>           "options": [
>             "--zero=n"
>           ]
>         }
>       ]
>     }
>   },
>   {
>     "mkfs": {
>         {
>           "name": "mkfs_root",
>           "base": "root",
>           "type": "btrfs",
>           "label": "root",
>           "opts": "-f",
>           "mount": { "mount_point": "/" }
>         },
>         {
>           "name": "mkfs_efi",
>           "base": "ESP",
>           "type": "vfat",
>           "label": "efi",
>           "opts": "-f",
>           "mount": { "mount_point": "/boot/efi/" }
>         },
>         {
>           "name": "mkfs_boot",
>           "base": "boot",
>           "type": "btrfs",
>           "label": "boot",
>           "opts": "-f",
>           "mount": { "mount_point": "/boot/" }
>         }
>     }
>   }
> ]
> ```
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20200321/187151bd/attachment.html>


More information about the openstack-discuss mailing list