Score:0

Can I override the LVM volume group name using storage: layout in the autoinstaller?

cn flag

I have physical machines with multiple (n) hard-drives that I want to install identical copies of Ubuntu 20.04 on using the Automated Server Install. My hope was to just be able to use the LVM layout on each disk, to keep things as simple as possible.

My autoinstaller config uses the following,

storage:
  layout:
    name: lvm
    match:
      path: <DISK NAME E.G. /dev/sda>

The first install works just fine - but of course install number two barfs in Curtain/Subiquity because the LVM volume group already exists (ubuntu-vg),

/dev/ubuntu-vg: already exists in filesystem

Is it is possible to override the volume group name using the layout method? Checking the installer logs, it looks like ubuntu-vg is hardcoded into some default subiquity.conf template somewhere, and may not be accessible at all. Is there some other way to override that in another argument that I'm not seeing? Or am I stuck with using action-based config?

Score:0
cn flag

It is not possible.

Though it was a simple task to just pull the layout being applied from the generated subiquity configuration. I ended up just using that as a template template to generate the appropriate action-based config to the appropriate disk. Here's the basic yaml with an included boot and grub partitions - with slight modifications to use the entire disk for the OS.

storage:
    config:
      - id: disk-sda
        type: disk
        ptable: gpt
        path: /dev/sda
        wipe: superblock
        preserve: false
        name: main_disk
        grub_device: true
      - id: partition-0
        type: partition
        device: disk-sda
        size: 1M
        flag: bios_grub
        number: 1
        preserve: false
      - device: disk-sda
        size: 1G
        wipe: superblock
        flag: ''
        number: 2
        preserve: false
        type: partition
        id: partition-1
      - fstype: ext4
        volume: partition-1
        preserve: false
        type: format
        id: format-0
      - device: disk-sda
        size: -1
        wipe: superblock
        flag: ''
        number: 3
        preserve: false
        type: partition
        id: partition-2
      - name: <CUSTOM VG NAME HERE>
        devices: [partition-2]
        preserve: false
        type: lvm_volgroup
        id: lvm_volgroup-0
      - name: <CUSTOM LV NAME HERE>
        volgroup: lvm_volgroup-0
        size: -1
        preserve: false
        type: lvm_partition
        id: lvm_partition-0
      - fstype: ext4
        volume: lvm_partition-0
        preserve: false
        type: format
        id: format-1
      - device: format-1
        path: /
        type: mount
        id: mount-1
      - device: format-0
        path: /boot
        type: mount
        id: mount-0
    version: 1
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.