openstack.compute.v2.server

openstack.compute.v2.server

The Server Class

The Server class inherits from Resource.

class openstack.compute.v2.server.Server(_synchronized=False, connection=None, **attrs)

The base resource

Parameters:
  • _synchronized (bool) – This is not intended to be used directly. See new() and existing().
  • connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of self._connection in Resource code should protect itself with a check for None.

A list of dictionaries holding links relevant to this server.

addresses

A dictionary of addresses this server can be accessed through. The dictionary contains keys such as private and public, each containing a list of dictionaries for addresses of that type. The addresses are contained in a dictionary with keys addr and version, which is either 4 or 6 depending on the protocol of the IP address. Type: dict

created_at

Timestamp of when the server was created.

flavor_id

The flavor reference, as a ID or full URL, for the flavor to use for this server.

flavor

The flavor property as returned from server.

host_id

An ID representing the host of this server.

image_id

The image reference, as a ID or full URL, for the image to use for this server.

image

The image property as returned from server.

metadata

Metadata stored for this server. Type: dict

progress

While the server is building, this value represents the percentage of completion. Once it is completed, it will be 100. Type: int

project_id

The ID of the project this server is associated with.

status

The state this server is in. Valid values include ACTIVE, BUILDING, DELETED, ERROR, HARD_REBOOT, PASSWORD, PAUSED, REBOOT, REBUILD, RESCUED, RESIZED, REVERT_RESIZE, SHUTOFF, SOFT_DELETED, STOPPED, SUSPENDED, UNKNOWN, or VERIFY_RESIZE.

updated_at

Timestamp of when this server was last updated.

user_id

The ID of the owners of this server.

key_name

The name of an associated keypair

disk_config

The disk configuration. Either AUTO or MANUAL.

has_config_drive

Indicates whether a configuration drive enables metadata injection. Not all cloud providers enable this feature.

availability_zone

The name of the availability zone this server is a part of.

power_state

The power state of this server.

task_state

The task state of this server.

vm_state

The VM state of this server.

attached_volumes

A list of an attached volumes. Each item in the list contains at least an “id” key to identify the specific volumes.

launched_at

The timestamp when the server was launched.

terminated_at

The timestamp when the server was terminated (if it has been).

security_groups

A list of applicable security groups. Each group contains keys for description, name, id, and rules.

admin_password

When a server is first created, it provides the administrator password.

personality

The file path and contents, text only, to inject into the server at launch. The maximum size of the file path data is 255 bytes. The maximum limit is The number of allowed bytes in the decoded, rather than encoded, data.

user_data

Configuration information or scripts to use upon launch. Must be Base64 encoded.

block_device_mapping

Enables fine grained control of the block device mapping for an instance. This is typically used for booting servers from volumes.

scheduler_hints

The dictionary of data to send to the scheduler.

networks

A networks object. Required parameter when there are multiple networks defined for the tenant. When you do not specify the networks parameter, the server attaches to the only network created for the current tenant.

hypervisor_hostname

The hypervisor host name. Appears in the response for administrative users only.

instance_name

The instance name. The Compute API generates the instance name from the instance name template. Appears in the response for administrative users only.

change_password(session, new_password)

Change the administrator password to the given password.

get_password(session)

Get the encrypted administrator password.

reboot(session, reboot_type)

Reboot server where reboot_type might be ‘SOFT’ or ‘HARD’.

force_delete(session)

Force delete a server.

rebuild(session, name, admin_password, preserve_ephemeral=False, image=None, access_ipv4=None, access_ipv6=None, metadata=None, personality=None)

Rebuild the server with the given arguments.

resize(session, flavor)

Resize server to flavor reference.

confirm_resize(session)

Confirm the resize of the server.

revert_resize(session)

Revert the resize of the server.

create_image(session, name, metadata=None)

Create image from server.

Creative Commons Attribution 3.0 License

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