Skip to main content

Posts

Moving to Wordpress

Blogger has the distinct 'abandonware' feel to it (and the editor is really frustrating for code snippets), so I'm migrating to Wordpress. You can find past and future posts at djanotes.wordpress.com . I hope you'll join me there.
Recent posts

Running an Ubuntu ppc64le virtual machine on x86

For an issue I'm debugging, I need a 64-bit little-endian powerpc machine. I don't have a physical one handy, so I wanted to run a virtual one on an x86 system. We can use qemu and libvirt for this. Unfortunately, it will be very slow - we have to use qemu's TCG mode rather than hardware assisted virtualisation because the guest (POWER) and host (amd64) are different. Fortunately, libvirt can work with these VMs like normal, which I find very helpful as it allows me to use tools like virsh and virt-manager, rather than dealing with qemu's inscrutable command line arguments. So I grabbed an Ubuntu ppc64el install ISO ( Xenial , Bionic ) and set to work. Here's the virt-install incantation derived from much accumulated wisdom amongst my former colleagues at OzLabs : virt-install --arch=ppc64le --name= GUESTVMNAME \ --os-variant=linux --boot menu=on \ --disk path= GUESTDISK .qcow2,size=20,format=qcow2,bus=virtio,cache=none,sparse=true \ --memory=4096  --

Netplan FAQs

Looking at search traffic, it seems the following netplan issues get people frequently. No tabs in YAML Problem: netplan prints an error message like this: Invalid YAML at //etc/netplan/10-bad.yaml line 6 column 0: found character that cannot start any token Solution: You have a tab in your YAML file. Remove the tab and try again. There will eventually be better error messages for this - PR#12 or PR#18 , but they haven't landed as of June 2018. mapping values are not allowed in this context Problem: netplan prints an error message like this: Invalid YAML at //etc/netplan/10-bad.yaml line 3 column 12: mapping values are not allowed in this context Cause: Netplan parses YAML with libyaml, which has some rather obtuse error messages. As far as I can tell, this is caused when you have a YAML file where: you have begun a mapping. As of Bionic, netplan recognises networks, match, nameservers, routes, routing-policy, access-points, parameters

Random notes on Kubernetes

In what continues to be very off-brand content for me (I'm really a kernel developer, I promise!), here are some random notes on some k8s stuff that will hopefully help someone. I'll keep this post as a running log of interesting stuff as I study for the CKA exam. Deploying k8s with the Canonical Distribution of Kubernetes (CDK) Does your deployment hang forever with kubernetes-master "Waiting for kube-system pods to start"? I was using a local deployment with LXD, and I needed to do the following 3 things: Disable swap on the host. In my case, I used juju ssh to connect to a kubernetes-master unit, then kubectl get nodes|less -S . This informed me that the nodes weren't starting the container runtime. Using juju ssh to connect to a node and running sudo kubectl , I found out that the container runtime was refusing to start because the host had swap memory enabled! After disabling that with sudo swapoff -a on the host, I was able to make progress an

netplan commands: the missing manuals

What do netplan apply, netplan generate, and netplan try do? The netplan man page just talks about the YAML configuration file format and don't describe the commands. So consider this a set of draft manpages - my hope is that it will fill in the gaps. I will try to get them merged to the main repository. Background To understand the netplan commands, it's helpful to know the very basics of the netplan design. Using netplan is a 2 step process: Netplan takes YAML files - usually from /etc/netplan/*.yaml - and converts them into configuration that is read by a backend .  This backend interacts with the kernel to actually configure the devices. Netplan currently supports systemd-networkd and NetworkManager as backends. So it will convert your configuration into the configuration that they read, and then they will actually apply it to the machine. Netplan doesn't do any configuration itself. With this in mind, we can understand the components netplan generate N

Netplan by example

netplan  is the default network configuration system for new installs of Ubuntu 18.04 (Bionic). It uses YAML to configure network interfaces, instead of  /etc/network/interfaces . I've been testing netplan for a while, so in light of the release of Bionic, here's my set of examples, caveats, tips and tricks. Contents General tips and tricks Matching Basic IPv4 configuration MTUs Bridges, Bonds and VLANs Wifi IPv6 Supplementing or replacing netplan Going Further General tips and tricks Tabs are not allowed in YAML and currently you get a very useless error message if you use them: "Invalid YAML at //etc/netplan/10-bridge.yaml line 5 column 0: found character that cannot start any token". If you see this, check for tabs! Indentation matters in YAML. Make sure that things line up where they're supposed to. Rebooting is somewhat more reliable than netplan apply , but make sure  there are no errors in your YAML before you reboot or no network

Anonymous bridges in netplan

netplan is the default network configuration system for new installs of Ubuntu 18.04 (Bionic). Introduced as the default in Artful, it replaces /etc/network/interfaces . One question that gets asked repeatedly is: "How do I set up an anonymous bridge in netplan?" (An anonymous bridge, I discovered, is one where the bridge doesn't have an IP address; it's more akin to a switch or hub.) It's been approached on  Launchpad , and comes up on the IRC channel. If you're trying to create a bridge without an IP address, the obvious first thing to try is this: network: version: 2 ethernets: ens8: match: macaddress: 52:54:00:f9:e9:dd ens9: match: macaddress: 52:54:00:56:0d:ce bridges: br0: interfaces: [ens8, ens9] This is neat, plausible, and wrong - the bridge will be created but will stay 'down'. Per ip a : 5: br0: <BROADCAST,MULTICAST> mtu 15