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, **attrs)

The base resource

Parameters:_synchronized (bool) – This is not intended to be used directly. See new() and existing().

A list of dictionaries holding links relevant to this server.

addresses = None

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 = None

Timestamp of when the server was created.

flavor_id = None

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

flavor = None

The flavor property as returned from server.

host_id = None

An ID representing the host of this server.

image_id = None

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

image = None

The image property as returned from server.

metadata = None

Metadata stored for this server. Type: dict

progress = None

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

project_id = None

The ID of the project this server is associated with.

status = None

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 = None

Timestamp of when this server was last updated.

user_id = None

The ID of the owners of this server.

key_name = None

The name of an associated keypair

disk_config = None

The disk configuration. Either AUTO or MANUAL.

has_config_drive = None

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

availability_zone = None

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

power_state = None

The power state of this server.

task_state = None

The task state of this server.

vm_state = None

The VM state of this server.

attached_volumes = None

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

launched_at = None

The timestamp when the server was launched.

terminated_at = None

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

security_groups = None

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

admin_password = None

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

personality = None

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 = None

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

block_device_mapping = None

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

scheduler_hints = None

The dictionary of data to send to the scheduler.

networks = None

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 = None

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

instance_name = None

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.

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.