With macvlan, your container/VM asks directly your provider (i.e. Hetzner) for a network configuration through DHCP. You will need to look into Hetzner’s requirements to assigning additional IP addresses to a cloud server. I have seen several posts about Hetzner here, therefore you can have a look at the older posts. For example, you may have to register the MAC address of the LXD VM somewhere at the management screen at Hetzner. Or, you may have to setup the IP addresses manually.
Not sure if you misunderstood me, i do have a working network. LXD just doesnt list the IP for the vm.
One year ago when i found LXD i run a container on a additional hetzner IP with macvlan and i can still see the public IP being listed in lxc list output.
The only difference iirc, was that back then i set the hwadrr via lxc config set for the container and today via this macvlan profile.
config: {}
description: macvlan for ISPconfig
devices:
eth0:
hwaddr: 00:44:22:33:1F:4F
name: eth0
nictype: macvlan
parent: enp2s0
type: nic
root:
path: /
pool: default
type: disk
name: mail
used_by:
So, since i can see the second public macvlan IP on my previous bare metal bionic container setup and i cannot see it now on a new bionic bare metal setup with the only difference being that it is a vm i thought i post this.
$ locate lxd-agent
/snap/lxd/14442/bin/lxd-agent
/snap/lxd/14503/bin/lxd-agent
$ systemctl |grep lxd
run-snapd-ns-lxd.mnt.mount loaded active mounted /run/snapd/ns/lxd.mnt
snap-lxd-14442.mount loaded active mounted Mount unit for lxd, revision 14442
snap-lxd-14503.mount loaded active mounted Mount unit for lxd, revision 14503
snap.lxd.daemon.unix.socket loaded active listening Socket unix for snap application lxd.daemon
$ which lxd
/snap/bin/lxd
$ lxd --version
4.0.0
In a LXD VM, the LXD agent is installed in each VM and is setup to run through systemd.
Currently, this is not performed automatically for you, and it is something that the container image will be doing in the near future.
For now, you need to get a shell into the LXD VM, and run:
ubuntu@vm1:~$ sudo -i
root@vm1:~# mount -t 9p config /mnt/
root@vm1:~# cd /mnt/
root@vm1:/mnt# ls -l
total 6390
-r-------- 1 999 root 745 Jan 24 09:18 agent.crt
-r-------- 1 999 root 288 Jan 24 09:18 agent.key
dr-x------ 2 999 root 5 Jan 24 09:18 cloud-init
-rwx------ 1 999 root 595 Jan 24 09:18 install.sh
-r-x------ 1 999 root 11495360 Jan 24 09:18 lxd-agent
-r-------- 1 999 root 713 Jan 24 09:18 server.crt
dr-x------ 2 999 root 4 Jan 24 09:18 systemd
root@vm1:/mnt# ./install.sh
Created symlink /etc/systemd/system/multi-user.target.wants/lxd-agent.service → /lib/systemd/system/lxd-agent.service.
Created symlink /etc/systemd/system/multi-user.target.wants/lxd-agent-9p.service → /lib/systemd/system/lxd-agent-9p.service.
LXD agent has been installed, reboot to confirm setup.
To start it now, unmount this filesystem and run: systemctl start lxd-agent-9p lxd-agent
root@vm1:/mnt# reboot