ironic.console.container.base module

Abstract base class for console container providers.

class ironic.console.container.base.BaseConsoleContainer[source]

Bases: object

Base class for console container provider APIs.

abstractmethod is_stopped(task)[source]

Check whether the console container for this node has stopped.

This is used by the graphical console periodic task to reconcile console sessions with actual container state, so True must only be returned when the container is definitively stopped. A container which is still starting, such as a Pending kubernetes pod, must return False.

Parameters:

task – A TaskManager instance.

Returns:

True if the container is definitively stopped (stopped, exited, or deleted), False if it is running or still starting.

Raises:

ConsoleContainerError if the state cannot be determined.

abstract property provider_name

Provider name used in error messages

abstractmethod start_container(task, app_name, app_info)[source]

Start a console container for a node.

Calling this will block until a consumable container host and port can be returned.

Parameters:
  • task – A TaskManager instance.

  • app_name – Name of app to run in the container

  • app_info – Dict of app-specific info

Returns:

Tuple of host IP address and published port

Raises:

ConsoleContainerError

abstractmethod stop_all_containers()[source]

Stops all running console containers

This is run on conductor startup and graceful shutdown to ensure no console containers are running. :raises: ConsoleContainerError

abstractmethod stop_container(task)[source]

Stop a console container for a node.

Any existing running container for this node will be stopped.

Parameters:

task – A TaskManager instance.

Raises:

ConsoleContainerError