The nova.virt.powervm.operator Module

class BaseOperator(connection)

Bases: object

Base operator for IVM and HMC managed systems.

attach_disk_to_vhost(disk, vhost)

Attach disk name to a specific vhost.

Parameters:
  • disk – the disk name
  • vhost – the vhost name
copy_file_to_device(source_path, device)

Copy file to device.

Parameters:
  • source_path – path to input source file
  • device – output device name
copy_image_file(source_path, remote_path)

Copy file to VIOS, decompress it, and return its new size and name.

Parameters:source_path – source file path

:param remote_path remote file path

create_logical_volume(size)

Creates a logical volume with a minimum size.

Parameters:size – size of the logical volume in bytes
Returns:string – the name of the new logical volume.
Raises :PowerVMNoSpaceLeftOnVolumeGroup
create_lpar(lpar)

Receives a LPAR data object and creates a LPAR instance.

Parameters:lpar – LPAR object
get_cpu_info()

Get CPU info.

Returns:tuple - cpu info (total_procs, avail_procs)
get_disk_info()

Get the disk usage information.

Returns:tuple - disk info (disk_total, disk_used, disk_avail)
get_disk_name_by_vhost(vhost)

Returns the disk name attached to a vhost.

Parameters:vhost – a vhost name
Returns:string – disk name
get_hostname()

Returns the managed system hostname.

Returns:string – hostname
get_lpar(instance_name, resource_type='lpar')

Return a LPAR object by its instance name.

Parameters:
  • instance_name – LPAR instance name
  • resource_type – the type of resources to list
Returns:

LPAR object

get_memory_info()

Get memory info.

Returns:tuple - memory info (total_mem, avail_mem)
get_vhost_by_instance_id(instance_id)

Return the vhost name by the instance id.

Parameters:instance_id – LPAR instance id
Returns:string – vhost name or None in case none is found
get_virtual_eth_adapter_id()

Virtual ethernet adapter id.

Searches for the shared ethernet adapter and returns its id.

Returns:id of the virtual ethernet adapter.
list_lpar_instances()

List all existent LPAR instances names.

Returns:list – list with instances names.
remove_disk(disk_name)

Removes a disk.

Parameters:disk – a disk name
remove_logical_volume(lv_name)

Removes the lv and the connection between its associated vscsi.

Parameters:lv_name – a logical volume name
remove_lpar(instance_name)

Removes a LPAR.

Parameters:instance_name – LPAR instance name
run_cfg_dev(device_name)

Run cfgdev command for a specific device.

Parameters:device_name – device name the cfgdev command will run.
run_command(cmd, check_exit_code=True)

Run a remote command using an active ssh connection.

Parameters:command – String with the command to run.
run_command_as_root(command, check_exit_code=True)

Run a remote command as root using an active ssh connection.

Parameters:command – List of commands.
start_lpar(instance_name)

Start a LPAR instance.

Parameters:instance_name – LPAR instance name
stop_lpar(instance_name)

Stop a running LPAR.

Parameters:instance_name – LPAR instance name
class IVMOperator(ivm_connection)

Bases: nova.virt.powervm.operator.BaseOperator

Integrated Virtualization Manager (IVM) Operator.

Runs specific commands on an IVM managed system.

class PowerVMOperator

Bases: object

PowerVM main operator.

The PowerVMOperator is intented to wrapper all operations from the driver and handle either IVM or HMC managed systems.

destroy(instance_name)

Destroy (shutdown and delete) the specified instance.

Parameters:instance_name – Instance name.
get_available_resource()

Retrieve resource info.

Returns:dictionary containing resource info
get_host_stats(refresh=False)

Return currently known host stats

get_info(instance_name)

Get the current status of an LPAR instance.

Returns a dict containing:

State :the running state, one of the power_state codes
Max_mem :(int) the maximum memory in KBytes allowed
Mem :(int) the memory in KBytes used by the domain
Num_cpu :(int) the number of virtual CPUs for the domain
Cpu_time :(int) the CPU time used in nanoseconds
Raises :PowerVMLPARInstanceNotFound
instance_exists(instance_name)
list_instances()

Return the names of all the instances known to the virtualization layer, as a list.

power_off(instance_name)
power_on(instance_name)
spawn(context, instance, image_id)
get_powervm_operator()

Previous topic

The nova.virt.powervm.lpar Module

Next topic

The nova.virt.vif Module

This Page