# octavia.compute.drivers package

## Subpackages

- octavia.compute.drivers.noop_driver package
  - Submodules
  - octavia.compute.drivers.noop_driver.driver module
  - Module contents

## Submodules

## octavia.compute.drivers.nova_driver module

class `VirtualMachineManager`

  Bases: `octavia.compute.compute_base.ComputeBase`

  Compute implementation of virtual machines via nova.

  `attach_network_or_port`(compute_id, network_id=None, ip_address=None, port_id=None)

    Attaching a port or a network to an existing amphora

    Parameters:

    - compute_id – id of an amphora in the compute service
    - network_id – id of a network
    - ip_address – ip address to attempt to be assigned to interface
    - port_id – id of the neutron port

    Returns: | nova interface instance

    Raises:

    - ComputePortInUseException – The port is in use somewhere else
    - ComputeUnknownException – Unknown nova error

  `build`(name='amphora_name', amphora_flavor=None, image_id=None, image_tag=None, image_owner=None, key_name=None, sec_groups=None, network_ids=None, port_ids=None, config_drive_files=None, user_data=None, server_group_id=None, availability_zone=None)

    Create a new virtual machine.

    Parameters:

    - name – optional name for amphora
    - amphora_flavor – image flavor for virtual machine
    - image_id – image ID for virtual machine
    - image_tag – image tag for virtual machine
    - key_name – keypair to add to the virtual machine
    - sec_groups – Security group IDs for virtual machine
    - network_ids – Network IDs to include on virtual machine
    - port_ids – Port IDs to include on virtual machine
    - config_drive_files – An optional dict of files to overwrite on the server upon boot. Keys are file names (i.e. /etc/passwd) and values are the file contents (either as a string or as a file-like object). A maximum of five entries is allowed, and each file must be 10k or less.
    - user_data – Optional user data to pass to be exposed by the metadata server this can be a file type object as well or a string
    - server_group_id – Optional server group id(uuid) which is used for anti_affinity feature
    - availability_zone – Name of the compute availability zone.

    Raises: | ComputeBuildException – if nova failed to build virtual machine
    Returns: | UUID of amphora

  `create_server_group`(name, policy)

    Create a server group object

    Parameters:

    - name – the name of the server group
    - policy – the policy of the server group

    Raises: | Generic exception if the server group is not created
    Returns: | the server group object

  `delete`(compute_id)

    Delete a virtual machine.

    Parameters: | compute_id – virtual machine UUID

  `delete_server_group`(server_group_id)

    Delete a server group object

    Raises: | Generic exception if the server group is not deleted
    Parameters: | server_group_id – the uuid of a server group

  `detach_port`(compute_id, port_id)

    Detaches a port from an existing amphora.

    Parameters:

    - compute_id – id of an amphora in the compute service
    - port_id – id of the port

    Returns: | None

  `get_amphora`(compute_id, management_network_id=None)

    Retrieve the information in nova of a virtual machine.

    Parameters:

    - compute_id – virtual machine UUID
    - management_network_id – ID of the management network

    Returns: | an amphora object
    Returns: | fault message or None

  `status`(compute_id)

    Retrieve the status of a virtual machine.

    Parameters: | compute_id – virtual machine UUID
    Returns: | constant of amphora status

  `validate_availability_zone`(availability_zone)

    Validates that an availability zone exists in nova.

    Parameters: | availability_zone – Name of the availability zone to lookup.
    Raises: | NotFound
    Returns: | None

  `validate_flavor`(flavor_id)

    Validates that a flavor exists in nova.

    Parameters: | flavor_id – ID of the flavor to lookup in nova.
    Raises: | NotFound
    Returns: | None

## Module contents

this page last updated: 2023-10-24 12:56:13

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug questions?