Supported OpenStack Compute (Nova) APIs
These OpenStack APIs are supported in PowerVC.
For usage instructions, see the OpenStack compute API documentation.
General APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/ |
Returns a detailed information about this specific version of the API. |
| GET | /v2.1/{tenant_id}/extensions |
Lists all available extensions. |
| GET | /v2.1/{tenant_id}/extensions/{alias} |
Gets details about a specific extension. Extensions enable the introduction of new features in the API without requiring a version change, and they allow the introduction of vendor-specific functions. |
Flavors APIs
Use flavors APIs to work with PowerVC compute templates. PowerVC uses the term compute template instead of flavor.
| Method | URI | Description |
|---|---|---|
| POST | /v2.1/{tenant_id}/flavors |
Creates a flavor. |
| GET | /v2.1/{tenant_id}/flavors |
Lists IDs, names, and links for available flavors. |
| GET | /v2.1/{tenant_id}/flavors/detail |
Lists all details for available flavors. |
| GET | /v2.1/{tenant_id}/flavors/{flavor_id} |
Lists details for the specified flavor. |
| DELETE | /v2.1/{tenant_id}/flavors/{flavor_id} |
Deletes a flavor. |
| GET | /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs |
Lists the extra-specs or keys for the specified flavor. |
| POST | /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs |
Creates extra-specs or keys for the specified flavor. |
| GET | /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs/{key_id} |
Gets the value of the specified key. |
| DELETE | /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs/{key_id} |
Delete a specified extra-spec by key. |
Host aggregates (host groups) APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/os-aggregates |
Lists all aggregates. |
| POST | /v2.1/{tenant_id}/os-aggregates |
Creates an aggregate. |
| DELETE | /v2.1/{tenant_id}/os-aggregates/{aggregate_id} |
Deletes an aggregate. |
| GET | /v2.1/{tenant_id}/os-aggregates/{aggregate_id} |
Gets details about a specified aggregate. |
| PUT | /v2.1/{tenant_id}/os-aggregates/{aggregate_id} |
Updates the name, and optionally the availability zone, for a specified aggregate. |
| PUT | /v2.1/{tenant_id}/os-aggregates/{aggregate_id} |
Sets and updates the DRO schedules for the specified aggregate. |
| POST | /v2.1/{tenant_id}/os-aggregates/{aggregate_id}/action |
Sets metadata for an aggregate. |
| POST | /v2.1/{tenant_id}/os-aggregates/{aggregate_id}/action |
Adds a host to an aggregate. |
| POST | /v2.1/{tenant_id}/os-aggregates/{aggregate_id}/action |
Removes a host from an aggregate. |
Hypervisors APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/os-hypervisors |
Lists hypervisor information per server that is obtained through the API that is specific to the hypervisor, such as libvirt or XenAPI. |
| GET | /v2.1/{tenant_id}/os-hypervisors/detail |
Lists details of the hypervisors that are managed by the OpenStack installation. |
| GET | /v2.1/{tenant_id}/os-hypervisors/{hypervisor_hostname} |
Gets detailed information for the specified hypervisor. The
following parameters are supported: include_cpu_utilization - Specifies whether to include the CPU utilization in the response. Possible values are True (default) and False. include_remote_restart_enabled - Specifies whether to include the value for Remote restart enabled in the response. Possible values are True (default) and False. include_memory_utilization - Specifies whether to include the current memory utilization of the host. Possible values are True (default) and False. Note: HMC currently does not support the memory utilization metric and reports
"0."
|
| GET | /v2.1/{tenant_id}/os-hypervisors/{hypervisor_hostname}/servers |
Retrieves a list of servers and virtual machines that are hosted by the specified hypervisor. |
|
GET |
v2.1/{tenant_id}/os-hypervisors/{hypervisor_hostname}?include_virtual_serial_numbers |
Gets detailed information for the specified hypervisor with virtual serial numbers (VSNs)
included. For the supported available parameter,
|
Image APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/images |
Lists all images. |
| GET | /v2.1/{tenant_id}/images/detail |
Lists all details for available images. |
| GET | /v2.1/{tenant_id}/images/{image_id} |
Lists details of the specified image. |
| DELETE | /v2.1/{tenant_id}/images/{image_id} |
Deletes the specified image. |
Interface APIs
| Method | URI | Description |
|---|---|---|
| POST | /v2/{tenant_id}/servers/{server_id}/os-interface |
Creates a port interface and uses it to attach the port to a server instance. If you pre-create a port, try to attach a virtual machine to it, and the attach fails, you must manually delete or reuse the port. |
| DELETE | /v2/{tenant_id}/servers/{server_id}/os-interface/{attachment_id} |
Detaches the specified port interface from the virtual machine and then deletes the port. |
Key Pair APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/os-keypairs |
Lists keypairs that are associated with the account. |
| POST | /v2.1/{tenant_id}/os-keypairs |
Generates or imports a keypair. |
| DELETE | /v2.1/{tenant_id}/os-keypairs/{keypair_name} |
Deletes a keypair. |
| GET | /v2.1/{tenant_id}/os-keypairs/{keypair_name} |
Shows a keypair that is associated with the account. |
Limits, quotas, and usage APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/limits |
Returns current limits for the account. |
| GET | /v2.1/{tenant_id}/os-quota-sets/{tenant_id} |
Shows quotas for a tenant. |
| PUT | /v2.1/{tenant_id}/os-quota-sets/{tenant_id} |
Update quotas for a tenant. |
| DELETE | /v2.1/{tenant_id}/os-quota-sets/{tenant_id}
|
Deletes quotas for a tenant. |
| GET | /v2.1/{tenant_id}/os-quota-sets/{tenant_id}/defaults |
Retrieves default quotas. |
| GET | /v2.1/{tenant_id}/os-quota-sets/{tenant_id}/detail |
Retrieves the details about the quotas. |
| GET | /v2.1/{tenant_id}/os-simple-tenant-usage |
Gets usage for all tenants. |
| GET | /v2.1/{tenant_id}/os-simple-tenant-usage/{tenant_id} |
Retrieves usage for a tenant. |
| GET | /v2.1/{tenant_id}/os-simple-tenant-usage/{tenant_id}/detail |
Retrieves details about quotas. |
Server groups APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/os-server-groups |
Lists server groups. |
| POST | /v2.1/{tenant_id}/os-server-groups |
Creates a server group. |
| GET | /v2.1/{tenant_id}/os-server-groups/{ServerGroup_id} |
Shows details for a specified server group. |
| DELETE | /v2.1/{tenant_id}/os-server-groups/{ServerGroup_id} |
Deletes a specified server group. |
Servers APIs
| Method | URI | Description |
|---|---|---|
| POST | /v2.1/{tenant_id}/servers |
Creates a new virtual machine. |
| POST | /v2.1/{tenant_id}/servers |
Creates a new virtual machine. Specify availability_zone
for targeting virtual machine deployment to host group identified by value of availability_zone in
the request body.
For more details, see Availability Zones. |
| GET | /v2.1/{tenant_id}/servers |
Lists IDs, names, and links for all servers. |
| GET | /v2.1/{tenant_id}/servers/detail |
Lists details for all servers. |
| GET | /v2.1/{tenant_id}/servers/{server_id} |
Lists details for the specified server. |
| DELETE | /v2.1/{tenant_id}/servers/{server_id} |
Deletes the specified server. |
| DELETE | /v2.1/{project_id}/servers/{server_id}/remote-consoles |
Closes the Virtual Network Computing (VNC) console session. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Creates an image that is based on the specified
server. Specify the createImage action in the request body. Prepare the server by
using the AE script and shutdown it down before you initiate the action.PowerVC captures the
volumes in the boot set, and maintains the boot_index order. To capture more volumes, specify them
in the metadata dictionary in the format
Use one property for each volume, rather than one property that contains a list of volumes. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Migrates a specified server to a new host without
restarting the specified server. Specify the os-migrateLive action in the request
body. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Stops a specified server if it is running and changes
status to STOPPED. Specify the os-stop action in the request
body. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Returns a specified server to ACTIVE
status if it was in the STOPPED status. Specify the os-start action in
the request body. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Restarts the specified server. Specify the
reboot action in the request body. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Resizes the specified server. Specify the
resize action in the request body. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Confirms a pending resize action. Specify the
confirmResize action in the request body. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Starts a virtual network computing (VNC)
session and retrieves the console URL. Specify the os-getVNCConsole action in the
request body. Specify "novnc" as the payload type.Only supported for NovaLink managed servers. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Locks the specified server. Specify the lock action in the
request body.Only supported for NovaLink managed servers. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Unlocks the specified server. Specify the unlock action
in the request body.Only supported for NovaLink managed servers. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Rebuilds the specified server. Specify the rebuild
action in the request body.Only supported for NovaLink managed servers. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Evacuates a server from a failed host to a
different one. Specify the evacuate action in the request body with the
onSharedStorage parameter set to True. PowerVC calls this function remote
restart.For a targeted evacuation, use the
For information about remote restart of all virtual machines on a host, see Remote restart all virtual machines from a failed host. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
Creates or attaches bulk volumes to a virtual machine.
Specify the bulkVolumeAttach action in the request body. For details, see Bulk attach and detach volume APIs.
|
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
When a user sets immediate parameter to
True, the virtual machine is shut down immediately without waiting for OS or other
process to shut down. |
| POST | /v2.1/{tenant_id}/servers/{server_id}/action |
When a user specifies the type as
DUMPRESTART in the request body, the VM can be restarted with core memory dump. For
example, {"reboot":{"type":"DUMPRESTART“}}. |
When multiple virtual machines are deployed, by default the OpenStack compute server API returns the UUID of the first VM in the list. To view UUID of all the servers as a part of the response, you must specify the micro version of the OpenStack compute server API.
For example, if Openstack-API-Version: compute 2.31 is passed as a header in the multiple virtual machines deploy request, the response includes the list of UUIDs of all the virtual machines that are deployed as a part of the request.
Optical device attachment and detachment of VM APIs
| Method | URI | Description |
|---|---|---|
| POST | /v2.1/<project_id>/servers/<instance_id>/action |
Attaches an optical device to a specific virtual machine instance and triggers related actions. |
| POST | /v2.1/<project_id>/servers/<instance_id>/action |
Detaches an optical device from a specific virtual machine instance. For
example, |
- Optical device attachment API
-
Depending on the specific platform or system that you work with, the response body might contain information about the success of the operation, error messages, or details about the attached optical device.
- Response codes
-
- Normal response code - OK (200)
- Request parameters
-
Table 12. Parameters in the request body for optical device attachment Name Style Type Description network_cfg
Body
Boolean
Indicates whether the network configuration is required (true or false). Currently, there is no false value for this parameter. This parameter is mandatory.
reboot_vm Body String Indicates whether the virtual machine must be powered on. The valid values are soft, hard, or an empty string. If no value is provided, the VM is not powered on. This parameter is optional.
remove_vopt Body Boolean Indicates whether the virtual optical media (vopt) is to be removed during the VM restart or during the next power-on operation. When theremove_voptis set to true and theCONF.powervm.remove_vopt_media_on_bootis enabled, the virtual optical media is removed based on the configured time. This parameter is optional.- If a restart (
reboot_vm) is requested, the vopt media removal is scheduled during the power-on operation with a time delay (CONF.powervm.remove_vopt_media_time) that can be configured. - If a restart (
reboot_vm) is not requested, a metadata flagremove_vopt_on_power_on=trueis set to remove the vopt during the next VM power-on operation.
- If a restart (
- Request body example
-
{ "optical_device_attach": { "network_cfg": true, "reboot_vm":"soft", "remove_vopt": true } }
- Optical device detachment API
-
- Response codes
-
- Response code - No Content (204)
- Request body example
-
{ "optical_device_detach": {} }
Server interface APIs
| Method | URI | Description |
|---|---|---|
| POST | /v2.1/{tenant_id}/servers/{server_id}/os-interface |
Creates a port interface and uses it to attach the port to a server instance. |
| DELETE | /v2.1/{tenant_id}/servers/{server_id}/os-interface/{attachment_id} |
Detaches the specified port interface from the virtual machine and then deletes the port. |
Server volume attachment APIs
| Method | URI | Description |
|---|---|---|
| POST | /v2.1/{tenant_id}/servers/{server_id}/os-volume_attachments |
Attaches a volume to the specified server. |
| GET | /v2.1/{tenant_id}/servers/{server_id}/os-volume_attachments |
Lists the volume attachments for the specified server. |
| GET | /v2.1/{tenant_id}/servers/{server_id}/os-volume_attachments/{attachment_id} |
Lists volume details for the specified volume attachment ID. |
| DELETE | /v2.1/{tenant_id}/servers/{server_id}/os-volume_attachments/{attachment_id} |
Deletes the specified volume attachment from the specified server. |
| PUT | /v2.1/{tenant_id}/servers/{server_id}/os-volume_attachments/{attachment_id} |
With a PowerVC extension to this API, you can specify whether or not the specified volume is erased when the corresponding virtual machine is erased. For details, see Update volume attachment. |
Availability zone APIs
| Method | URI | Description |
|---|---|---|
| GET | /v2.1/{tenant_id}/os-availability-zone |
Lists all availability zones. For more information, see Availability zones (os-availability-zone). |
| GET | /v2.1/{tenant_id}/os-availability-zone/detail |
Provides detailed availability zone information. |
Modify VM attributes after deployment
A new server action API has been added to modify the attributes of a virtual machine outside resize flow, where these updates do not involve any DLPAR operations.
Today, if any of the non-core/non-memory attributes needs to be modified for a virtual machine after it is deployed, customers will have to invoke the resize API to perform the operation. This new server action API alleviates the need for having to go through resize flow for modifying such attributes, in certain cases not having to shutdown the VM and change it dynamically. This is supported for virtual machines deployed on HMC and Novalink.
- Modify capped or uncapped processor mode of a virtual machine in shared mode.
- Dynamically change Simplified Remote Restart (SRR) capability.
- Modify the affinity score or action associated with a virtual machine.
The above attributes can be specified either in one single request to be updated on the virtual machine, or confine to a specific set of attributes as needed to be modified or updated on the virtual machine.
Capped and uncapped processor mode
This capability is applicable only to virtual machines configured in shared processor mode. This operation is only supported when the virtual machine is in power off state.
- Change the processor mode of a virtual machine in shared mode from capped to uncapped.
- Modify the shared weight of a virtual machine operating in uncapped mode.
- Change the processor mode of a virtual machine from uncapped to capped.
- Request parameters
-
Table 16. Parameters in the request body for modifying VM attributes after deployment Name Description powervm:uncapped
Value can be boolean or string where the accepted formats are -
true,TRUE,True,false,FALSE,False.Use
Trueto modify a VM to uncapped mode andFalseto modify to capped mode.powervm:shared_weight Shared weight of the VM in string format. The value ranges from 0 to 255.
The new server action API introduces the ability to dynamically modify the Simplified Remote Restart (SRR) capability of a virtual machine. This attribute can be updated when the virtual machine is either running or in shutoff state. However, toggling of this attribute when VM is active depends on the host capability to support dynamic modification of the SRR attribute.
- Request parameters
-
Table 17. Parameters in the request body for SRR Name Description powervm:srr_capability
Value can be boolean or string where the accepted formats are -
true,TRUE,True,false,FALSE,False.Use
Trueto enable SRR capability andFalseto disable SRR capability.
The new server action API introduces the ability to modify the affinity action/score of a virtual machine. These attributes can be updated when the virtual machine is in either the running or shutoff state.
- Request parameters
-
Table 18. Parameters in the request body for SAP attributes Name Description powervm:min_affinity_score
Value is an integer between 0 to 100 (inclusive). It is the minimum affinity score required by a virtual machine.
powervm:min_affinity_score_action
Value can be in one of [
none,warn,fail]. It defines the action when the minimum affinity score is not met.powervm:lpar_placement
The policy which defines the enforcement of the minimum affinity score for SAP workload. Values can be either 0, 2, 4 or 8.
- URL
-
https://<<powervc_ip/hostname>>:8774/v2.1/{tenant_id}/servers/<server_id>/actionMETHOD: POST
Codes- Normal response code: OK (202)
- Error response code:
- Bad Request (400)
- Unauthorized (401)
- Forbidden (403)
- Not Found (404)
- Server Error (500)
- For general troubleshooting, check the
nova-apiandnova-computelogs for any failure related to the operation. - If the update fails after the request is accepted, the virtual machine is moved to error state. You can reset the virtual machine to its original state using the reset option on the VM details page. After resolving the issue, you can retry the operation.
- While updating any of these attributes from UI, the Availability Priority of a virtual machine cannot be modified. This attribute is restricted from being updated at the same time.
Migration of VMs to a different host group API
- Live migration of VMs to a different host group API
-
Table 19. Live migration of VMs to a different host group API option Method URI Description POST /v2.1/{tenant_id}/servers/{server_id}/actionMigrates the specified server to a new host without restarting the server. Specify the os-migrateLiveaction in the request body.- Response codes
-
- Normal response code - Accepted (202)
- Error response code - Bad Request (400), Unauthorized (401), Forbidden (403) Not Found (404), Conflict (409)
- Response parameters
-
Table 20. Parameters in the request body for live migration of VMs to a different host group API Name Style Type Description os-migrateLive
Body
String
The action.
host Body String The host where the server is migrated. This parameter is mandatory if
ignore_azis True.block_migration Body Boolean Set to True to migrate local disks by using block migration. If the source or destination host uses shared storage and you set this value to True, the live migration fails. disk_over_commit Body Boolean Set to True to enable over commit when the destination host is checked for available disk space. Set to False to disable over commit. This setting impacts only the libvirt virtdriver.force Body Boolean Force a live migration by not verifying the provided destination host by the scheduler. This parameter is optional. ignore_az Body Boolean Set to True if the server must be migrated to a host that is not a member of the same host group as the source host.
- Cold migration of VMs to a different host group API
-
Table 21. Cold migration of VMs to a different host group API option Method URI Description POST /v2.1/{tenant_id}/servers/{server_id}/actionMigrates the specified server to a new host if the server is powered-off. Specify the migrateaction in the request body.- Response codes
-
- Normal response code - Accepted (202)
- Error response code - Bad Request (400), Unauthorized (401), Forbidden (403) Not Found (404), Conflict (409)
- Response parameters
-
Table 22. Parameters in the request body for cold migration of VMs to a different host group API Name Style Type Description migrate
Body
String
The action.
host Body String The host where the server is migrated. This parameter is mandatory if
ignore_azis True.ignore_az Body Boolean Set to True if the server must be migrated to a host that is not a member of the same host group as the source host.