lxd_container: More than one root device found

Hi All,

I have a very weird problem with the lxd_container module. When I create a container, I get this message:

fatal: [localhost]: FAILED! => {“actions”: , “changed”: false, “failed”: true, “msg”: “More than one root device found.”}

This used to work, but no longer. Not sure why. Have tried both ansible 2.3 and 2.3.1.0 (v2.3.1.0-0.2.rc2). Can’t find anything on the internet.

My script:


  • hosts: 127.0.0.1

connection: local

gather_facts: false

tasks:

  • name: create a container

connection: local

become: false

lxd_container:

name: test

state: started

source:

type: image

mode: pull

server: https://images.linuxcontainers.org

protocol: lxd

alias: “ubuntu/xenial/amd64”

devices: { “rootfs”: { “type”: “disk”, “path”: “/” } }

profiles: [“default”]

wait_for_ipv4_addresses: false

timeout: 600

I’m on Ubuntu 17.04. Does anyone have a clue how to figure out what’s going on? I can create lxd containers on the command-line just fine:

lxc launch ubuntu:16.04 test

works perfectly (but is not recognised by the script, it will try to create a new container).

Any pointers much appreciated!

Berend.

Replying to myself: removing the devices attribute (or removing the “rootfs” property) fixes the problem.