[libvirt] Remove hugepages creation test
The tests is useless as libvirt is not running in the pod cgroup so pod settings are not applied to it. Change-Id: Ice3957c800e29a0885a341103c453c4d6c921fd3
This commit is contained in:
parent
3903f54d0c
commit
ea3c04a7d9
@ -15,7 +15,7 @@ apiVersion: v1
|
|||||||
appVersion: v1.0.0
|
appVersion: v1.0.0
|
||||||
description: OpenStack-Helm libvirt
|
description: OpenStack-Helm libvirt
|
||||||
name: libvirt
|
name: libvirt
|
||||||
version: 0.1.33
|
version: 0.1.34
|
||||||
home: https://libvirt.org
|
home: https://libvirt.org
|
||||||
sources:
|
sources:
|
||||||
- https://libvirt.org/git/?p=libvirt.git;a=summary
|
- https://libvirt.org/git/?p=libvirt.git;a=summary
|
||||||
|
@ -24,13 +24,6 @@ if [ -f /tmp/vnc.crt ]; then
|
|||||||
mv /tmp/vnc-ca.crt /etc/pki/libvirt-vnc/ca-cert.pem
|
mv /tmp/vnc-ca.crt /etc/pki/libvirt-vnc/ca-cert.pem
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: We disable cgroup functionality for cgroup v2, we should fix this in the future
|
|
||||||
if $(stat -fc %T /sys/fs/cgroup/ | grep -q cgroup2fs); then
|
|
||||||
CGROUP_VERSION=v2
|
|
||||||
else
|
|
||||||
CGROUP_VERSION=v1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$(cat /proc/*/comm 2>/dev/null | grep -w libvirtd)" ]; then
|
if [ -n "$(cat /proc/*/comm 2>/dev/null | grep -w libvirtd)" ]; then
|
||||||
set +x
|
set +x
|
||||||
for proc in $(ls /proc/*/comm 2>/dev/null); do
|
for proc in $(ls /proc/*/comm 2>/dev/null); do
|
||||||
@ -82,41 +75,6 @@ if [ 0"$hp_count" -gt 0 ]; then
|
|||||||
echo "ERROR: Hugepages configured in kernel, but libvirtd container cannot access /dev/hugepages"
|
echo "ERROR: Hugepages configured in kernel, but libvirtd container cannot access /dev/hugepages"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $CGROUP_VERSION != "v2" ]; then
|
|
||||||
# Kubernetes 1.10.x introduced cgroup changes that caused the container's
|
|
||||||
# hugepage byte limit quota to zero out. This workaround sets that pod limit
|
|
||||||
# back to the total number of hugepage bytes available to the baremetal host.
|
|
||||||
if [ -d /sys/fs/cgroup/hugetlb ]; then
|
|
||||||
limits="$(ls /sys/fs/cgroup/hugetlb/{{ .Values.conf.kubernetes.cgroup }}/hugetlb.*.limit_in_bytes)" || \
|
|
||||||
(echo "ERROR: Failed to locate any hugetable limits. Did you set the correct cgroup in your values used for this chart?"
|
|
||||||
exit 1)
|
|
||||||
for limit in $limits; do
|
|
||||||
target="/sys/fs/cgroup/hugetlb/$(dirname $(awk -F: '($2~/hugetlb/){print $3}' /proc/self/cgroup))/$(basename $limit)"
|
|
||||||
# Ensure the write target for the hugepage limit for the pod exists
|
|
||||||
if [ ! -f "$target" ]; then
|
|
||||||
echo "ERROR: Could not find write target for hugepage limit: $target"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Write hugetable limit for pod
|
|
||||||
echo "$(cat $limit)" > "$target"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine OS default hugepage size to use for the hugepage write test
|
|
||||||
default_hp_kb="$(cat /proc/meminfo | grep Hugepagesize | tr -cd '[:digit:]')"
|
|
||||||
|
|
||||||
# Attempt to write to the hugepage mount to ensure it is operational, but only
|
|
||||||
# if we have at least 1 free page.
|
|
||||||
num_free_pages="$(cat /sys/kernel/mm/hugepages/hugepages-${default_hp_kb}kB/free_hugepages | tr -cd '[:digit:]')"
|
|
||||||
echo "INFO: '$num_free_pages' free hugepages of size ${default_hp_kb}kB"
|
|
||||||
if [ 0"$num_free_pages" -gt 0 ]; then
|
|
||||||
(fallocate -o0 -l "$default_hp_kb" /dev/hugepages/foo && rm /dev/hugepages/foo) || \
|
|
||||||
(echo "ERROR: fallocate failed test at /dev/hugepages with size ${default_hp_kb}kB"
|
|
||||||
rm /dev/hugepages/foo
|
|
||||||
exit 1)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${LIBVIRT_CEPH_CINDER_SECRET_UUID}" ] || [ -n "${LIBVIRT_EXTERNAL_CEPH_CINDER_SECRET_UUID}" ] ; then
|
if [ -n "${LIBVIRT_CEPH_CINDER_SECRET_UUID}" ] || [ -n "${LIBVIRT_EXTERNAL_CEPH_CINDER_SECRET_UUID}" ] ; then
|
||||||
|
@ -34,4 +34,5 @@ libvirt:
|
|||||||
- 0.1.31 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default
|
- 0.1.31 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default
|
||||||
- 0.1.32 Enable a flag to parse Libvirt Nova metadata in libvirt exporter
|
- 0.1.32 Enable a flag to parse Libvirt Nova metadata in libvirt exporter
|
||||||
- 0.1.33 Handle cgroupv2 correctly
|
- 0.1.33 Handle cgroupv2 correctly
|
||||||
|
- 0.1.34 Remove hugepages creation test
|
||||||
...
|
...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user