[lxc-users] Args for lxd init via script

Fajar A. Nugraha list at fajar.net
Fri May 19 07:06:53 UTC 2017

On Fri, May 19, 2017 at 1:39 PM, Mark Constable <markc at renta.net> wrote:

> I'm trying to automate a simple setup of LXD via a bash script and I'm
> not sure of the best way to provide some preset arguments to "lxd init",
> if at all possible. Specifically...
> Name of the storage backend to use (dir or zfs): zfs
> Create a new ZFS pool (yes/no)? yes
> Name of the new ZFS pool: lxd-pool
> Would you like to use an existing block device (yes/no)? no
> Size in GB of the new loop device (1GB minimum): 5
> Would you like LXD to be available over the network (yes/no)? yes
> Do you want to configure the LXD bridge (yes/no)? no
> I'm hoping someone here has already been down this path, any suggestions?

Did you try "lxd --help"?

Init options:
        Automatic (non-interactive) mode

Init options for non-interactive mode (--auto):
    --network-address ADDRESS
        Address to bind LXD to (default: none)
    --network-port PORT
        Port to bind LXD to (default: 8443)
    --storage-backend NAME
        Storage backend to use (btrfs, dir, lvm or zfs, default: dir)
    --storage-create-device DEVICE
        Setup device based storage using DEVICE
    --storage-create-loop SIZE
        Setup loop based storage with SIZE in GB
    --storage-pool NAME
        Storage pool to use or create
    --trust-password PASSWORD
        Password required to add new clients

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170519/4477dff0/attachment-0001.html>

More information about the lxc-users mailing list