Error: The device already exists (when setting IOPS limits)

Based on:

I am trying to limit read/write IOPS for a container. I currently have this running:

   $ lxc list
    +-----------+---------+---------------------+----------------------------------------------+-----------+-----------+
    |   NAME    |  STATE  |        IPV4         |                     IPV6                     |   TYPE    | SNAPSHOTS |
    +-----------+---------+---------------------+----------------------------------------------+-----------+-----------+
    | lxdMosaic | RUNNING | 10.16.163.33 (eth0) | fd42:94d8:34c:38f8:216:3eff:fec2:891b (eth0) | CONTAINER | 0         |
    +-----------+---------+---------------------+----------------------------------------------+-----------+-----------+
    | ubuntuone | RUNNING | 10.16.163.2 (eth0)  | fd42:94d8:34c:38f8:216:3eff:fe7b:4ed5 (eth0) | CONTAINER | 0         |
    +-----------+---------+---------------------+----------------------------------------------+-----------+-----------+

Based on :

I run:

$ lxc config device override ubuntuone root size=10GB limits.read=100Iops limits.write=100Iops
Error: The device already exists

I have also tried:

$ lxc config device set ubuntuone root limits.write=100Iops
Error: Failed to update device "root": Invalid value: 100Iops
$ lxc config device override ubuntuone root limits.write=100Iops
Error: The device already exists
$ lxc config device show ubuntuone
root:
  limits.read: 30MB
  path: /
  pool: default
  type: disk

Any suggestions?

lxc config device set is right in this case though the suffix (per documentation) is iops, not Iops.

It works thanks! For some reason I ended up using this guide:

https://stgraber.org/2016/03/26/lxd-2-0-resource-control-412/

which say:

Or to restrict IOps instead:

  lxc config device set my-container root limits.read 20Iops
  lxc config device set my-container root limits.write 10Iops

I’ve now corrected that page, thanks!

1 Like