add kernel option aio-max-nr for aio=native storage
For VMs that have disks with aio=native, the qemu will request an
io_setup with nr_events=1024, and hence on each VM startup, the
fs.aio-nr will be incremented by 1024. Once it reaches the
fs.aio-max-nrlimit (65536 by default), the new io_setup request
from the newly spawned VMs will fail with EAGAIN
Change-Id: I564d6b99e43e05b051de62d9aea2a1fe41dacd8a
diff --git a/releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml b/releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml
new file mode 100644
index 0000000..1f3ecad
--- /dev/null
+++ b/releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+ - |
+ This fix introduces a kernel option to adjust ``aio-max-nr``, ensuring that the
+ system can handle more asynchronous I/O events, preventing VM startup
+ failures related to AIO limits.
diff --git a/roles/sysctl/defaults/main.yml b/roles/sysctl/defaults/main.yml
index 509597e..dbb09e9 100644
--- a/roles/sysctl/defaults/main.yml
+++ b/roles/sysctl/defaults/main.yml
@@ -15,6 +15,8 @@
#
# List of ``sysctl`` parameters to set
sysctls:
+ - name: fs.aio-max-nr
+ value: 1048576
- name: net.ipv4.tcp_timestamps
value: 0
- name: net.ipv4.tcp_sack