This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.scheduler.driver Module

Scheduler base class that all Schedulers should inherit from

exception nova.scheduler.driver.NoValidHost(message=None)

Bases: nova.exception.Error

There is no valid host for the command.

class nova.scheduler.driver.Scheduler

Bases: object

The base class that all Scheduler clases should inherit from.

assert_compute_node_has_enough_disk(context, instance_ref, dest)

Checks if destination host has enough disk for block migration.

Parameters:
  • context – security context
  • instance_ref – nova.db.sqlalchemy.models.Instance object
  • dest – destination host
assert_compute_node_has_enough_memory(context, instance_ref, dest)

Checks if destination host has enough memory for live migration.

Parameters:
  • context – security context
  • instance_ref – nova.db.sqlalchemy.models.Instance object
  • dest – destination host
assert_compute_node_has_enough_resources(context, instance_ref, dest, block_migration)

Checks if destination host has enough resource for live migration.

Parameters:
  • context – security context
  • instance_ref – nova.db.sqlalchemy.models.Instance object
  • dest – destination host
  • block_migration – if True, disk checking has been done
hosts_up(context, topic)

Return the list of hosts that have a running service for topic.

mounted_on_same_shared_storage(context, instance_ref, dest)

Check if the src and dest host mount same shared storage.

At first, dest host creates temp file, and src host can see it if they mounts same shared storage. Then src host erase it.

Parameters:
  • context – security context
  • instance_ref – nova.db.sqlalchemy.models.Instance object
  • dest – destination host
schedule(context, topic, *_args, **_kwargs)

Must override at least this method for scheduler to work.

schedule_live_migration(context, instance_id, dest, block_migration=False)

Live migration scheduling method.

Parameters:
  • context
  • instance_id
  • dest – destination host
Returns:

The host where instance is running currently. Then scheduler send request that host.

static service_is_up(service)

Check whether a service is up based on last heartbeat.

set_zone_manager(zone_manager)

Called by the Scheduler Service to supply a ZoneManager.

exception nova.scheduler.driver.WillNotSchedule(message=None)

Bases: nova.exception.Error

The specified host is not up or doesn’t exist.