The Server Class¶
Server class inherits from
- class openstack.compute.v2.server.Server(_synchronized=False, connection=None, **attrs)¶
The base resource
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._connectionin Resource code should protect itself with a check for None.
A list of dictionaries holding links relevant to this server.
A dictionary of addresses this server can be accessed through. The dictionary contains keys such as
public, each containing a list of dictionaries for addresses of that type. The addresses are contained in a dictionary with keys
version, which is either 4 or 6 depending on the protocol of the IP address. Type: dict
When a server is first created, it provides the administrator password.
A list of an attached volumes. Each item in the list contains at least an “id” key to identify the specific volumes.
The name of the availability zone this server is a part of.
Enables fine grained control of the block device mapping for an instance. This is typically used for booting servers from volumes.
Indicates whether or not a config drive was used for this server.
The name of the compute host on which this instance is running. Appears in the response for administrative users only.
Timestamp of when the server was created.
The description of the server. Before microversion 2.19 this was set to the server name.
The disk configuration. Either AUTO or MANUAL.
The flavor reference, as a ID or full URL, for the flavor to use for this server.
Indicates whether a configuration drive enables metadata injection. Not all cloud providers enable this feature.
An ID representing the host of this server.
The host status.
The hostname set on the instance when it is booted. By default, it appears in the response for administrative users only.
The hypervisor host name. Appears in the response for administrative users only.
The image reference, as a ID or full URL, for the image to use for this server.
The image property as returned from server.
The instance name. The Compute API generates the instance name from the instance name template. Appears in the response for administrative users only.
The UUID of the kernel image when using an AMI. Will be null if not. By default, it appears in the response for administrative users only.
The name of an associated keypair
When servers are launched via multiple create, this is the sequence in which the servers were launched. By default, it appears in the response for administrative users only.
The timestamp when the server was launched.
The maximum number of servers to create.
Metadata stored for this server. Type: dict
The minimum number of servers to create.
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.
The power state of this server.
While the server is building, this value represents the percentage of completion. Once it is completed, it will be 100. Type: int
The ID of the project this server is associated with.
The UUID of the ramdisk image when using an AMI. Will be null if not. By default, it appears in the response for administrative users only.
The reservation id for the server. This is an id that can be useful in tracking groups of servers created with multiple create, that will all have the same reservation_id. By default, it appears in the response for administrative users only.
The root device name for the instance By default, it appears in the response for administrative users only.
The dictionary of data to send to the scheduler.
A list of applicable security groups. Each group contains keys for description, name, id, and rules.
The UUIDs of the server groups to which the server belongs. Currently this can contain at most one entry.
The state this server is in. Valid values include
The task state of this server.
The timestamp when the server was terminated (if it has been).
A list of trusted certificate IDs, that were used during image signature verification to verify the signing certificate.
Timestamp of when this server was last updated.
Configuration information or scripts to use upon launch. Must be Base64 encoded.
The ID of the owners of this server.
The VM state of this server.
- change_password(session, new_password)¶
Change the administrator password to the given password.
Get the encrypted administrator password.
- reboot(session, reboot_type)¶
Reboot server where reboot_type might be ‘SOFT’ or ‘HARD’.
Force delete a server.
- rebuild(session, name=None, admin_password=None, preserve_ephemeral=False, image=None, access_ipv4=None, access_ipv6=None, metadata=None, user_data=None)¶
Rebuild the server with the given arguments.
- resize(session, flavor)¶
Resize server to flavor reference.
Confirm the resize of the server.
Revert the resize of the server.
- create_image(session, name, metadata=None)¶
Create image from server.
Fetch security groups of a server.
Updated Server instance.