LVM image build fails when VG name exists on build host
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
diskimage-builder |
In Progress
|
Undecided
|
Unassigned |
Bug Description
# Steps to reproduce
Build an image using an LVM recipe, e.g the following (taken from docs):
- lvm:
name: lvm
pvs:
- name: pv
base: root
vgs:
- name: vg
base: ["pv"]
lvs:
- name: lv_root
base: vg
size: 1800M
- name: lv_tmp
base: vg
size: 100M
- name: lv_var
base: vg
size: 500M
- name: lv_log
base: vg
size: 100M
- name: lv_audit
base: vg
size: 100M
- name: lv_home
base: vg
size: 200M
In this case, if there is a volume group called vg on the build host, the build would fail. The actual error gets swallowed in the logs, but if you run the command manually, you get this:
sudo vgcreate vg /dev/mapper/loop6p3 --force
/dev/vg: already exists in filesystem
Fix proposed to branch: master /review. opendev. org/c/openstack /diskimage- builder/ +/854427
Review: https:/