Open MathieuRA opened 1 week ago
I think modifying the existing api is risky, and would keep the behaviour with the rest api : creating a VM will purge vifs of an existing template I also think vifs can be added by a subsequent call , or may be recreated if they are givin in the rest api call parameter
@pdonias what is your opinion ?
@fbeauchamp What do you mean by "it would keep the behaviour with the rest api : creating a VM will purge vifs of an existing template"? From my understanding, with the new behavior, calling the API method without passing vifs
would keep all the template's VIFs, right?
Description
Previously, we destroyed all VIFs then
xo-web
sent the VIFs created by the user + the template's VIFs and xo-server creates all the VIFs sent by the user. This behavior was a bit weird, but since we mainly use xo-server with xo-web, it wasn't a problem. This behavior meant that creating a VM from the REST API did not create the VIFs of the VM template.This PR changes the handling of VIFs when creating a VM. Instead of deleting all VIFs and only creating the VIFs sent by the client, the VIFs template are not removed. There is always the possibility of removing a VIF from the template by passing the
destroy
parameter with the VIF's device.{device: <vif-device>, destroy: true}
To edit a VIF of the template, simply pass the device the information:{device: <vif-device>, ...all other vif fields
Example
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md
Review process
Notes: