lxd is the perfect linux technology
I don't mean it's a perfect technology that's based on linux, I mean it's a technology that's the most linux of any technology I've used.
it's the most linux in all the world.
it's a technology where the answer to any "how do I" question you could conceivably ask is either "don't do that" or "go fuck yourself"
previous technologies have only managed linuxnesses of 75%-80%, maybe 90% on a good day.
but no, LXD is perfectly pure in how it is impossible to answer any question regarding how to do anything with it.
you ask a question about X, you either get nothing or "go write it yourself if you want that so much", so you give up and find out what other people are doing, and it's Y.
So you ask how to do Y, and the answer is "don't do Y. Do Z instead"
how do you do Z? well, that's simple.
Go fuck yourself.
You ask too many questions. What, do you want Windows or VMWare to win on the virtualization front? LXD is better than all of those.
Unless you want to use it. then it's terrible and you made a horrible mistake and that's impossible.
an example lxd problem.
You create a remote instance and attach it to a given network.
you connect to the instance using "exec bash" and check what IP it got: none! there's no DHCP! oh, ok, I'll just assign a static IP. oh, but that won't work.
because the assign-static-ip command doesn't work unless you specifically named the ethernet interface when attaching it to a network, and since it's a bridge network you got an autoassigned name like "eth0@if52". ok, whatever, recreate the container and name it "eth0" now
now you can tell it to apply the ip address 1.2.3.4 to eth0.
great.
so you log in now, and it tells you that your network interfaces are:
eth0@if52 and it has ip 9.8.7.6
which isn't what you told it to do or what interface you told it but apparently trying to apply a static IP it meant it automatically got a different IP? and naming the ethernet interface was required but did nothing?
and the best part about this is that every guide you can possibly look up about how to use this assumes you're running your LXD cluster, despite the fact THE ENTIRE POINT of LXD is that it can be used remotely and therefore the person who is administrating it MAY NOT BE YOU
btw, that automatically applied 9.8.7.6 IP address? it doesn't work. the gateway is wrong, the DNS server is nonexistent, so it's not like you accidentally picked up some DHCP that was supposed to work.
it's the perfect infinite time-sink technology:
You can't fix it, but you can make it Differently Broken.
I'm busy writing a lot of code to work around the assorted braindamagedness of everything involving LXD and constantly resisting the urge to name it all "ComputersAreTerrible .py"
please donate to my ko-fi so I can retire from knowing what computers are and move into a cabin in montana and just make pottery for the rest of my life
the most technologically advanced device I'll have is a kiln.
and it can only break by being not hot enough, and if you check stackoverflow on how to fix that, the solution is always "add more wood" or "make sure the wood is on fire"
the only other complicated mechanical thing I'll need is a gun, to scare off bears or shoot anyone who tries to bring electronics near my cabin
just when I thought lxd was terrible, weird, and terribly weird enough: I rebooted a VM while running a bash-exec command against it, and it gave me a websocket error message.

websockets?
I'M RUNNING A COMMAND LINE LINUX VM AND CONNECTING TO IT WITH A COMMAND LINE THAT'S RUNNING BASH

WHY IN THE GLORIOUS FUCK ARE WEBSOCKETS WITHIN 100 MILES (160 km) OF THIS SITUATION?
you said it, not me
I should get hazard pay for having to edit virtual machine YAML by hand.

it's 2020, why is anyone using YAML
apparently setting ipv4.address on a VM tells it that you want an IP address, but not what it is.

Foone: hey, lxd, I want a static address on this interface!
LXD: Can do!
Foone: Do you want to know which one I want?
LXD: absolutely not.
apparently this is happening because while there are answers to "how do I tell LXD how to set an static IP address" it assumes LXD is managing your network, and if it isn't, that won't work.
Because it's not really a static IP, I think. it's a static IP faked with fake DHCP
but when you try to use this feature with a network that doesn't support it, you don't get an error, it just somehow knocks the VM into getting an IP address from elsewhere, which probably won't be the one you told it to.
I bet what's happening is that it's trying to configure the network to use fake-DHCP (which doesn't work, because LXD isn't managing the network) and then it configures the VM to use a DHCP client
so the DHCP client on the VM is activating and then finding some other DHCP server it shouldn't be talking to in the first place
that's mostly a guess, though. I would sooner glimpse the thoughts of God than understand the inner workings of LXD
so while the guides all tell you to configure your LXD VMs with DHCP or setting an IP on the container, the stupid-complicated way that will work is to just set up the VM, then launch it and edit the /etc/network/interfaces file to specify a static IP in there like it's 1997
this would normally be a fun catch-22: how do you boot a computer and then remotely connect to it before the network is configured, but thankfully we have lxc exec, which is... websockets, apparently.
me: how do I X?
google: You need to pass foo=bar to the linux kernel at boot
me: OK, how do I pass kernel parameters with LXD?
google: that is not a question anyone has ever asked or should ever ask.
google: I'm going to pretend you asked something else. Here's how to change the battery on your honda!
me: I don't even own a honda!
google: you do now. It's been charged to your first credit card listed on Google Pay. It arrives Friday.
and now I can't set bash variables

computers were a mistake
me: FINALLY, all the lxd issues have been resolved, and the VM is running!

The VM:
git: fatal: write error: No space left on device28 GiB | 99.73 MiB/s
fatal: index-pack failed
good news everyone:
it turns out this was an LXD problem after all!

my root drive is 50 gigabytes but because of cloud-init-weirdness it didn't fix the partition size so I only had 4gb of it available
You can follow @Foone.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: