以下のURLを参考にMaaSのインストールとテストを試みました。

https://docs.maas.io/2.1/en/installconfig-lxd-install

上記ドキュメントのプロファイル編集部分より

  1. lxc profile edit maas

  2. configの後ろの{}を以下の内容(config:は除く)に置き換えます:

    1
    2
    3
    4
    5
    6
    
    config:
      raw.lxc: |-
        lxc.cgroup.devices.allow = c 10:237 rwm
        lxc.aa_profile = unconfined
        lxc.cgroup.devices.allow = b 7:* rwm    
      security.privileged: "true"
    
  3. launch手順で以下のエラーが発生しました:

    1
    2
    3
    
    $ lxc launch -p maas ubuntu:16.04 xenial-maas
    Creating xenial-maas
    Error: Failed container creation: Failed to load raw.lxc
    

これは自分がLXD 3.0を使っているためで、上記の設定キーが古いことが原因です。 このコメントによると、lxd 2.1以降はlxc.aa_profilelxc.apparmor.profileに変更されています。

したがって、回避策は以下の通りです。

  1. 再度 lxc profile edit maas

  2. lxc.aa_profilelxc.apparmor.profile に置き換えます。

    1
    2
    3
    4
    5
    6
    
    config:
      raw.lxc: |-
        lxc.cgroup.devices.allow = c 10:237 rwm
        lxc.apparmor.profile = unconfined
        lxc.cgroup.devices.allow = b 7:* rwm    
      security.privileged: "true"
    
  3. launchコマンドを再実行します。

    1
    2
    3
    
    $ lxc launch -p maas ubuntu:16.04 xenial-maas
    Creating xenial-maas
    Starting xenial-maas