How to attach second interface to VM

Bug #2067022 reported by Arjun Baindur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned

Bug Description

I created a VM on a KVM host via following CLI:

maas admin vm-host compose 1389 cores=32 memory=65535 storage=default:512 architecture=amd64/generic interfaces='eth0:name=br_vlan_2,type=bridge' -k

Where br_vlan_2 is a bridge on the host. Now I want a dual-homed VM, so I have another bridge br_vlan_3. These map to VLAN interfaces on the KVM host

Supposed the ID of the VM is pk6md7, I tried the following, but it has no effect. MaaS UI does not report a new interface on the VM Machine, and I dont see the libvirt XML updated, no NIC hot plugged in the VM

maas admin machine update pk6md7 interfaces=ens5:name=br_vlan_3,type=bridge -k

What is the proper way to attach/detach a secondary NIC/interface to a VM in MaaS?

Revision history for this message
Jacopo Rota (r00ta) wrote :

afaik this is not supported. You can turn this into a feature request on Discourse.

ATM you can only specify multiple interfaces at compose time like

maas admin vm-host compose 1389 cores=32 memory=65535 storage=default:512 architecture=amd64/generic interfaces='eth0:name=br_vlan_2,type=bridge;eth1:name=br_vlan_3,type=bridge' -k

However, you can achieve your goal using LXD directly. Just login to the LXD server and do something like

lxc config device add THE_LXD_VM_NAME eth1 nic network=br_vlan_2 name=eth1 nictype=bridged ..

(see https://discuss.linuxcontainers.org/t/how-to-add-a-network-interface-in-lxc/437)

and then report back the interface to maas.

Changed in maas:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.