The nova.virt.fake Module

A fake (in-memory) hypervisor+api.

Allows nova testing w/o a hypervisor. This module also documents the semantics of real hypervisor connections.

class FakeDriver(read_only=False)

Bases: nova.virt.driver.ComputeDriver

Fake hypervisor driver

attach_volume(connection_info, instance_name, mountpoint)

Attach the disk to the instance at mountpoint using info

block_stats(instance_name, disk_id)
confirm_migration(migration, instance, network_info)
destroy(instance, network_info, block_device_info=None)
detach_volume(connection_info, instance_name, mountpoint)

Detach the disk attached to the instance

ensure_filtering_rules_for_instance(instance_ref, network_info)

This method is supported only by libvirt.

finish_migration(context, migration, instance, disk_info, network_info, image_meta, resize_instance)
finish_revert_migration(instance, network_info)
get_all_bw_usage(instances, start_time, stop_time=None)

Return bandwidth usage info for each interface on each running VM

get_available_resource()

Updates compute manager resource info on ComputeNode table.

Since we don’t have a real hypervisor, pretend we have lots of disk and ram.

get_console_output(instance)
get_console_pool_info(console_type)
get_diagnostics(instance_name)
get_disk_available_least()
static get_host_ip_addr()
get_host_stats(refresh=False)

Return fake Host Status of ram, disk, network.

get_info(instance)
get_instance_disk_info(instance_name)
get_vnc_console(instance)
get_volume_connector(instance)
host_maintenance_mode(host, mode)

Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.

host_power_action(host, action)

Reboots, shuts down or powers up the host.

init_host(host)
inject_file(instance, b64_path, b64_contents)
interface_stats(instance_name, iface_id)
list_instances()
live_migration(context, instance_ref, dest, post_method, recover_method, block_migration=False, migrate_data=None)
migrate_disk_and_power_off(context, instance, dest, instance_type, network_info)
pause(instance)
plug_vifs(instance, network_info)

Plug VIFs into networks.

poll_rebooting_instances(timeout)
poll_rescued_instances(timeout)
power_off(instance)
power_on(instance)
pre_live_migration(context, instance_ref, block_device_info, network_info)
reboot(instance, network_info, reboot_type, block_device_info=None)
refresh_instance_security_rules(instance)
refresh_provider_fw_rules()
refresh_security_group_members(security_group_id)
refresh_security_group_rules(security_group_id)
rescue(context, instance, network_info, image_meta, rescue_password)
resume(instance)
resume_state_on_host_boot(context, instance, network_info, block_device_info=None)
set_admin_password(instance, new_pass)
set_host_enabled(host, enabled)

Sets the specified host’s ability to accept new instances.

snapshot(context, instance, name)
spawn(context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None)
suspend(instance)
test_remove_vm(instance_name)

Removes the named VM, as if it crashed. For testing

unfilter_instance(instance_ref, network_info)

This method is supported only by libvirt.

unpause(instance)
unplug_vifs(instance, network_info)

Unplug VIFs from networks.

unrescue(instance, network_info)
update_host_status()

Return fake Host Status of ram, disk, network.

class FakeInstance(name, state)

Bases: object

Previous topic

The nova.virt.driver Module

Next topic

The nova.virt.firewall Module

This Page