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

Bug #1709284 reported by Nobuto Murata on 2017-08-08
This bug affects 5 people
Affects Status Importance Assigned to Milestone

Bug Description

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

  - device: sdk_format
    id: sdk_mount
    options: noatime,inode64
    path: /var/lib/ceph-bcache/test-sdk
    type: mount

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
  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 xenial/main amd64 Packages
        500 xenial/main i386 Packages
        100 /var/lib/dpkg/status
     2.2.0+bzr6054-0ubuntu2~16.04.1 500
        500 xenial-updates/main amd64 Packages
        500 xenial-updates/main i386 Packages
     2.0.0~beta3+bzr4941-0ubuntu1 500
        500 xenial/main amd64 Packages
        500 xenial/main i386 Packages
  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 xenial-updates/main amd64 Packages
        500 xenial-updates/main i386 Packages
        100 /var/lib/dpkg/status
     0.1.0~bzr482-0ubuntu1~16.04.1 500
        500 xenial/main amd64 Packages
        500 xenial/main i386 Packages
     0.1.0~bzr365-0ubuntu1 500
        500 xenial/main amd64 Packages
        500 xenial/main i386 Packages

Related branches

Nobuto Murata (nobuto) wrote :

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

    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)
    638 # Create mount point if does not exist
    639 util.ensure_dir(mount_point)
    641 # Mount volume
    642 util.subp(['mount', volume_path, mount_point])
    644 path = "/%s" % path
    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")

Nobuto Murata (nobuto) wrote :

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

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
Nobuto Murata (nobuto) wrote :

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



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

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) on 2017-09-07
tags: added: cpec
Ante Karamatić (ivoks) on 2017-09-27
tags: added: cpe-onsite
removed: cpec
tags: added: internal
Xav Paice (xavpaice) on 2017-11-03
tags: added: canonical-bootstack
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) on 2017-11-27
Changed in curtin:
status: Confirmed → Fix Committed
Changed in maas:
status: Triaged → Invalid
assignee: Blake Rouse (blake-rouse) → nobody

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
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)

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  Edit
Everyone can see this information.

Other bug subscribers