Jim Gauld 617d58053b Add docker disk usage to collect containerization
This adds 'docker system df' and 'du -h --max-depth 1 /var/lib/docker'
commands to collect containerization_images.info.

This gives high level of usage and first-level breakdown. This is
useful in diagnosing file-system usage of /var/lib/docker if there
are remnants from initial install, or if an admin does manual docker
operations which consumes many extraneous GB.

We expect CRI stuff under: /var/lib/docker/io.containerd.* .

The containerization_images.info has the following new sections:

--------------------------------------------------------------------
Fri Jun  3 21:13:09 UTC 2022 :  : docker system df
--------------------------------------------------------------------
TYPE            TOTAL  ACTIVE  SIZE     RECLAIMABLE
Images          1      0       688.5MB  688.5MB (100%)
Containers      0      0       0B       0B
Local Volumes   0      0       0B       0B
Build Cache     0      0       0B       0B

--------------------------------------------------------------------
Fri Jun  3 21:13:09 UTC 2022 :  : du -h --max-depth 1 /var/lib/docker
--------------------------------------------------------------------
0       /var/lib/docker/containers
0       /var/lib/docker/plugins
719M    /var/lib/docker/overlay2
2.9M    /var/lib/docker/image
24K     /var/lib/docker/volumes
0       /var/lib/docker/trust
32K     /var/lib/docker/network
0       /var/lib/docker/swarm
16K     /var/lib/docker/builder
56K     /var/lib/docker/buildkit
0       /var/lib/docker/tmpmounts
1.7G    /var/lib/docker/io.containerd.content.v1.content
0       /var/lib/docker/io.containerd.snapshotter.v1.native
5.0G    /var/lib/docker/io.containerd.snapshotter.v1.overlayfs
3.9M    /var/lib/docker/io.containerd.metadata.v1.bolt
0       /var/lib/docker/io.containerd.runtime.v1.linux
12K     /var/lib/docker/io.containerd.runtime.v2.task
664K    /var/lib/docker/io.containerd.grpc.v1.cri
0       /var/lib/docker/tmp
0       /var/lib/docker/runtimes
7.4G    /var/lib/docker

It is likely that an admin requires manual cleanup using commands like:
docker rmi x
docker system prune --force

An admin may also cleanup the CRI but that is already governed by kubelet
image garbage collection file-system usage thresholds.
crictl rmi x
crictl rmi --prune

TESTING:
AIO-SX: Gather collect and inspect containerization_images.info

Closes-Bug: 1977750

Signed-off-by: Jim Gauld <james.gauld@windriver.com>
Change-Id: I468d5ebd18ad72385d74be7bee614fbc2cbb1e99
2022-06-06 10:13:12 -04:00
2019-10-24 13:23:53 -04:00
2019-09-09 13:43:49 -05:00
2019-09-09 13:43:49 -05:00

utilities

This file serves as documentation for the components and features included on the utilities repository.

PCI IRQ Affinity Agent

While in OpenStack it is possible to enable instances to use PCI devices, the interrupts generated by these devices may be handled by host CPUs that are unrelated to the instance, and this can lead to a performance that is lower than it could be if the device interrupts were handled by the instance CPUs.

The agent only acts over instances with dedicated vCPUs. For instances using shared vCPUs no action will be taken by the agent.

The expected outcome from the agent operation is achieving a higher performance by assigning the instances core to handle the interrupts from PCI devices used by these instances and avoid interrupts consuming excessive cycles from the platform cores.

Agent operation

The agent operates by listening to RabbitMQ notifications from Nova. When an instance is created or moved to the host, the agent checks for an specific flavor spec (detailed below) and if it does then it queries libvirt to map the instance vCPUs into pCPUs from the host.

Once the agent has the CPU mapping, it determines the IRQ for each PCI device used by the instance, and then it loops over all PCI devices and determines which host NUMA node is associated with the device, the pCPUs that are associated with the NUMA node and finally set the CPU affinity for the IRQs of the PCI device based on the pCPU list.

There is also a periodic audit that runs every minute and loops over the existing IRQs, so that if there are new IRQs that weren't mapped before the agent maps them, and if there are PCI devices that aren't associated to an instance that they were before, their IRQ affinity is reset to the default value.

Flavor spec

The PCI IRQ Affinity Agent uses a specific flavor spec for PCI interrupt affining, that is used to determine which vCPUs assigned to the instance must handle the interrupts from the PCI devices:

  • hw:pci_irq_affinity_mask=<vcpus_cpulist>

Where vcpus_cpulist can assume a comma-separated list of values that can be expressed as:

  • int: the vCPU expressed by int will be assigned to handle the interruptions from the PCI devices
  • int1-int2: the vCPUs between int1 and int2 (inclusive) will be used to handle the interruptions from the PCI devices
  • ^int: the vCPU expressed by int will not be assigned to handle the interruptions from the PCI devices and shall be used to exclude a vCPU that was included in a previous range

NOTE: int must be a value between 0 and flavor.vcpus - 1

Example: hw_pci_irq_affinity_mask=1-4,^3,6 means that vCPUs with indexes 1,2,4 and 6 from the vCPU list that Nova allocates to the instance will be assigned to handle interruptions from the PCI devices.

Limitations

  • No CPU affining is performed for instances using shared CPUs (i.e., when using flavor spec hw:cpu_policy=shared)
  • No CPU affining will be performed when invalid ranges are specified on the flavor spec, the agent instead will log error messages indicating the problem

Agent packaging

The agent code resides on the starlingx/utilities repo, along with the spec and docker_image files that are used to build a CentOS image with the agent wheel installed on it.

The agent is deployed by Armada along with the other OpenStack helm charts; refer to PCI IRQ Affinity Agent helm chart on starlingx/openstack-armada-app repository.

Description
StarlingX miscellaneous tools and utilities
Readme 11 MiB
Languages
Shell 53.7%
Python 39.2%
C 3.3%
Makefile 1.2%
HTML 1.1%
Other 1.3%