Fix libvirt Dockerfile

By default all Openstack deployment test jobs
use latest-ubuntu_focal image which has libvirt
version 6.0.0 and qemu version 4.2 which is
incompatible with Bobcat. This old image was published
more than a year ago and since that has never been
updated and it also contains the nova user.

The Openstack deployment with newer libvirt
images fails due to this
https://review.opendev.org/c/openstack/openstack-helm-images/+/864772

This PR adds nova user which is necessary for libvirt
to successfully communicate with Nova.

Change-Id: I0d5f302261611b0666323178a52ca974126be1a5
This commit is contained in:
Vladimir Kozhukalov 2023-10-12 13:49:57 -05:00
parent e5563ae4c2
commit 8f3ffc08d6
1 changed files with 10 additions and 0 deletions

View File

@ -64,3 +64,13 @@ RUN <<EOF
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
ARG PROJECT=nova
ARG UID=42424
ARG GID=42424
RUN set -ex ;\
groupadd -g ${GID} ${PROJECT} ;\
useradd -u ${UID} -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT} ;\
mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\
chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\
usermod -a -G kvm ${PROJECT}