Public bug reported: Description =========== mkfs command use direct I/O by default, and use 512 byte for logical block size for buffer alignment if no options specified.
The problem is that block device having different logical block size (e.g. NVMe) could not execute mkfs command at all because kernel refuse to write using user-space buffer which aligned 512 byte (Default value). There was debate on CLI interface on xfs code base (https://www.spinics.net/lists/xfs/msg24040.html), but it appears to have decided to stay in the current state. So I think we Nova have to change mkfs command option for other block device. Steps to reproduce ================== 1. Make flavor with ephemeral disk. Format is XFS 2. Create VM with the flavor 3. VM activated successfully, and static partition information filled. But failed to mount the ephemeral device. Expected result =============== 1. Successfully mount the ephemeral block device Actual result ============= 2. Failed. Environment =========== 1. Exact version of OpenStack you are running. See the following newton-eol, but master is same. 2. Which hypervisor did you use? Libvirt + KVM 2. Which storage type did you use? Ceph 3. Which networking type did you use? Neutron with linux-bridge Logs & Configs ============== These commands was executed in hypervisor. root@krane-pg1-com848:/var/lib/nova/instances/_base# cat /sys/block/nvme0n1/queue/logical_block_size 4096 root@krane-pg1-com848:/var/lib/nova/instances/_base# mkfs -t xfs ephemeral_100_310201b meta-data=ephemeral_100_310201b isize=512 agcount=4, agsize=6553600 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=0 data = bsize=4096 blocks=26214400, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=12800, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 mkfs.xfs: pwrite64 failed: Unknown error -22 As you can see if block device has 4096 byte logical block size, mkfs failed to format the device. ** Affects: nova Importance: Undecided Status: New -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1772928 Title: mkfs command should specify regular file option for different logical block size Status in OpenStack Compute (nova): New Bug description: Description =========== mkfs command use direct I/O by default, and use 512 byte for logical block size for buffer alignment if no options specified. The problem is that block device having different logical block size (e.g. NVMe) could not execute mkfs command at all because kernel refuse to write using user-space buffer which aligned 512 byte (Default value). There was debate on CLI interface on xfs code base (https://www.spinics.net/lists/xfs/msg24040.html), but it appears to have decided to stay in the current state. So I think we Nova have to change mkfs command option for other block device. Steps to reproduce ================== 1. Make flavor with ephemeral disk. Format is XFS 2. Create VM with the flavor 3. VM activated successfully, and static partition information filled. But failed to mount the ephemeral device. Expected result =============== 1. Successfully mount the ephemeral block device Actual result ============= 2. Failed. Environment =========== 1. Exact version of OpenStack you are running. See the following newton-eol, but master is same. 2. Which hypervisor did you use? Libvirt + KVM 2. Which storage type did you use? Ceph 3. Which networking type did you use? Neutron with linux-bridge Logs & Configs ============== These commands was executed in hypervisor. root@krane-pg1-com848:/var/lib/nova/instances/_base# cat /sys/block/nvme0n1/queue/logical_block_size 4096 root@krane-pg1-com848:/var/lib/nova/instances/_base# mkfs -t xfs ephemeral_100_310201b meta-data=ephemeral_100_310201b isize=512 agcount=4, agsize=6553600 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=0 data = bsize=4096 blocks=26214400, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=12800, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 mkfs.xfs: pwrite64 failed: Unknown error -22 As you can see if block device has 4096 byte logical block size, mkfs failed to format the device. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1772928/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

