mlos_bench.services.types.host_provisioner_type module

Protocol interface for Host/VM provisioning operations.

class mlos_bench.services.types.host_provisioner_type.SupportsHostProvisioning(*args, **kwargs)

Bases: Protocol

Protocol interface for Host/VM provisioning operations.

Methods

deallocate_host(params)

Deallocates the Host/VM by shutting it down then releasing the compute resources.

deprovision_host(params)

Deprovisions the Host/VM by deleting it.

provision_host(params)

Check if Host/VM is ready.

wait_host_deployment(params, *, is_setup)

Waits for a pending operation on a Host/VM to resolve to SUCCEEDED or FAILED.

deallocate_host(params: dict) Tuple[Status, dict]

Deallocates the Host/VM by shutting it down then releasing the compute resources.

Note: This can cause the VM to arrive on a new host node when its restarted, which may have different performance characteristics.

Parameters:
paramsdict

Flat dictionary of (key, value) pairs of tunable parameters.

Returns:
result(Status, dict={})

A pair of Status and result. The result is always {}. Status is one of {PENDING, SUCCEEDED, FAILED}

deprovision_host(params: dict) Tuple[Status, dict]

Deprovisions the Host/VM by deleting it.

Parameters:
paramsdict

Flat dictionary of (key, value) pairs of tunable parameters.

Returns:
result(Status, dict={})

A pair of Status and result. The result is always {}. Status is one of {PENDING, SUCCEEDED, FAILED}

provision_host(params: dict) Tuple[Status, dict]

Check if Host/VM is ready. Deploy a new Host/VM, if necessary.

Parameters:
paramsdict

Flat dictionary of (key, value) pairs of tunable parameters. VMEnv tunables are variable parameters that, together with the VMEnv configuration, are sufficient to provision a VM.

Returns:
result(Status, dict={})

A pair of Status and result. The result is always {}. Status is one of {PENDING, SUCCEEDED, FAILED}

wait_host_deployment(params: dict, *, is_setup: bool) Tuple[Status, dict]

Waits for a pending operation on a Host/VM to resolve to SUCCEEDED or FAILED. Return TIMED_OUT when timing out.

Parameters:
paramsdict

Flat dictionary of (key, value) pairs of tunable parameters.

is_setupbool

If True, wait for Host/VM being deployed; otherwise, wait for successful deprovisioning.

Returns:
result(Status, dict)

A pair of Status and result. Status is one of {PENDING, SUCCEEDED, FAILED, TIMED_OUT} Result is info on the operation runtime if SUCCEEDED, otherwise {}.