API endpoint question

Please help me understand what is the difference between these 2:

POST​/1.0​/instances​/{name}​/backups

and
POST​/1.0​/instances​/{name}​/snapshots

Thank you.

If you read the docs it would be “obvious”.

/backups is an export of the instance file system in the .tar.gz format that can be imported by LXD API.

/snapshot can be copied to another host for a different type of backup, but its not the same as /backup

1 Like

Thank you @turtle0x1

I had never used “backups” from the CLI, so I thought it could be one of those duplicated endpoints, like ​/1.0​/containers/blah

I’m going through the entire API, see what I can learn…
I’m guessing Operations is what you use to keep track of the status of issued commands, is that right?
And warnings, I just have no idea what to make of it…

At the CLI level, backups is what’s used for lxc export and lxc import.
The API has more features than that though and allows keeping backups around, renaming them … As @turtle0x1 mentioned though, they are different from snapshots as backups are an exported tarball rather than a property of the filesystem like snapshots.

Operations is what’s used to track all asynchronous API calls, typically we use those for anything we expect could take more than a second or so to complete.

Warnings are a new feature, accessible in the CLI through lxc warning which is used to track configuration or system issues with a LXD server. Things like bad network configuration, missing kernel features, bad core pinning on a VM, …

Oh WOW, that’s a great feature indeed!!!

±-------------------------------------±------------------------------------------------±-------±---------±------±--------±------------------------------+
| UUID | TYPE | STATUS | SEVERITY | COUNT | PROJECT | LAST SEEN |
±-------------------------------------±------------------------------------------------±-------±---------±------±--------±------------------------------+
| 7ae06f33-d2e7-4b8a-98f5-42b38bf72fe5 | Couldn’t find the CGroup blkio.weight | NEW | LOW | 18 | | Aug 28, 2021 at 12:38am (UTC) |
±-------------------------------------±------------------------------------------------±-------±---------±------±--------±------------------------------+
| 260467c6-919b-4640-846e-1a5a13f788f8 | Couldn’t find the CGroup memory swap accounting | NEW | LOW | 18 | | Aug 28, 2021 at 12:38am (UTC) |
±-------------------------------------±------------------------------------------------±-------±---------±------±--------±------------------------------+

Tho I have no idea what they mean, rofl…

Is this related?

Yeah, these days most systems don’t ship with an I/O scheduler which allows for those kind of limits. This is especially true when using NVME SSDs where all the queuing has been pushed to the hardware, giving no real control to the kernel to throttle I/O.

The previous results where from an AWS Server.
The next results are from a bare-metal/dedicated server installation…

±-------------------------------------±------------------------------------------------±-------±---------±------±--------±-----------------------------+
| UUID | TYPE | STATUS | SEVERITY | COUNT | PROJECT | LAST SEEN |
±-------------------------------------±------------------------------------------------±-------±---------±------±--------±-----------------------------+
| 9cf0edef-b601-4b15-87d0-cfc9cc81d7b4 | Couldn’t find the CGroup blkio.weight | NEW | LOW | 18 | | Aug 27, 2021 at 5:08pm (UTC) |
±-------------------------------------±------------------------------------------------±-------±---------±------±--------±-----------------------------+
| dde6d564-f697-4edf-9e5c-c0d2173cf35e | Couldn’t find the CGroup memory swap accounting | NEW | LOW | 18 | | Aug 27, 2021 at 5:08pm (UTC) |
±-------------------------------------±------------------------------------------------±-------±---------±------±--------±-----------------------------+

First (EC2) server:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
Storage: Block storage over the network.

Last (bare-metal) server:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
Storage: Sata SSDs (not Nmve)

Understood, so not a LXD issue, but it is a requisite?
Do I need to fix it or should I just use lxc warning delete? wink

They’re both fine to ignore, they mostly let you know that some specific limits won’t work.

For the swap case, if you ever want limits.memory to properly handle swap space, then you can change your kernel command line to include swapaccount=1 which will then resolve it.

For the blkio case, there’s really nothing you can do short of changing distribution or kernel. It means that applying IOps or bandwidth limits on LXD disk devices won’t work, but that’s really it.