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
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_logical_vol_size(diskname)

Finds and calculates the logical volume size in GB

Parameters:diskname – name of the logical volume
Returns:size of logical volume in GB
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.
macs_for_instance(instance)
remove_lpar(instance_name)

Removes a LPAR.

Parameters:instance_name – LPAR instance name
rename_lpar(instance_name, new_name)

Rename LPAR given by instance_name to new_name

Note: For IVM based deployments, the name is
limited to 31 characters and will be trimmed to meet this requirement
Parameters:
  • instance_name – name of LPAR to be renamed
  • new_name – desired new name of LPAR
Returns:

new name of renamed LPAR trimmed to 31 characters if necessary

run_vios_command(cmd, check_exit_code=True)

Run a remote command using an active ssh connection.

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

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

Parameters:command – List of commands.
set_lpar_mac_base_value(instance_name, mac)

Set LPAR’s property virtual_eth_mac_base_value

Parameters:
  • instance_name – name of the instance to be set
  • mac – mac of virtual ethernet
start_lpar(instance_name)

Start a LPAR instance.

Parameters:instance_name – LPAR instance name
stop_lpar(instance_name, timeout=30)

Stop a running LPAR.

Parameters:
  • instance_name – LPAR instance name
  • timeout – value in seconds for specifying how long to wait for the LPAR to stop
update_lpar(lpar_info)

Resizing an LPAR

Parameters:lpar_info – dictionary of LPAR information
class IVMOperator(ivm_connection)

Bases: nova.virt.powervm.operator.BaseOperator

Integrated Virtualization Manager (IVM) Operator.

Runs specific commands on an IVM managed system.

macs_for_instance(instance)

Generates set of valid MAC addresses for an IVM instance.

class PowerVMOperator

Bases: object

PowerVM main operator.

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

capture_image(context, instance, image_id, image_meta, update_task_state)

Capture the root disk for a snapshot

Parameters:
  • context – nova context for this operation
  • instance – instance information to capture the image from
  • image_id – uuid of pre-created snapshot image
  • image_meta – metadata to upload with captured image
  • update_task_state – Function reference that allows for updates to the instance task state.
deploy_from_migrated_file(lpar, file_path, size)

Deploy the logical volume and attach to new lpar.

Parameters:
  • lpar – lar instance
  • file_path – logical volume path
  • size – new size of the logical volume
destroy(instance_name, destroy_disks=True)

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.

macs_for_instance(instance)
migrate_disk(device_name, src_host, dest, image_path, instance_name=None)

Migrates SVC or Logical Volume based disks

Parameters:
  • device_name – disk device name in /dev/
  • dest – IP or DNS name of destination host/VIOS
  • image_path – path on source and destination to directory for storing image files
  • instance_name – name of instance being migrated
Returns:

disk_info dictionary object describing root volume information used for locating/mounting the volume

power_off(instance_name, timeout=30)
power_on(instance_name)
spawn(context, instance, image_id, network_info)
get_powervm_disk_adapter()
get_powervm_operator()

Previous topic

The nova.virt.powervm.lpar Module

Next topic

The nova.virt.storage_users Module

This Page