Module for managing the LXD daemon and its containers.
New in version 2019.2.0.
LXD(1) is a container "hypervisor". This execution module provides several functions to help manage it and its containers.
Note
pylxd(2) version >=2.2.5 is required to let this work, currently only available via pip.
To install on Ubuntu:
$ apt-get install libssl-dev python-pip $ pip install -U pylxd
you need lxd installed on the minion for the init() and version() methods.
for the config_get() and config_get() methods you need to have lxd-client installed.
René Jochum <rene@jochums.at>
new
python-pylxd
Linux
Authenticate with a remote LXDaemon.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
The password of the remote.
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.authenticate https://srv01:8443 <yourpass> ~/.config/lxc/client.crt ~/.config/lxc/client.key false
See the requests-docs for the SSL stuff.
Get an LXD daemon config option
The key of the config value to retrieve
CLI Examples:
salt '*' lxd.config_get core.https_address
Set an LXD daemon config option
CLI Examples:
To listen on IPv4 and IPv6 port 8443, you can omit the :8443 its the default:
salt '*' lxd.config_set core.https_address [::]:8443
To set the server trust password:
salt '*' lxd.config_set core.trust_password blah
Delete a container config value
Name of the container
The config key to delete
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Get a container config value
Name of the container
The config key to retrieve
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Set a container config value
Name of the container
The config key to set
The config value to set
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Create a container
The name of the container
"xenial/amd64"
"alias": "xenial/amd64"}
"fingerprint": "SHA-256"}
"os": "ubuntu", "release": "14.04", "architecture": "x86_64"}}
{"type": "none"}
"source": "my-old-container"}
List of profiles to apply on this container
A config dict or None (None = unset).
{'key': 'security.privileged', 'value': '1'}]
A device dict or None (None = unset).
unknown
i686
x86_64
armv7l
aarch64
ppc
ppc64
ppc64le
s390x
Destroy this container after stop?
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Return the raw pyxld object or a dict?
CLI Examples:
salt '*' lxd.container_create test xenial/amd64
See also the rest-api-docs.
Delete a container
Name of the container to delete
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Add a container device
Name of the container
The device name to add
Type of the device
Additional device args
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Delete a container device
Name of the container
The device name to delete
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Get a container device
Name of the container
The device name to retrieve
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Execute a command list on a container.
Name of the container
Command to be executed (as a list)
'["ls", "-l"]'
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.container_execute <container name> '["ls", "-l"]'
Get a file from a container
Name of the container
The source file or directory
The destination file or directory
Set file mode to octal number
Set file uid (owner)
Set file gid (group)
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Put a file into a container
Name of the container
The source file or directory
The destination file or directory
Decent into src directory
Replace destination if it exists
Set file mode to octal number
Set file uid (owner)
Set file gid (group)
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.container_file_put <container name> /var/tmp/foo /var/tmp/
Freeze a container
Name of the container to freeze
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Gets a container from the LXD
The name of the container to get.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Return the pylxd object, this is internal and by states in use.
Lists containers
Only return a list of names when True
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
Full dict with all available information:
salt '*' lxd.container_list
For a list of names:
salt '*' lxd.container_list true
See also container-attributes.
Migrate a container.
If the container is running, it either must be shut down first (use stop_and_start=True) or criu must be installed on the source and destination machines.
For this operation both certs need to be authenticated,
use lxd.authenticate <salt.modules.lxd.authenticate
to authenticate your cert(s).
Name of the container to migrate
Stop the container on the source and start it on dest
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
# Authorize
salt '*' lxd.authenticate https://srv01:8443 <yourpass> ~/.config/lxc/client.crt ~/.config/lxc/client.key false
salt '*' lxd.authenticate https://srv02:8443 <yourpass> ~/.config/lxc/client.crt ~/.config/lxc/client.key false
# Migrate phpmyadmin from srv01 to srv02
salt '*' lxd.container_migrate phpmyadmin stop_and_start=true remote_addr=https://srv02:8443 cert=~/.config/lxc/client.crt key=~/.config/lxc/client.key verify_cert=False src_remote_addr=https://srv01:8443
Rename a container
Name of the container to Rename
The new name of the container
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Restart a container
Name of the container to restart
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Start a container
Name of the container to start
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Get container state
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Stop a container
Name of the container to stop
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Unfreeze a container
Name of the container to unfreeze
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Create an alias on the given image
An image alias, a fingerprint or a image object
The alias to add
Description of the alias
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
salt '*' lxd.image_alias_add xenial/amd64 x "Short version of xenial/amd64"
Delete an alias (this is currently not restricted to the image)
An image alias, a fingerprint or a image object
The alias to delete
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
salt '*' lxd.image_alias_add xenial/amd64 x "Short version of xenial/amd64"
Copy an image from another LXD instance
An alias or a fingerprint of the source.
An URL to the source remote daemon
PEM Formatted SSL Certificate for the source
~/.config/lxc/client.crt
PEM Formatted SSL Key for the source
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Address of the destination daemon
PEM Formatted SSL Certificate for the destination
~/.config/lxc/client.crt
PEM Formatted SSL Key for the destination
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
List of aliases to append to the copied image
Make this image public available, None = copy source
Wherever to auto-update from the original source, None = copy source
Return the raw pylxd object or a dict of the destination image?
CLI Examples:
salt '*' lxd.image_copy_lxd xenial/amd64 https://srv01:8443 ~/.config/lxc/client.crt ~/.config/lxc/client.key false https://srv02:8443 ~/.config/lxc/client.crt ~/.config/lxc/client.key false aliases="['xenial/amd64']"
Delete an image by an alias or fingerprint
The alias or fingerprint of the image to delete, can be a obj for the states.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
salt '*' lxd.image_delete xenial/amd64
Create an image from a file
The filename of the rootfs
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
List of aliases to append to the copied image
Make this image public available
The saltenv to use for salt:// copies
Return the raw pylxd object or a dict of the image?
CLI Examples:
salt '*' lxd.image_from_file salt://lxd/files/busybox.tar.xz aliases=["busybox-amd64"]
Create an image from simplestreams
Simplestreams server URI
The alias of the image to retrieve
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
List of aliases to append to the copied image
Make this image public available
Should LXD auto update that image?
Return the raw pylxd object or a dict of the image?
CLI Examples:
salt '*' lxd.image_from_simplestreams "https://cloud-images.ubuntu.com/releases" "trusty/amd64" aliases='["t", "trusty/amd64"]' auto_update=True
Create an image from an url
The URL from where to download the image
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
List of aliases to append to the copied image
Make this image public available
Should LXD auto update that image?
Return the raw pylxd object or a dict of the image?
CLI Examples:
salt '*' lxd.image_from_url https://dl.stgraber.org/lxd aliases='["busybox-amd64"]'
Get an image by its fingerprint
The fingerprint of the image to retrieve
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Return the raw pylxd object or a dict of it?
CLI Examples:
salt '*' lxd.image_get <fingerprint>
Get an image by an alias
The alias of the image to retrieve
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Return the raw pylxd object or a dict of it?
CLI Examples:
salt '*' lxd.image_get_by_alias xenial/amd64
Lists all images from the LXD.
list_aliases :
Return a dict with the fingerprint as key and a list of aliases as value instead.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
salt '*' lxd.image_list true --out=json
salt '*' lxd.image_list --out=json
Calls lxd init --auto -- opts
Storage backend to use (zfs or dir, default: dir)
Password required to add new clients
Address to bind LXD to (default: none)
Port to bind LXD to (Default: 8443)
Setup device based storage using this DEVICE
Setup loop based storage with this SIZE in GB
Storage pool to use or create
CLI Examples:
To listen on all IPv4/IPv6 Addresses:
salt '*' lxd.init dir PaSsW0rD [::]
To not listen on Network:
salt '*' lxd.init
normalize config input so returns can be put into mongodb, which doesn't like .
This is not meant to be used on the commandline.
CLI Examples:
salt '*' lxd.normalize_input_values config={} devices={}
Delete a profile config item.
The name of the profile to delete the config item.
The config key for the value to retrieve.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_config_delete autostart boot.autostart.delay
Get a profile config item.
The name of the profile to get the config item from.
The key for the item to retrieve.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_config_get autostart boot.autostart
Set a profile config item.
The name of the profile to set the config item to.
The items key.
Its items value.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_config_set autostart boot.autostart 0
Creates a profile.
The name of the profile to get.
A config dict or None (None = unset).
{'key': 'security.privileged', 'value': '1'}]
A device dict or None (None = unset).
A description string or None (None = unset).
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
salt '*' lxd.profile_create autostart config="{boot.autostart: 1, boot.autostart.delay: 2, boot.autostart.priority: 1}"
salt '*' lxd.profile_create shared_mounts devices="{shared_mount: {type: 'disk', source: '/home/shared', path: '/home/shared'}}"
See the lxd-docs for the details about the config and devices dicts.
Deletes a profile.
The name of the profile to delete.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_delete shared_mounts
Delete a profile device.
The name of the profile to delete the device.
The name of the device to delete.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_device_delete autostart eth1
Get a profile device.
The name of the profile to get the device from.
The name of the device to retrieve.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_device_get default eth0
Set a profile device.
The name of the profile to set the device to.
The name of the device to set.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Example:
salt '*' lxd.profile_device_set autostart eth1 nic nictype=bridged parent=lxdbr0
Gets a profile from the LXD
The name of the profile to get.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
Return the pylxd object, this is internal and by states in use.
CLI Examples:
salt '*' lxd.profile_get autostart
Lists all profiles from the LXD.
list_names :
Return a list of names instead of full blown dicts.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
CLI Examples:
salt '*' lxd.profile_list true --out=json
salt '*' lxd.profile_list --out=json
Get an pyxld client, this is not meant to be run over the CLI.
An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address!
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normally uses self-signed certificates.
See the requests-docs for the SSL stuff.
translate its execpetion on failure
The object to save
This is an internal method, no CLI Example.
Returns the actual pylxd version.
CLI Example:
salt '*' lxd.pylxd_version
Get all snapshots for a container
The name of the container to get.
An URL to a remote server. The 'cert' and 'key' fields must also be provided if 'remote_addr' is defined.
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Verify the ssl certificate. Default: True
CLI Examples:
salt '*' lxd.snapshots_all test-container
Create a snapshot for a container
The name of the container to get.
The name of the snapshot.
An URL to a remote server. The 'cert' and 'key' fields must also be provided if 'remote_addr' is defined.
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Verify the ssl certificate. Default: True
CLI Examples:
salt '*' lxd.snapshots_create test-container test-snapshot
Delete a snapshot for a container
The name of the container to get.
The name of the snapshot.
An URL to a remote server. The 'cert' and 'key' fields must also be provided if 'remote_addr' is defined.
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Verify the ssl certificate. Default: True
CLI Examples:
salt '*' lxd.snapshots_delete test-container test-snapshot
Get information about snapshot for a container
The name of the container to get.
The name of the snapshot.
An URL to a remote server. The 'cert' and 'key' fields must also be provided if 'remote_addr' is defined.
https://myserver.lan:8443 /var/lib/mysocket.sock
PEM Formatted SSL Certificate.
~/.config/lxc/client.crt
PEM Formatted SSL Key.
~/.config/lxc/client.key
Verify the ssl certificate. Default: True
CLI Examples:
salt '*' lxd.snapshots_get test-container test-snapshot
Syncs the given config and devices with the object (a profile or a container) returns a changes dict with all changes made.
The object to sync with / or just test with.
The new config to check with the obj.
The new devices to check with the obj.
Wherever to not change anything and give "Would change" message.
Returns the actual lxd version.
CLI Example:
salt '*' lxd.version