Documentation for the compute manager and related files. For reading about a specific virtualization backend, read Drivers.
Handles all processes relating to instances (guest vms).
The ComputeManager class is a nova.manager.Manager that handles RPC calls relating to creating instances. It is responsible for building a disk image, launching it via the underlying virtualization driver, responding to calls to check its state, attaching persistent storage, and terminating it.
Related Flags
instances_path: | Where instances are kept on disk |
---|---|
base_dir_name: | Where cached images are stored under instances_path |
compute_driver: | Name of class that is used to handle virtualization, loaded by nova.utils.import_object() |
Bases: nova.manager.SchedulerDependentManager
Manages the running instances from creation to destruction.
Adds a host to a physical hypervisor pool.
Calls network_api to add new fixed_ip to instance then injects the new network info and resets instance networking.
Adds the specified fault to the database.
Update agent running on an instance on this host.
Attach a volume to an instance.
Confirms existence of the tmpfile under FLAGS.instances_path. Cannot confirm tmpfile return False.
Parameters: |
|
---|
Removes existence of the tmpfile under FLAGS.instances_path.
Parameters: |
|
---|
Checks that the host cpu is compatible with a cpu given by xml.
Parameters: |
|
---|---|
Returns: | See driver.compare_cpu |
Destroys the source instance.
Makes tmpfile under FLAGS.instance_path.
This method enables compute nodes to recognize that they mounts same shared storage. (create|check|creanup)_shared_storage_test_file() is a pair.
Parameters: | context – security context |
---|---|
Returns: | tmpfile name(basename) |
Detach a volume from an instance.
Completes the migration process.
Sets up the newly transferred disk and turns on the instance at its new host machine.
Finishes the second half of reverting a resize.
Power back on the source instance and revert the resized attributes in the database.
Send the console output for the given instance.
Retrieves the console host for a project on this host.
Currently this is just set in the flags for each compute host.
Retrieve diagnostics for an instance on this host.
Getting infomation of instance’s current disk.
Implementation nova.virt.libvirt.connection.
Parameters: |
|
---|
Return the boolean state of the given instance’s lock.
Return connection information for a vnc console.
Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.
Reboots, shuts down or powers up the host.
Initialization for a standalone compute service.
Write a file to the specified path in an instance on this host.
Inject network info for the given instance.
Executing live migration.
Parameters: |
|
---|
Lock the given instance.
Pause an instance on this host.
Post operations for live migration.
This method is called from live_migration and mainly updating database record.
Parameters: |
|
---|
Post operations for live migration .
Parameters: |
|
---|
Power off an instance on this host.
Power on an instance on this host.
Preparations for live migration at dest host.
Parameters: |
|
---|
Initiates the process of moving a running instance to another host.
Possibly changes the RAM and disk size in the process.
Reboot an instance on this host.
Destroy and re-make this instance.
A ‘rebuild’ effectively purges all existing data from the system and remakes the VM with given ‘metadata’ and ‘personalities’.
Parameters: |
|
---|
This call passes straight through to the virtualization driver.
Tell the virtualization driver to refresh security group members.
Passes straight through to the virtualization driver.
Tell the virtualization driver to refresh security group rules.
Passes straight through to the virtualization driver.
Removes a host from a physical hypervisor pool.
Calls network_api to remove existing fixed_ip from instance by injecting the altered network info and resetting instance networking.
Remove a volume connection using the volume api
Rescue an instance on this host. :param rescue_password: password to set on rescue instance
Reset networking on the given instance.
Starts the migration of a running instance to another host.
Resume the given suspended instance.
Destroys the new instance on the destination machine.
Reverts the model changes, and powers on the old instance on the source machine.
Recovers Instance/volume state from migrating -> running.
Parameters: |
|
---|
Cleaning up image directory that is created pre_live_migration.
Parameters: |
|
---|
Delete excess backups associated to an instance.
Instances are allowed a fixed number of backups (the rotation number); this method deletes the oldest backups that exceed the rotation threshold.
Parameters: |
|
---|
Set the root/admin password for an instance on this host.
This is generally only called by API password resets after an image has been built.
Sets the specified host’s ability to accept new instances.
Snapshot an instance on this host.
Parameters: |
|
---|
Stopping an instance on this host.
Suspend the given instance.
Terminate an instance on this host.
Unlock the given instance.
Unpause a paused instance on this host.
Rescue an instance on this host.
See driver.update_available_resource()
Parameters: | context – security context |
---|---|
Returns: | See driver.update_available_resource() |
Decorator to prevent action against locked instances for non-admins.
Wraps a method to catch exceptions related to instances.
This decorator wraps a method to catch any exceptions having to do with an instance that may get thrown. It then logs an instance fault in the db.
Abstraction of the underlying virtualization API.
In case of baremetal (FLAGS.connection_type), specific driver is set by FLAGS.baremetal_driver
Returns an object representing the connection to a virtualization platform.
This could be nova.virt.fake.FakeConnection in test mode, a connection to KVM, QEMU, or UML via libvirt_conn, or a connection to XenServer or Xen Cloud Platform via xenapi.
Any object returned here must conform to the interface documented by FakeConnection.
Related flags
Connection_type : | |
---|---|
A string literal that falls through a if/elif structure to determine what virtualization mechanism to use. Values may be
|
Handling of VM disk images.
Built-in instance properties.
Creates instance types.
Marks instance types as deleted.
Get all non-deleted instance_types.
Pass true as argument if you want deleted instance types returned also.
Get all non-deleted instance_types.
Pass true as argument if you want deleted instance types returned also.
Get the default instance type.
Retrieves single instance type by id.
Retrieve instance type by flavorid.
Raises : | FlavorNotFound |
---|
Retrieves single instance type by name.
The various power states that a VM can be in.
Bases: object
The base for helper classes. This adds the XenAPI class attribute
Retrieve all refs and recs for a Xen record type.
Handles race-conditions where the record may be deleted between the get_all call and the get_record call.
A fake (in-memory) hypervisor+api.
Allows nova testing w/o a hypervisor. This module also documents the semantics of real hypervisor connections.
Bases: nova.virt.driver.ComputeDriver
Fake hypervisor driver
Attach the disk to the instance at mountpoint using info
This method is supported only by libvirt.
Detach the disk attached to the instance
This method is supported only by libvirt.
Return bandwidth usage info for each interface on each running VM
Return fake Host Status of ram, disk, network.
This method is supported only by libvirt.
Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.
Reboots, shuts down or powers up the host.
This method is supported only by libvirt.
Plug VIFs into networks.
This method is supported only by libvirt.
Sets the specified host’s ability to accept new instances.
Removes the named VM, as if it crashed. For testing
This method is supported only by libvirt.
Unplug VIFs from networks.
Updates compute manager resource info on ComputeNode table.
Since we don’t have a real hypervisor, pretend we have lots of disk and ram.
Return fake Host Status of ram, disk, network.
Bases: object