Feature #4988
Add option to specify NIC MODEL when (hot-)adding a NIC through CLI / API
Status: | Pending | Start date: | 01/20/2017 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - | |||
Resolution: | Pull request: |
Description
onevm
...
nic-attach <vmid>
Attaches a NIC to a running VM. When using --file add only one
NIC instance.
States: RUNNING, POWEROFF
valid options: file, network, ip
There's currently no possibility to specify the NIC MODEL when adding a NIC through CLI / API. You can however specify this with Sunstone. Although you can configure a default NIC in vmm_exec_kvm.conf: NIC = [ model="virtio" ] (KVM) this setting is not used during (hot-) added NICs. Because the default MODEL on the hypervisor will be used (most often realtek) it's currently not possible to hot-add specific NIC. A partial workaround we have in place to set a default NIC MODEL is a small change in the driver (../one/remotes/vmm/kvm/attach_nic):
if [ "$THE_MODEL" = "-" ]; then
MODEL="<model type='virtio'/>" <- these lines were added
else <-|
MODEL="<model type='$THE_MODEL'/>"
fi