Helo, The IP configuration looks normal, but the storage configuration does not seem to take effect,code show as below
config = {
'name': 'debian',
'type': 'container',
'source': {
'type': 'image',
"mode": "pull",
"protocol": "simplestreams",
"server": "https://images.linuxcontainers.org",
"alias": "debian/bullseye/amd64"
},
'config': {
'limits.cpu': '1',
'limits.memory': '2048MiB',
'security.devlxd': '0'
},
'devices': {
'eth0': {'type': "nic", 'network': "lxdbr0", 'name': "eth0", 'ipv4.address': "10.5.11.11"},
'root': {'type': "disk", 'pool': "default", 'size': "5GiB", 'path': "/"},
}
}
instance = client.instances.create(config, wait=True)
instance.start()
print(instance)
Network Configuration
root@lxc:~# lxc list
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
+--------+---------+-------------------+------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+--------+---------+-------------------+------+-----------+-----------+
| debian | RUNNING | 10.5.11.11 (eth0) | | CONTAINER | 0 |
+--------+---------+-------------------+------+-----------+-----------+
root@lxc:~# lxc exec debian -- ifconfig
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.5.11.11 netmask 255.255.255.0 broadcast 10.5.11.255
inet6 fe80::216:3eff:fe72:2dfc prefixlen 64 scopeid 0x20<link>
ether 00:16:3e:72:2d:fc txqueuelen 1000 (Ethernet)
RX packets 7 bytes 1465 (1.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1934 (1.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Hard disk configuration does not seem to take effect
root@lxc:~# lxc exec debian -- df -h
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Filesystem Size Used Avail Use% Mounted on
/dev/loop3 19G 356M 18G 2% /
none 492K 4.0K 488K 1% /dev
udev 1.9G 0 1.9G 0% /dev/tty
tmpfs 100K 0 100K 0% /dev/.lxd-mounts
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 772M 52K 772M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
root@lxc:~# lxc storage list
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
+---------+--------+--------------------------------------------+-------------+---------+
| NAME | DRIVER | SOURCE | DESCRIPTION | USED BY |
+---------+--------+--------------------------------------------+-------------+---------+
| default | btrfs | /var/snap/lxd/common/lxd/disks/default.img | | 3 |
+---------+--------+--------------------------------------------+-------------+---------+
root@lxc:~# lxc storage info default
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
info:
description: ""
driver: btrfs
name: default
space used: 373.25MB
total space: 20.00GB
used by:
images:
- f59dd56e72faa12284eed2fd381a87d9fc71392e221d679c1f6e0870d2bcbcd9
instances:
- debian
profiles:
- default
root@lxc:~# lxc storage show default
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
config:
size: 20GB
source: /var/snap/lxd/common/lxd/disks/default.img
description: ""
name: default
driver: btrfs
used_by:
- /1.0/images/f59dd56e72faa12284eed2fd381a87d9fc71392e221d679c1f6e0870d2bcbcd9
- /1.0/instances/debian
- /1.0/profiles/default
status: Created
locations:
- none