LXC and LXD Cheat Sheet

February 1, 2020    oracle development

LXD Commands

Profile

List profiles

Add a network profile

root@trs2:/snap# lxc network attach-profile lxdbr0 storage-nas
root@trs2:/snap# lxc profile show storage-nas
config: {}
description: ""
devices:
  lxdbr0:
    nictype: bridged
    parent: lxdbr0
    type: nic
  root:
    path: /
    pool: codesnap
    type: disk
name: storage-nas
used_by:
- /1.0/instances/tough-dinosaur

Ensure you have a good profile for disk/io

I have created a special profile that uses a codesnap disk array. This is backed by 32x12g SAS drives. We will still have to bind mount the NVMe for later…

 1root@trs2:/home/avinash# !1994
 2lxc profile list
 3+-------------+---------+
 4|    NAME     | USED BY |
 5+-------------+---------+
 6| default     | 0       |
 7+-------------+---------+
 8| storage-nas | 0       |
 9+-------------+---------+
10
11root@trs2:/home/avinash# !1996
12lxc profile show storage-nas
13config: {}
14description: ""
15devices:
16  root:
17    path: /
18    pool: codesnap
19    type: disk
20name: storage-nas
21used_by: []
22
23
24root@trs2:/home/avinash# lxc storage ls
25+----------+-------------+--------+------------------------------------------------+---------+
26|   NAME   | DESCRIPTION | DRIVER |                     SOURCE                     | USED BY |
27+----------+-------------+--------+------------------------------------------------+---------+
28| codesnap |             | dir    | /mnt/cluster/codesnap/lxd                      | 1       |
29+----------+-------------+--------+------------------------------------------------+---------+
30| default  |             | dir    | /var/snap/lxd/common/lxd/storage-pools/default | 1       |
31+----------+-------------+--------+------------------------------------------------+---------+
32


comments powered by Disqus