Comment 13 for bug 1965587

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Workaround: Create 'mkfs.xfs' wrapper to append '-m reflink=0' on centos70.
---

Add this line to the 'early_commands' section (create it, if needed)
in the file 'curtin_userdata_centos_amd64_generic_centos70',
on top of the original 'curtin_userdata[_centos]' file
(the location/file depends on MAAS install method: SNAP/DEB)

  00-xfs-reflink0: [ '/bin/sh', '-c', 'F=/usr/local/sbin/mkfs.xfs; /usr/bin/echo -e "#!/bin/sh
exec /usr/sbin/mkfs.xfs -m reflink=0 \"\$@\"">$F && chmod +x $F' ]

- SNAP:
copy /var/snap/maas/current/preseeds/curtin_userdata
to curtin_userdata_centos_amd64_generic_centos70
(early_commands section already exists)

 $ diff -u /var/snap/maas/current/preseeds/curtin_userdata /var/snap/maas/current/preseeds/curtin_userdata_centos_amd64_generic_centos70
 --- /var/snap/maas/current/preseeds/curtin_userdata 2021-02-09 11:57:40.868124866 +0000
 +++ /var/snap/maas/current/preseeds/curtin_userdata_centos_amd64_generic_centos70 2022-04-26 15:43:38.703471848 +0000
 @@ -23,6 +23,7 @@
  {{else}}
    driver_00: ["sh", "-c", "echo third party drivers not installed or necessary."]
  {{endif}}
 + 00-xfs-reflink0: [ '/bin/sh', '-c', 'F=/usr/local/sbin/mkfs.xfs; /usr/bin/echo -e "#!/bin/sh
exec /usr/sbin/mkfs.xfs -m reflink=0 \"\$@\"">$F && chmod +x $F' ]
  late_commands:
    maas: [wget, '--no-proxy', {{node_disable_pxe_url|escape.json}}, '--post-data', {{node_disable_pxe_data|escape.json}}, '-O', '/dev/null']
  {{if third_party_drivers and driver}}

- DEB:
copy /etc/maas/preseeds/curtin_userdata_centos
to curtin_userdata_centos_amd64_generic_centos70
(early_commands section has to be created)

 $ diff -u /etc/maas/preseeds/curtin_userdata_centos /etc/maas/preseeds/curtin_userdata_centos_amd64_generic_centos70
 --- /etc/maas/preseeds/curtin_userdata_centos 2022-04-26 15:13:49.147844143 +0000
 +++ /etc/maas/preseeds/curtin_userdata_centos_amd64_generic_centos70 2022-04-26 15:09:14.260539677 +0000
 @@ -7,3 +7,6 @@

  late_commands:
    maas: [wget, '--no-proxy', '{{node_disable_pxe_url}}', '--post-data', '{{node_disable_pxe_data}}', '-O', '/dev/null']
 +
 +early_commands:
 + 00-xfs-reflink0: [ '/bin/sh', '-c', 'F=/usr/local/sbin/mkfs.xfs; /usr/bin/echo -e "#!/bin/sh
exec /usr/sbin/mkfs.xfs -m reflink=0 \"\$@\"">$F && chmod +x $F' ]

...

With this workaround applied, MAAS 2.9.2 can deploy and boot CentOS 7
on a plain XFS partition or XFS on top of MD RAID0:

MAAS version: 2.9.2 (9165-g.c3e7848d1)

 [centos@z-rotomvm22 ~]$ uname -rv
 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021

 [centos@z-rotomvm22 ~]$ mount | grep -w xfs
 /dev/vda3 on /xfs type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

 [centos@z-rotomvm22 ~]$ dmesg | grep -iw xfs
 [ 3.177375] SGI XFS with ACLs, security attributes, no debug enabled
 [ 3.201503] XFS (vda3): Mounting V5 Filesystem
 [ 3.213364] XFS (vda3): Ending clean mount

and,

 [centos@z-rotomvm22 ~]$ uname -rv
 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021

 [centos@z-rotomvm22 ~]$ mount | grep -w xfs
 /dev/md0 on /xfs-raid0 type xfs (rw,relatime,seclabel,attr2,inode64,sunit=1024,swidth=3072,noquota)

 [centos@z-rotomvm22 ~]$ dmesg | grep -iw xfs
 [ 3.573489] SGI XFS with ACLs, security attributes, no debug enabled
 [ 3.599751] XFS (md0): Mounting V5 Filesystem
 [ 3.625700] XFS (md0): Ending clean mount

 [centos@z-rotomvm22 ~]$ cat /proc/mdstat
 Personalities : [raid0]
 md0 : active raid0 vda4[1] vda3[0] vda5[2]
       2918400 blocks super 1.2 512k chunks

 unused devices: <none>