sonata-nfv / son-emu

Attention! Legacy! This repo will be replaced with https://github.com/containernet/vim-emu
https://github.com/containernet/vim-emu
Apache License 2.0
36 stars 32 forks source link

son-profile: update resource constraints from the REST API #188

Closed stevenvanrossem closed 7 years ago

stevenvanrossem commented 7 years ago

On the son-emu emulated infrastructure, it will be more efficient to dynamically change resources in a running service, iso deploying a new package. (On the real infrastructure in the SP, deploying a new package is probably the only possible way) This will make it easier to test resource allocation in son-emu, and automate it.

the easiest solution might be to apply resource constraints using the docker update command: https://docs.docker.com/engine/reference/commandline/update/

Also: to dynamically change resource constraints during runtime, the REST API of son-emu can be extended to control the same parameters as docker update

e.g. PATCH request to /compute/{dc_label}/{compute_name} putting the paramters and value in the JSON load

mpeuster commented 7 years ago

This is done right?

stevenvanrossem commented 7 years ago

I want to link the the REST api in son-emu to the docker.update command in containernet to easily change the resource allocation (cpu,mem) using docker.update Then also son-profile can easily adapt cpu,mem as defined in the ped file. currently only works for cpu, planning to add mem (or all docker.update supported resources)

mpeuster commented 7 years ago

Ah ok fine for me. The dummy GK can already do such things when resource limits are defined in the VNFDs. Maybe this helps as a reference.

stevenvanrossem commented 7 years ago

indeed, I see cgset is used in containernet to set cpu and mem limits, is there any reason why cgset was chosen over docker.update?

mpeuster commented 7 years ago

docker.update was not available at the time it was done :-D Should be migrated to docker.update.

stevenvanrossem commented 7 years ago

docker update is now used by containernet, son-emu rest api calls the new containernet api: f5bc21167b7ccef15485f3980e52a5ee42aff35a https://github.com/sonata-nfv/son-emu/pull/199