Support configuring virt_mkfs and use a default of mkfs.ext4

Bug #1960231 reported by Edward Hope-Morley
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Nova Compute Charm
Fix Committed
Medium
Edward Hope-Morley

Bug Description

Since this is unconfigured in Nova by default, a default of vfat is used which is generally not desired for e.g. ephemeral volumes.

https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.virt_mkfs

Changed in charm-nova-compute:
importance: Undecided → Medium
Revision history for this message
Edward Hope-Morley (hopem) wrote :

We will also need to extend the apparmor profiles to support any commands that could be used like mke2fs.

Revision history for this message
Nobuto Murata (nobuto) wrote (last edit ):

The apparmor profile would definitely need to be fixed if it's blocking the mkfs operations. However, in terms of the default format, there seems to be a following logic[1].

If mkfs_command nor explicit fs is specified, then default_ephemeral_format (None in the upstream, ext4 in the charm[2]). If default_ephemeral_format doesn't have a value, then the code looks for os_type and set the default fs as windows=ntfs, linux=ext4, and if there is no os_type specified, it falls back to vfat.

default_ephemeral_format=ext4 in the charm default might be too opinionated since the following fallback logic per OS in the upstream is always skipped.

_DEFAULT_FS_BY_OSTYPE = {'linux': FS_FORMAT_EXT4,
                         'windows': FS_FORMAT_NTFS}

[1] https://github.com/openstack/nova/blob/stable/ussuri/nova/privsep/fs.py#L290-L305
[2] https://bugs.launchpad.net/charm-nova-compute/+bug/1693943

Revision history for this message
Felipe Reyes (freyes) wrote :
Changed in charm-nova-compute:
assignee: nobody → Edward Hope-Morley (hopem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-compute (master)
Changed in charm-nova-compute:
status: New → In Progress
Revision history for this message
Edward Hope-Morley (hopem) wrote :

@freyes the code linked in comment #2 shows that virt_mkfs will trump default_ephemeral_format if there is an virt_mkfs entry for the fs type nova is handling. Since we are now adding a default=mkfs.ext4 this should stop nova from falling back to using vfat for windows volumes and still provide ext4 as a default for all other types as before.

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

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/832280
Committed: https://opendev.org/openstack/charm-nova-compute/commit/98191ea5bf442a712f3e575bf1a7d4bb59dd3614
Submitter: "Zuul (22348)"
Branch: master

commit 98191ea5bf442a712f3e575bf1a7d4bb59dd3614
Author: Edward Hope-Morley <email address hidden>
Date: Mon Mar 7 16:26:36 2022 +0000

    Make virt_mkfs configurable with ext4 default

    Closes-Bug: #1960231
    Change-Id: Ia2ac7318f1164a9015bdf9e7ce7d20a129e22af4

Changed in charm-nova-compute:
status: In Progress → Fix Committed
Revision history for this message
Jorge Merlino (jorge-merlino) wrote :

mke2fs authorization for apparmor was missing on the merged change. This is needed as all mkfs.* variants end up calling mke2fs. I'll propose a new patch fixing this.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-compute (master)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/874927
Committed: https://opendev.org/openstack/charm-nova-compute/commit/7e3ead3389b3824ba2a9fb5467cf03869cd59fb2
Submitter: "Zuul (22348)"
Branch: master

commit 7e3ead3389b3824ba2a9fb5467cf03869cd59fb2
Author: Jorge Merlino <email address hidden>
Date: Thu Feb 23 11:46:25 2023 -0300

    Adding mke2fs to apparmor

    This is needed as all mkfs.* variants end up calling mke2fs.
    Closes-bug: #2008391
    Related-Bug: #1960231

    Change-Id: I940bf0ca9cd330ae0b45b53d0d19844806a4bbbb

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-compute (stable/zed)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-compute (stable/zed)

Related fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/charm-nova-compute/+/875222

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-compute (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/875015
Committed: https://opendev.org/openstack/charm-nova-compute/commit/79209abf813d8fcec1beb3a2996681bba487e22e
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 79209abf813d8fcec1beb3a2996681bba487e22e
Author: Edward Hope-Morley <email address hidden>
Date: Mon Mar 7 16:26:36 2022 +0000

    Make virt_mkfs configurable with ext4 default

    Closes-Bug: #1960231
    Change-Id: Ia2ac7318f1164a9015bdf9e7ce7d20a129e22af4
    (cherry picked from commit 98191ea5bf442a712f3e575bf1a7d4bb59dd3614)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-compute (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/875222
Committed: https://opendev.org/openstack/charm-nova-compute/commit/09f0dd1df35686a019741e2c8c4c1f3621959aa6
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 09f0dd1df35686a019741e2c8c4c1f3621959aa6
Author: Jorge Merlino <email address hidden>
Date: Thu Feb 23 11:46:25 2023 -0300

    Adding mke2fs to apparmor

    This is needed as all mkfs.* variants end up calling mke2fs.
    Closes-bug: #2008391
    Related-Bug: #1960231

    Change-Id: I940bf0ca9cd330ae0b45b53d0d19844806a4bbbb
    (cherry picked from commit 7e3ead3389b3824ba2a9fb5467cf03869cd59fb2)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-compute (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/charm-nova-compute/+/876467

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-compute (stable/yoga)

Related fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/charm-nova-compute/+/876647

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-compute (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/876467
Committed: https://opendev.org/openstack/charm-nova-compute/commit/aec61f03b9a8def4b76782b95b46e2f41abfafed
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit aec61f03b9a8def4b76782b95b46e2f41abfafed
Author: Edward Hope-Morley <email address hidden>
Date: Mon Mar 7 16:26:36 2022 +0000

    Make virt_mkfs configurable with ext4 default

    Closes-Bug: #1960231
    Change-Id: Ia2ac7318f1164a9015bdf9e7ce7d20a129e22af4
    (cherry picked from commit 98191ea5bf442a712f3e575bf1a7d4bb59dd3614)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-compute (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/876647
Committed: https://opendev.org/openstack/charm-nova-compute/commit/4b0095194d4918f644d18470b0b817d5a805d7a3
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 4b0095194d4918f644d18470b0b817d5a805d7a3
Author: Jorge Merlino <email address hidden>
Date: Thu Feb 23 11:46:25 2023 -0300

    Adding mke2fs to apparmor

    This is needed as all mkfs.* variants end up calling mke2fs.
    Closes-bug: #2008391
    Related-Bug: #1960231

    Change-Id: I940bf0ca9cd330ae0b45b53d0d19844806a4bbbb
    (cherry picked from commit 7e3ead3389b3824ba2a9fb5467cf03869cd59fb2)

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.