mkfs command should specify regular file option for different logical block size

Bug #1772928 reported by Yang Youseok
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Undecided
Unassigned

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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/577363

Changed in nova:
assignee: nobody → Yang Youseok (ileixe)
status: New → In Progress
Revision history for this message
Yang Youseok (ileixe) wrote :

Does anybody affect this bug? I need someone to review this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Balazs Gibizer (<email address hidden>) on branch: master
Review: https://review.opendev.org/577363
Reason: This is a pretty old patch in merge conflict. Feel free to restore it (or ask gibi on irc to restore it) if you still working on it.

Changed in nova:
status: In Progress → Confirmed
assignee: Yang Youseok (ileixe) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.