How to attach second interface to VM
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=
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=
What is the proper way to attach/detach a secondary NIC/interface to a VM in MaaS?
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.