curtin does not put mount_options passed by MAAS into /etc/fstab

Bug #1709284 reported by Nobuto Murata
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned
curtin
Fix Released
Wishlist
Unassigned

Bug Description

Looks like MAAS properly passes mount_options to curtin, but curtin does not write an equivalent mount_options in /etc/fstab.

[curtin-install-cfg.yaml]
====
  - device: sdk_format
    id: sdk_mount
    options: noatime,inode64
    path: /var/lib/ceph-bcache/test-sdk
    type: mount
====

[/etc/fstab]
====
UUID=05538ac3-177a-4ff0-9be4-0b62a8c593c8 /var/lib/ceph-bcache/test-sdk xfs defaults 0 0
====

"options: noatime,inode64" seems ignored and /etc/fstab just contains "defaults" as mount_options as a result.

Apologies for not attaching the whole content of curtin-install-cfg.yaml. I can try to reproduce it with a clean environment if required.

$ apt policy maas python3-curtin
maas:
  Installed: 2.2.2-6099-g8751f91-0ubuntu1~16.04.1
  Candidate: 2.2.2-6099-g8751f91-0ubuntu1~16.04.1
  Version table:
 *** 2.2.2-6099-g8751f91-0ubuntu1~16.04.1 500
        500 http://ppa.launchpad.net/maas/stable/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/maas/stable/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status
     2.2.0+bzr6054-0ubuntu2~16.04.1 500
        500 http://id.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
     2.0.0~beta3+bzr4941-0ubuntu1 500
        500 http://id.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu xenial/main i386 Packages
python3-curtin:
  Installed: 0.1.0~bzr505-0ubuntu1~16.04.1
  Candidate: 0.1.0~bzr505-0ubuntu1~16.04.1
  Version table:
 *** 0.1.0~bzr505-0ubuntu1~16.04.1 500
        500 http://id.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
        100 /var/lib/dpkg/status
     0.1.0~bzr482-0ubuntu1~16.04.1 500
        500 http://ppa.launchpad.net/maas/stable/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/maas/stable/ubuntu xenial/main i386 Packages
     0.1.0~bzr365-0ubuntu1 500
        500 http://id.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu xenial/main i386 Packages

Related branches

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

I may be missing something, but "defaults" is hardcoded at this moment?

[curtin/commands/block_meta.py]
    631 if filesystem.get('fstype') != "swap":
    632 # Figure out what point should be
    633 while len(path) > 0 and path[0] == "/":
    634 path = path[1:]
    635 mount_point = os.path.sep.join([state['target'], path])
    636 mount_point = os.path.normpath(mount_point)
    637
    638 # Create mount point if does not exist
    639 util.ensure_dir(mount_point)
    640
    641 # Mount volume
    642 util.subp(['mount', volume_path, mount_point])
    643
    644 path = "/%s" % path
    645
    646 options = ["defaults"]
    647 # If the volume_path's kname is backed by iSCSI or (in the case of
    648 # LVM/DM) if any of its slaves are backed by iSCSI, then we need to
    649 # append _netdev to the fstab line
    650 if iscsi.volpath_is_iscsi(volume_path):
    651 LOG.debug("Marking volume_path:%s as '_netdev'", volume_path)
    652 options.append("_netdev")

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

If that's the case, MAAS is revealing no-op API and configs. Adding a MAAS task just in case.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

I do not believe this is a MAAS issue. MAAS has placed mount_options in the storage YAML since it was implemented. It was tested when storage was initial added to MAAS.

This seems like a regression on curtin's part.

Changed in maas:
status: New → Invalid
Revision history for this message
Nobuto Murata (nobuto) wrote :

FWIW, my workaround is putting a few lines in late_commands section of curtin_userdata:

[/etc/maas/preseeds/curtin_userdata]

late_commands:
...

  # LP: #1709284
  20_lp1709284: curtin in-target -- sed -i -e 's/\(bcache.* xfs\) defaults/\1 noatime,inode64/' /etc/fstab

Revision history for this message
David Britton (dpb) wrote :

Curtin has never had a mount_options option, I will accept this bug as a feature request, but it's not a regression (I know that technicality is meaningless to the end user). Until this is supported in curtin, I consider it a MAAS bug of exposing options that curtin doesn't support. But, it's likely low-priority there as well.

Changed in curtin:
status: New → Confirmed
importance: Undecided → Wishlist
Changed in maas:
status: Invalid → Triaged
importance: Undecided → High
assignee: nobody → Blake Rouse (blake-rouse)
tags: added: ci
Ante Karamatić (ivoks)
tags: added: cpec
Ante Karamatić (ivoks)
tags: added: cpe-onsite
removed: cpec
tags: added: internal
Xav Paice (xavpaice)
tags: added: canonical-bootstack
Revision history for this message
Xav Paice (xavpaice) wrote :

Just a me too, using Xenial, and curtin 0.1.0~bzr505-0ubuntu1~16.04.1, maas 2.2.2-6099-g8751f91-0ubuntu1~16.04.1

Ryan Harper (raharper)
Changed in curtin:
status: Confirmed → Fix Committed
Changed in maas:
status: Triaged → Invalid
assignee: Blake Rouse (blake-rouse) → nobody
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Curtin 17.1

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
Revision history for this message
Victor Tapia (vtapia) wrote :

As mentioned in comment #6, this fix will be needed in Xenial too (I just tried with MAAS 2.3.0-6434-gd354690-0ubuntu1~16.04.1 and curtin 0.1.0~bzr532-0ubuntu1~16.04.1)

Revision history for this message
Scott Moser (smoser) wrote :

A fix for this bug is being SRU to Ubuntu 16.04 and 17.10 under bug 1743618.

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.