Server interface.
Bases: Resource
Populate and bind to a manager.
manager – BaseManager object
info – dictionary representing resource attributes
loaded – prevent lazy-loading if set to True
resp – Response or list of Response objects
Bases: Resource
Populate and bind to a manager.
manager – BaseManager object
info – dictionary representing resource attributes
loaded – prevent lazy-loading if set to True
resp – Response or list of Response objects
Bases: Resource
Populate and bind to a manager.
manager – BaseManager object
info – dictionary representing resource attributes
loaded – prevent lazy-loading if set to True
resp – Response or list of Response objects
Add a security group to an instance.
security_group – The name of security group to add
An instance of novaclient.base.DictWithMeta
Add single tag to an instance.
Backup a server instance.
backup_name – Name of the backup image
backup_type – The backup type, like ‘daily’ or ‘weekly’
rotation – Int parameter representing how many backups to keep around.
An instance of novaclient.base.TupleWithMeta
Update the admin password for a server.
password – string to set as the admin password on the server
An instance of novaclient.base.TupleWithMeta
Get password for a Server.
Confirm that the resize worked, thus removing the original server.
An instance of novaclient.base.TupleWithMeta
Create an image based on this server.
image_name – The name to assign the newly create image.
metadata – Metadata to assign to the image.
Delete (i.e. shut down and delete the image) this server.
An instance of novaclient.base.TupleWithMeta
Remove all tags from an instance.
Remove single tag from an instance.
Diagnostics – Retrieve server diagnostics.
Evacuate an instance from failed host to specified host.
host – Name of the target host
password – string to set as admin password on the evacuated server.
An instance of novaclient.base.TupleWithMeta
Force delete – Force delete a server.
An instance of novaclient.base.TupleWithMeta
Get text console log output from Server.
length – The number of lines you would like to retrieve (as int)
Retrieve a console of a particular protocol and console_type
console_type – Type of console
Get mks console for a Server.
Get password for a Server.
Returns the clear password of an instance if private_key is provided, returns the ciphered password otherwise.
private_key – Path to private key file for decryption (optional)
Get rdp console for a Server.
console_type – Type of console (‘rdp-html5’)
Get serial console for a Server.
console_type – Type of console (‘serial’)
Get spice console for a Server.
console_type – Type of console (‘spice-html5’)
Get vnc console for a Server.
console_type – Type of console (‘novnc’ or ‘xvpvnc’)
Attach a network interface to an instance with an optional tag.
Detach a network interface from an instance.
List interfaces attached to an instance.
List security group(s) of an instance.
Migrates a running instance to a new machine.
host – destination host name.
block_migration – if True, do block_migration, the default value is None which is mapped to ‘auto’.
An instance of novaclient.base.TupleWithMeta
Lock – Lock the instance from certain operations.
reason – (Optional) The lock reason.
An instance of novaclient.base.TupleWithMeta
Migrate a server to a new host.
host – (Optional) The target host.
An instance of novaclient.base.TupleWithMeta
Generate a simplified list of addresses
An OrderedDict, keyed by network name, and sorted by network name in ascending order.
Pause – Pause the running server.
An instance of novaclient.base.TupleWithMeta
Reboot the server.
reboot_type – either REBOOT_SOFT
for a software-level
reboot, or REBOOT_HARD for a virtual power cycle hard reboot.
An instance of novaclient.base.TupleWithMeta
Rebuild – shut down and then re-image – this server.
image – the Image
(or its ID) to re-image with.
password – string to set as the admin password on the rebuilt server.
preserve_ephemeral – If True, request that any ephemeral device be preserved when rebuilding the instance. Defaults to False.
Remove a security group from an instance.
An instance of novaclient.base.TupleWithMeta
Rescue – Rescue the problematic server.
password – The admin password to be set in the rescue instance.
image – The Image
to rescue with.
An instance of novaclient.base.TupleWithMeta
Reset network of an instance.
An instance of novaclient.base.TupleWithMeta
Reset the state of an instance to active or error.
An instance of novaclient.base.TupleWithMeta
Resize the server’s resources.
flavor – the Flavor
(or its ID) to resize to.
An instance of novaclient.base.TupleWithMeta
Until a resize event is confirmed with confirm_resize()
, the old
server will be kept around and you’ll be able to roll back to the old
flavor quickly with revert_resize()
. All resizes are
automatically confirmed after 24 hours.
Restore – Restore a server in ‘soft-deleted’ state.
An instance of novaclient.base.TupleWithMeta
Resume – Resume the suspended server.
An instance of novaclient.base.TupleWithMeta
Revert a previous resize, switching back to the old server.
An instance of novaclient.base.TupleWithMeta
Set list of tags to an instance.
Shelve – Shelve the server.
An instance of novaclient.base.TupleWithMeta
Shelve_offload – Remove a shelved server from the compute node.
An instance of novaclient.base.TupleWithMeta
Start – Start the paused server.
An instance of novaclient.base.TupleWithMeta
Stop – Stop the running server.
An instance of novaclient.base.TupleWithMeta
Suspend – Suspend the running server.
An instance of novaclient.base.TupleWithMeta
Get list of tags from an instance.
Retrieve server topology.
Trigger crash dump in an instance
Unlock – Remove instance lock.
An instance of novaclient.base.TupleWithMeta
Unpause – Unpause the paused server.
An instance of novaclient.base.TupleWithMeta
Unrescue – Unrescue the rescued server.
An instance of novaclient.base.TupleWithMeta
Unshelve – Unshelve the server.
availability_zone – If specified the instance will be unshelved to the availability_zone. If None is passed the instance defined availability_zone is unpin and the instance will be scheduled to any availability_zone (free scheduling). If not specified the instance will be unshelved to either its defined availability_zone or any availability_zone (free scheduling).
host – The specified host (Optional)
An instance of novaclient.base.TupleWithMeta
Bases: BootingManagerWithFind
Add a Security Group to an instance
server – ID of the instance.
security_group – The name of security group to add.
An instance of novaclient.base.DictWithMeta
Add single tag to an instance.
Backup a server instance.
server – The Server
(or its ID) to share onto.
backup_name – Name of the backup image
backup_type – The backup type, like ‘daily’ or ‘weekly’
rotation – Int parameter representing how many backups to keep around.
An instance of novaclient.base.TupleWithMeta if the request microversion is < 2.45, otherwise novaclient.base.DictWithMeta.
Update the password for a server.
server – The Server
(or its ID) for which the admin
password is to be changed
An instance of novaclient.base.TupleWithMeta
Clear the admin password of an instance
Remove the admin password for an instance from the metadata server.
server – The Server
(or its ID) for which the admin
password is to be cleared
Confirm that the resize worked, thus removing the original server.
server – The Server
(or its ID) to share onto.
An instance of novaclient.base.TupleWithMeta
Create (boot) a new server.
In order to create a server with pre-existing ports that contain a
resource_request
value, such as for guaranteed minimum bandwidth
quality of service support, microversion 2.72
is required.
name – Something to name the server.
image – The Image
to boot with.
flavor – The Flavor
to boot onto.
meta – A dict of arbitrary key/value metadata to store for this server. Both keys and values must be <=255 characters.
files – A 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.
(deprecated starting with microversion 2.57)
reservation_id – return a reservation_id for the set of servers being requested, boolean.
min_count – (optional extension) The minimum number of servers to launch.
max_count – (optional extension) The maximum number of servers to launch.
security_groups – A list of security group names
userdata – user data to pass to be exposed by the metadata server this can be a file type object as well or a string.
key_name – (optional extension) name of previously created keypair to inject into the instance.
availability_zone – Name of the availability zone for instance placement.
block_device_mapping – (optional extension) A dict of block device mappings for this server.
block_device_mapping_v2 – (optional extension) A list of block device mappings (dicts) for this server.
nics – An ordered list of nics (dicts) to be added to this server, with information about connected networks, fixed IPs, port etc. Beginning in microversion 2.37 this field is required and also supports a single string value of ‘auto’ or ‘none’. The ‘auto’ value means the Compute service will automatically allocate a network for the project if one is not available. This is the same behavior as not passing anything for nics before microversion 2.37. The ‘none’ value tells the Compute service to not allocate any networking for the server.
scheduler_hints – (optional extension) arbitrary key-value pairs specified by the client to help boot an instance
config_drive – (optional extension) a boolean value to enable config drive
disk_config – (optional extension) control how the disk is partitioned when the server is created. possible values are ‘AUTO’ or ‘MANUAL’.
admin_pass – (optional extension) add a user supplied admin password.
access_ip_v4 – (optional extension) add alternative access ip v4
access_ip_v6 – (optional extension) add alternative access ip v6
description – optional description of the server (allowed since microversion 2.19)
tags – A list of arbitrary strings to be added to the server as tags (allowed since microversion 2.52)
trusted_image_certificates – A list of trusted certificate IDs (allowed since microversion 2.63)
host – requested host to create servers (allowed since microversion 2.74)
hypervisor_hostname – requested hypervisor hostname to create servers (allowed since microversion 2.74)
hostname – requested hostname of server (allowed since microversion 2.90)
Snapshot a server.
server – The Server
(or its ID) to share onto.
image_name – Name to give the snapshot image
metadata – Metadata to give newly-created image entity
An instance of novaclient.base.StrWithMeta (The snapshot image’s UUID)
Delete (i.e. shut down and delete the image) this server.
server – The Server
(or its ID) to delete
An instance of novaclient.base.TupleWithMeta
Remove all tags from an instance.
Delete metadata from a server
server – The Server
to add metadata to
keys – A list of metadata keys to delete from the server
An instance of novaclient.base.TupleWithMeta
Remove single tag from an instance.
Retrieve server diagnostics.
server – The Server
(or its ID) for which
diagnostics to be returned
An instance of novaclient.base.TupleWithMeta
Evacuate a server instance.
server – The Server
(or its ID) to evacuate to.
host – Name of the target host.
password – string to set as password on the evacuated server.
An instance of novaclient.base.TupleWithMeta
Force delete the server.
server – The Server
(or its ID) to force delete
An instance of novaclient.base.TupleWithMeta
Get text console log output from Server.
server – The Server
(or its ID) whose console output
you would like to retrieve.
length – The number of tail loglines you would like to retrieve.
An instance of novaclient.base.StrWithMeta or novaclient.base.UnicodeWithMeta
Retrieve a console url of a server.
server – server to get console url for
console_type – type can be novnc/xvpvnc for protocol vnc; spice-html5 for protocol spice; rdp-html5 for protocol rdp; serial for protocol serial. webmks for protocol mks (since version 2.8).
Get a mks console for an instance
server – The Server
(or its ID) to get console for.
An instance of novaclient.base.DictWithMeta
Get admin password of an instance
Returns the admin password of an instance in the clear if private_key is provided, returns the ciphered password otherwise.
Requires that openssl is installed and in the path
server – The Server
(or its ID) for which the admin
password is to be returned
private_key – The private key to decrypt password (optional)
An instance of novaclient.base.StrWithMeta or novaclient.base.BytesWithMeta or novaclient.base.UnicodeWithMeta
Get a rdp console for an instance
server – The Server
(or its ID) to get console for.
console_type – Type of rdp console to get (‘rdp-html5’)
An instance of novaclient.base.DictWithMeta
Get a serial console for an instance
server – The Server
(or its ID) to get console for.
console_type – Type of serial console to get (‘serial’)
An instance of novaclient.base.DictWithMeta
Get a spice console for an instance
server – The Server
(or its ID) to get console for.
console_type – Type of spice console to get (‘spice-html5’)
An instance of novaclient.base.DictWithMeta
Get a vnc console for an instance
server – The Server
(or its ID) to get console for.
console_type – Type of vnc console to get (‘novnc’ or ‘xvpvnc’)
An instance of novaclient.base.DictWithMeta
Attach a network_interface to an instance.
server – The Server
(or its ID) to attach to.
port_id – The port to attach. The port_id and net_id parameters are mutually exclusive.
net_id – The ID of the network to attach.
fixed_ip – The fixed IP addresses. If the fixed_ip is specified, the net_id has to be specified at the same time.
tag – The tag.
Detach a network_interface from an instance.
server – The Server
(or its ID) to detach from.
port_id – The port to detach.
An instance of novaclient.base.TupleWithMeta
List attached network interfaces
server – The Server
(or its ID) to query.
Return IP Addresses associated with the server.
Often a cheaper call then getting all the details for a server.
server – The Server
(or its ID) for which
the IP adresses are to be returned
An instance of novaclient.base.DictWithMeta
Get a list of servers.
detailed – Whether to return detailed server info (optional).
search_opts – Search options to filter out servers which don’t match the search_opts (optional). The search opts format is a dictionary of key / value pairs that will be appended to the query string. For a complete list of keys see: https://docs.openstack.org/api-ref/compute/#list-servers
marker – Begin returning servers that appear later in the server list than that represented by this server id (optional).
limit – Maximum number of servers to return (optional). Note the API server has a configurable default limit. If no limit is specified here or limit is larger than default, the default limit will be used. If limit == -1, all servers will be returned.
sort_keys – List of sort keys
sort_dirs – List of sort directions
list of Server
Examples:
client.servers.list() - returns detailed list of servers
client.servers.list(search_opts={‘status’: ‘ERROR’}) - returns list of servers in error state.
client.servers.list(limit=10) - returns only 10 servers
List Security Group(s) of an instance
server – ID of the instance.
Migrates a running instance to a new machine.
server – instance id which comes from nova list.
host – destination host name.
block_migration – if True, do block_migration, can be set as ‘auto’
An instance of novaclient.base.TupleWithMeta
Lock the server.
server – The Server
(or its ID) to lock
reason – (Optional) The lock reason.
An instance of novaclient.base.TupleWithMeta
Migrate a server to a new host.
server – The Server
(or its ID).
host – (Optional) The target host.
An instance of novaclient.base.TupleWithMeta
Pause the server.
server – The Server
(or its ID) to pause
An instance of novaclient.base.TupleWithMeta
Reboot a server.
server – The Server
(or its ID) to share onto.
reboot_type – either REBOOT_SOFT
for a software-level
reboot, or REBOOT_HARD for a virtual power cycle hard reboot.
An instance of novaclient.base.TupleWithMeta
Rebuild – shut down and then re-image – a server.
server – The Server
(or its ID) to share onto.
image – The Image
(or its ID) to re-image with.
password – String to set as password on the rebuilt server.
disk_config – Partitioning mode to use on the rebuilt server. Valid values are ‘AUTO’ or ‘MANUAL’
preserve_ephemeral – If True, request that any ephemeral device be preserved when rebuilding the instance. Defaults to False.
name – Something to name the server.
meta – A dict of arbitrary key/value metadata to store for this server. Both keys and values must be <=255 characters.
files – A 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.
(deprecated starting with microversion 2.57)
description – Optional description of the server. If None is specified, the existing description will be unset. (starting from microversion 2.19)
key_name – Optional key pair name for rebuild operation. If None is specified, the existing key will be unset. (starting from microversion 2.54)
userdata – Optional user data to pass to be exposed by the metadata server; this can be a file type object as well or a string. If None is specified, the existing user_data is unset. (starting from microversion 2.57)
trusted_image_certificates – A list of trusted certificate IDs or None to unset/reset the servers trusted image certificates (starting from microversion 2.63)
hostname – Optional hostname to configure for the instance. If None is specified, the existing hostname will be unset. (starting from microversion 2.90)
Remove a Security Group to an instance
server – ID of the instance.
security_group – The name of security group to remove.
An instance of novaclient.base.TupleWithMeta
Rescue the server.
server – The Server
to rescue.
password – The admin password to be set in the rescue instance.
image – The Image
to rescue with.
An instance of novaclient.base.TupleWithMeta
Reset network of an instance.
server – The Server
for network is to be reset
An instance of novaclient.base.TupleWithMeta
Reset the state of an instance to active or error.
server – ID of the instance to reset the state of.
state – Desired state; either ‘active’ or ‘error’. Defaults to ‘error’.
An instance of novaclient.base.TupleWithMeta
Resize a server’s resources.
server – The Server
(or its ID) to share onto.
flavor – the Flavor
(or its ID) to resize to.
disk_config – partitioning mode to use on the rebuilt server. Valid values are ‘AUTO’ or ‘MANUAL’
An instance of novaclient.base.TupleWithMeta
Until a resize event is confirmed with confirm_resize()
, the old
server will be kept around and you’ll be able to roll back to the old
flavor quickly with revert_resize()
. All resizes are
automatically confirmed after 24 hours.
Restore soft-deleted server.
server – The Server
(or its ID) to restore
An instance of novaclient.base.TupleWithMeta
Resume the server.
server – The Server
(or its ID) to resume
An instance of novaclient.base.TupleWithMeta
Revert a previous resize, switching back to the old server.
server – The Server
(or its ID) to share onto.
An instance of novaclient.base.TupleWithMeta
Set a server’s metadata
:param server: The Server
to add metadata to
:param metadata: A dict of metadata to be added to the server
Updates an item of server metadata
:param server: The Server
to add metadata to
:param key: metadata key to update
:param value: string value
Set list of tags to an instance.
Shelve the server.
server – The Server
(or its ID) to shelve
An instance of novaclient.base.TupleWithMeta
Remove a shelved instance from the compute node.
server – The Server
(or its ID) to shelve offload
An instance of novaclient.base.TupleWithMeta
Start the server.
server – The Server
(or its ID) to start
An instance of novaclient.base.TupleWithMeta
Stop the server.
server – The Server
(or its ID) to stop
An instance of novaclient.base.TupleWithMeta
Suspend the server.
server – The Server
(or its ID) to suspend
An instance of novaclient.base.TupleWithMeta
Get list of tags from an instance.
Retrieve server topology.
server – The Server
(or its ID) for which
topology to be returned
An instance of novaclient.base.DictWithMeta
Trigger crash dump in an instance
Unlock the server.
server – The Server
(or its ID) to unlock
An instance of novaclient.base.TupleWithMeta
Unpause the server.
server – The Server
(or its ID) to unpause
An instance of novaclient.base.TupleWithMeta
Unrescue the server.
server – The Server
(or its ID) to unrescue
An instance of novaclient.base.TupleWithMeta
Unshelve the server.
availability_zone – If specified the instance will be unshelved to the availability_zone. If None is passed the instance defined availability_zone is unpin and the instance will be scheduled to any availability_zone (free scheduling). If not specified the instance will be unshelved to either its defined availability_zone or any availability_zone (free scheduling).
host – The specified host (Optional)
An instance of novaclient.base.TupleWithMeta
Update attributes of a server.
server – The Server
(or its ID) to update.
name – Update the server’s name.
description – Update the server’s description. If it equals to empty string(i.g. “”), the server description will be removed.
hostname – Update the server’s hostname as recorded by the metadata service. Note that a separate utility running on the guest will be necessary to reflect these changes in the guest itself.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.