Bases: object
This base class defines the interface used for compute resource plugins. It is not necessary to use this base class, but all compute resource plugins must implement the abstract methods found here. An instance of the plugin object is instantiated when it is loaded by calling __init__() with no parameters.
Update resource information adding allocation according to the given resource usage.
Parameters: | usage – the resource usage of the instance being added |
---|---|
Returns: | None |
Update resource information removing allocation according to the given resource usage.
Parameters: | usage – the resource usage of the instance being removed |
---|---|
Returns: | None |
Log free resources.
This method logs how much free resource is held by the resource plugin.
Returns: | None |
---|
Set the resource to an initial state based on the resource view discovered from the hypervisor.
Test to see if we have sufficient resources to allocate for an instance with the given resource usage.
Parameters: |
|
---|---|
Returns: | None if the test passes or a string describing the reason why the test failed |
Write resource data to populate resources.
Parameters: | resources – the resources data to be populated |
---|---|
Returns: | None |