2 Questions for virtual-machine on lxd


I have 2 questions.

  1. Is it possible to connect lxd’s vm to ovn (open vitrual network)?
    I was tested that the network configuration through ovs bridge of lxd vm is well. But I don’t know what to do with ovn and network.

  2. When I created the lxd vm (virtual machine), I confirmed that the file system is configured in a slice manner.
    In the case of vm, is it not possible to change the size of the root partition (default size: 3.8G)?


  1. I’ve not played much with OVN yet (we have integration work planned for it in the next 6 months or so though), but so long as it can provide you with something that looks like a Linux or OVS bridge, you can tell LXD to put instances on that.
  1. You can modify the size post-creation but that will only grow the disk, you’ll need to manually handle the resize of your partition from within the VM. growpart from cloud-guest-utils (on Ubuntu at least) may be useful for that.

Dear Stgraber.

First, Thank you for your answer.

  1. I connect vm to a logical switch with the following script. (libvirt with ovn)
    +++++++++++++++++++ vmjoinls +++++++++++++++++++++
    #! /usr/bin/bash

usage: vmjoinls <vnet_name> <vm_name> <logical_switch_name>

UUID=$(ovs-vsctl get interface $1 external_ids:iface-id | sed s/"//g)
MAC=$(virsh domiflist $2 | grep -i vnet | awk ‘{print $5}’)
ovn-nbctl lsp-add $3 $UUID
ovn-nbctl lsp-set-addresses $UUID $MAC

I tried to connect lxd in the same way as I did above when connecting libvirt to ovn logical switch.

However, in the case of lxd vm, there is no external_ids: iface-id, so even when connecting, the ovn-sbctl show does not show that the vm and logical switch are bound.

  1. I also use growpart to expand the root device of vm (on kvm).
    However, for lxd vm (centos), it cannot be extended with growpart because it uses EFI.

Thank you.