The nova.virt.powervm.blockdev Module

class PowerVMDiskAdapter

Bases: object

PowerVM disk adapter interface Provides a contract to implement multiple ways to generate and attach volumes to virtual machines using local and/or external storage

attach_volume_to_host(*args, **kargs)

Attaches volume to host using info passed in *args and **kargs

create_image_from_volume(device_name, context, image_id, image_meta, update_task_state)

Capture the contents of a volume and upload to glance

Parameters:
  • device_name – device in /dev/ to capture
  • context – nova context for operation
  • image_id – image reference to pre-created image in glance
  • image_meta – metadata for new image
  • update_task_state – Function reference that allows for updates to the instance task state
create_volume(size)

Creates a volume with a minimum size

Parameters:size – size of the volume in bytes
Returns:string – the name of the disk device.
create_volume_from_image(context, instance, image_id)

Creates a Volume and copies the specified image to it

Parameters:
  • context – nova context used to retrieve image from glance
  • instance – instance to create the volume for
  • image_id – image_id reference used to locate image in glance
Returns:

dictionary with the name of the created disk device in ‘device_name’ key

delete_volume(volume_info)

Removes the disk and its associated vSCSI connection

Parameters:volume_info – dictionary with volume info including name of

disk device in /dev/

detach_volume_from_host(*args, **kargs)

Detaches volume from host using info passed in *args and **kargs

migrate_volume(lv_name, src_host, dest, image_path, instance_name=None)

Copy a logical volume to file, compress, and transfer

Parameters:
  • lv_name – volume device name
  • src_host – source IP or DNS name.
  • dest – destination IP or DNS name
  • image_path – path to remote image storage directory
  • instance_name – name of instance that is being migrated
Returns:

file path on destination of image file that was moved

class PowerVMLocalVolumeAdapter(connection)

Bases: nova.virt.powervm.blockdev.PowerVMDiskAdapter

Default block device providor for PowerVM

This disk adapter uses logical volumes on the hosting VIOS to provide backing block devices for instances/LPARs

attach_volume_to_host(*args, **kargs)
create_image_from_volume(device_name, context, image_id, image_meta, update_task_state)

Capture the contents of a volume and upload to glance

Parameters:
  • device_name – device in /dev/ to capture
  • context – nova context for operation
  • image_id – image reference to pre-created image in glance
  • image_meta – metadata for new image
  • update_task_state – Function reference that allows for updates to the instance task state.
create_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_volume_from_image(context, instance, image_id)

Creates a Logical Volume and copies the specified image to it

Parameters:
  • context – nova context used to retrieve image from glance
  • instance – instance to create the volume for
  • image_id – image_id reference used to locate image in glance
Returns:

dictionary with the name of the created Logical Volume device in ‘device_name’ key

delete_volume(volume_info)

Removes the Logical Volume and its associated vSCSI connection

Parameters:volume_info – Dictionary with volume info including name of

Logical Volume device in /dev/ via device_name key

detach_volume_from_host(*args, **kargs)
migrate_volume(lv_name, src_host, dest, image_path, instance_name=None)

Copy a logical volume to file, compress, and transfer

Parameters:
  • lv_name – logical volume device name
  • dest – destination IP or DNS name
  • image_path – path to remote image storage directory
  • instance_name – name of instance that is being migrated
Returns:

file path on destination of image file that was moved

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.

Previous topic

The nova.virt.netutils Module

Next topic

The nova.virt.powervm.command Module

This Page