diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index b0e4395b2dd8..69eaebc18554 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2972,8 +2972,8 @@ class LibvirtDriver(driver.ComputeDriver): fd = None try: fd = os.open(testfile, os.O_CREAT | os.O_WRONLY | os.O_DIRECT) - # Check is the write allowed with 512 byte alignment - align_size = 512 + # Check is the write allowed with 4096 byte alignment + align_size = 4096 m = mmap.mmap(-1, align_size) m.write(b"x" * align_size) os.write(fd, m) diff --git a/releasenotes/notes/bug-1801702-c8203d3d55007deb.yaml b/releasenotes/notes/bug-1801702-c8203d3d55007deb.yaml new file mode 100644 index 000000000000..67fa573c49b3 --- /dev/null +++ b/releasenotes/notes/bug-1801702-c8203d3d55007deb.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + When testing whether direct IO is possible on the backing storage + for an instance, Nova now uses a block size of 4096 bytes instead + of 512 bytes, avoiding issues when the underlying block device has + sectors larger than 512 bytes. See bug + https://launchpad.net/bugs/1801702 for details.