krs
(Kevin Smallman)
August 5, 2021, 3:05pm
1
Hi there,
I’ve been trying to create empty VM’s for booting with an iso on my distro but there’s something wrong with the way storage is being created that’s different for VMs (it works for regular containers).
Say I do:
# lxc init slackware --empty --vm
I get this message:
Creating slackware
Error: Failed creating instance: Failed to activate LVM logical volume "/dev/default/virtual-machines_slackware": Failed to run: lvchange --activate y --ignoreactivationskip /dev/default/virtual-machines_slackware: device-mapper: reload ioctl on (254:9) failed: Invalid argument
Logical volumes:
funtoo ~ # lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LXDThinPool default twi-aotz-- <12.90g 65.30 1.97
containers_endless--mosquito default Vwi---tz-k <9.32g LXDThinPool
containers_precious--ghoul default Vwi---tz-k <9.32g LXDThinPool
images_00c85e7b30d70a3436005ae3302254d27167c3260accf2e2b12c660c8648c342 default Vwi---tz-k <9.32g LXDThinPool
images_cea91a28441af36f088f3ae8b637499061518ea2d83c7560a2f7f33d74298968 default Vwi---tz-k <9.32g LXDThinPool
images_d342e2d3510458e8157baefe736ccd8a226f3b806b1ebff8288bd0b785a926d9 default Vwi---tz-k <9.32g LXDThinPool
home funtoo -wi-ao---- 64.00g
root funtoo -wi-ao---- 48.00g
swap funtoo -wi-ao---- 4.00g
virt funtoo -wi-ao---- 10.00g
tomp
(Thomas Parrott)
August 5, 2021, 3:24pm
2
Can you launch a VM from an image, such as images:ubuntu/focal
?
krs
(Kevin Smallman)
August 5, 2021, 3:27pm
3
# lxc launch images:ubuntu/focal --vm
Creating the instance
Error: Failed instance creation: Failed creating instance from image: Failed to activate LVM logical volume "/dev/default/images_40620641f2ed8d8afcbe414e2f72c1efe7b46957ee28cd18a123a0346165c617": Failed to run: lvchange --activate y --ignoreactivationskip /dev/default/images_40620641f2ed8d8afcbe414e2f72c1efe7b46957ee28cd18a123a0346165c617: device-mapper: reload ioctl on (254:9) failed: Invalid argument
tomp
(Thomas Parrott)
August 5, 2021, 3:28pm
4
OK so its just a general issue with LVM VMs.
Are you running with the snap package?
krs
(Kevin Smallman)
August 5, 2021, 3:44pm
5
No, my distro doesn’t use snaps. I tried building LXD with apparmor support earlier. I wish I hadn’t done that because I was told it’s not to do with that.
Now I’ve removed it but I can’t start my containers because of network problems!
funtoo ~ # lxc start endless-mosquito
Error: Failed preparing container for start: Failed to start device "eth0": Parent device "lxdbr0" doesn't exist
Try `lxc info --show-log endless-mosquito` for more info
funtoo ~ # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.36 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::e584:c563:5215:618f prefixlen 64 scopeid 0x20<link>
ether 28:d2:44:25:f0:68 txqueuelen 1000 (Ethernet)
RX packets 7385 bytes 6679444 (6.3 MiB)
RX errors 0 dropped 1057 overruns 0 frame 0
TX packets 3963 bytes 913492 (892.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf2500000-f2520000
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
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:6c:be:7e txqueuelen 1000 (Ethernet)
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
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::f5d6:d4ce:3511:b4ef prefixlen 64 scopeid 0x20<link>
ether a4:4e:31:63:b3:c8 txqueuelen 1000 (Ethernet)
RX packets 756 bytes 77812 (75.9 KiB)
RX errors 0 dropped 310 overruns 0 frame 0
TX packets 55 bytes 8202 (8.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
funtoo ~ # lxc network list
+--------+----------+---------+----------------+------+-------------+---------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY |
+--------+----------+---------+----------------+------+-------------+---------+
| eth0 | physical | NO | | | | 0 |
+--------+----------+---------+----------------+------+-------------+---------+
| lxdbr0 | bridge | YES | 10.162.45.1/24 | none | | 3 |
+--------+----------+---------+----------------+------+-------------+---------+
| virbr0 | bridge | NO | | | | 0 |
+--------+----------+---------+----------------+------+-------------+---------+
| wlan0 | physical | NO | | | | 0 |
+--------+----------+---------+----------------+------+-------------+---------+
funtoo ~ # lxc network detach-profile lxdbr0 default
Error: More than one device matches, specify the device name
funtoo ~ # lxc network detach-profile lxdbr0 endless-mosquito
Error: Fetch profile: No such object
tomp
(Thomas Parrott)
August 5, 2021, 3:50pm
6
Try restarting LXD as it will recreate any missing bridges. It looks like something/someone has removed the bridge interface.
tomp
(Thomas Parrott)
August 5, 2021, 3:52pm
7
Regarding the LVM issue, please can you rule out corruption on your existing LVM pool by creating a fresh temporary one using a loop file with:
lxc storage create lvmtemp lvm
lxc init slackware --empty --vm -s lvmtemp
See if that works.
krs
(Kevin Smallman)
August 5, 2021, 3:55pm
8
funtoo ~ # rc-service lxd restart
* Stopping lxd service (but not containers) ... [ ok ]
* Starting lxd service ... [ ok ]
funtoo ~ # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.36 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::e584:c563:5215:618f prefixlen 64 scopeid 0x20<link>
ether 28:d2:44:25:f0:68 txqueuelen 1000 (Ethernet)
RX packets 10909 bytes 7536280 (7.1 MiB)
RX errors 0 dropped 2302 overruns 0 frame 0
TX packets 6132 bytes 1444864 (1.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf2500000-f2520000
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
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:6c:be:7e txqueuelen 1000 (Ethernet)
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
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::f5d6:d4ce:3511:b4ef prefixlen 64 scopeid 0x20<link>
ether a4:4e:31:63:b3:c8 txqueuelen 1000 (Ethernet)
RX packets 2242 bytes 216846 (211.7 KiB)
RX errors 0 dropped 550 overruns 0 frame 0
TX packets 118 bytes 18872 (18.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
krs
(Kevin Smallman)
August 5, 2021, 3:55pm
9
funtoo ~ # lxc storage create lvmtemp lvm
Storage pool lvmtemp created
funtoo ~ # lxc init slackware --empty --vm -s lvmtemp
Creating slackware
Error: Failed creating instance: Failed to activate LVM logical volume "/dev/lvmtemp/virtual-machines_slackware": Failed to run: lvchange --activate y --ignoreactivationskip /dev/lvmtemp/virtual-machines_slackware: device-mapper: reload ioctl on (254:13) failed: Invalid argument
tomp
(Thomas Parrott)
August 5, 2021, 3:56pm
10
Check your logs for something preventing LXD from bringing up lxdbr0.
tomp
(Thomas Parrott)
August 5, 2021, 3:57pm
11
And it works if you do a container on LVM?
E.g.
lxc init images:ubuntu/focal c1 -s lvmtemp
krs
(Kevin Smallman)
August 5, 2021, 4:00pm
12
Yes! (weird right):
funtoo ~ # lxc init images:ubuntu/focal c1 -s lvmtemp
Creating c1
funtoo ~ #
tomp
(Thomas Parrott)
August 5, 2021, 4:03pm
13
What version of LXD is this and have you built it manually if not using a package?
tomp
(Thomas Parrott)
August 5, 2021, 4:05pm
14
And have you done a fresh reboot since this started to ensure LVM state is fresh?
krs
(Kevin Smallman)
August 5, 2021, 4:05pm
15
It’s 4.14.
[I] app-emulation/lxd
Available versions: 3.21^s **4.0.5^s **4.12^s 4.14^s {apparmor +dnsmasq (+)ipv6 nls KERNEL="linux"}
Installed versions: 4.14^s(04:17:12 PM 08/05/2021)(ipv6 nls -apparmor KERNEL="linux")
Homepage: https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd
Description: Fast, dense and secure container management
krs
(Kevin Smallman)
August 5, 2021, 4:08pm
16
I tried one before we started chatting, when I realized the network wasn’t working.
I had trouble getting it to start yesterday, as well, but I thought that had been fixed by starting the libvirtd service. Now I’m really confused.
That output above is from portage.
tomp
(Thomas Parrott)
August 5, 2021, 4:10pm
17
Is networking working now?
krs
(Kevin Smallman)
August 5, 2021, 4:12pm
18
No. I still can’t get that interface to come back. Even though LXD thinks it’s there.
tomp
(Thomas Parrott)
August 5, 2021, 4:14pm
19
LXD doesn’t think its there, its just that it has a DB record indicating that it used to be there as an managed network interface. If LXD cannot bring up the interface for some reason (or something else is subsequently removing it), then this will be the issue. Please check your LXD logs for the former and look at any other network management systems you have on your machine for the latter.
tomp
(Thomas Parrott)
August 5, 2021, 4:16pm
20
Can you show output of vgs
too, I wonder if you’re running out of space.
Otherwise I’m fresh out of ideas as never seen anything like that and have never used Funtoo, and it seems like there is some other strange stuff going on on your system causing the network issues too