Reservation host APIs
Reservation host APIs enable reservation of hypervisor host operations.
Adding hosts to the default reservation group
- At the time of registration.
- When changing the host group post registration.
Adding hosts at the time of registration
Method | URI | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:8774/v2.1/{tenant_id}/os-hosts |
Compute API that is used to add hypervisor to the reservation host group. |
- Normal response code: OK (200)
- Error response codes: Bad Request (400), Server Error (500)
Name | Style | Type | Description |
---|---|---|---|
access_ip | body | string | IP address of the NovaLink host. |
user_id | body | string | User ID that is configured for the NovaLink host. |
host_type | body | string | Specifies the type of the hypervisor, which is generally
“powervm” . |
asynchronous | body | string | Specifies if the registration configuration must be handled as a separate thread. The default value is "True". |
host_display_name | body | string | Displays the name of the host that must be configured for the host. |
password | body | string | Password to connect to the NovaLink host. |
force_unmanage | body | string | Specifies where to unmanage the host from a previous PowerVC before adding it to the current PowerVC. |
auto_add_host_key | body | string | Verifies the host key before adding the host toPowerVC. |
force_switch | body | string | Verifies if the host is managed by HMC or NovaLink. |
host_group | body | string | Specifies the host group to which the host must be added post registration. This is an optional parameter. |
Example of request body
{
"host": {
"registration": {
"access_ip": "<IP>",
"user_id": "<USER_ID>",
"host_type": "powervm",
"asynchronous": "True",
"host_display_name": "<NAME>",
"password": "<PASSWORD>",
"force_unmanage": "False",
"auto_add_host_key": "True",
"force_switch": "False",
"host_group": "Default Reservation Group" [optional]
}
}
}
For detailed response body examples, see the Compute API section.
Adding hosts to the default reservation group post registration
The table lists API options for adding hosts to the default reservation group post registration.
Method | URI | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:9450/v1/os-hosts |
Adds hosts to the default reservation group post registration. |
- Normal response code: OK (201)
- Error response codes: Bad Request (400), Forbidden (403), Not Found (404), Unauthorized (401), Conflict (409)
Request parameters
Name | Style | Type | Description |
---|---|---|---|
hypervisor_hostname | body | string | Specifies the hypervisor machine type machine serial (MTMS) name that must be added to the Blazar reservation host group. |
{
"hypervisor_hostname": "<HOST_MTMS_NAME>"
}
Retrieving the list of all hypervisor hosts from the reservation group
This API fetches the list of all hypervisor hosts (reservation candidates) from the default reservation host group that are not yet reserved and are available for reservation. This API does not take any request body. If the conf option to return the host that is in standby mode is enabled as a reservation candidate by the Ops team, then the response includes host details as well.
Method | URI | Description |
---|---|---|
GET | https://<<powervc_ip/hostname>>:9450/v1/os-hosts |
Retrieves the list of all hypervisor hosts from the reservation host group. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Retrieving the detailed view of all hypervisor hosts from the reservation host list
This operation fetches a detailed list of attributes that are related to hypervisors from the reservation host group that are not yet reserved. This API does not take any request body.
Method | URI | Description |
---|---|---|
GET | https://<<powervc_ip/hostname>>:9450/v1/os-hosts/<HYPERVISOR_ID(or)MTMS/ID/UUID> |
Provides a detailed view of all attributes that are associated with a host in the reservation host group. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Updating user_hostname for hypervisor in the reservation host group
This operation updates the user_hostname for the hypervisor in the reservation host group. This API takes the user_hostname in the request body and returns the updated hypervisor details from the reservation host group.
Method | URI | Description |
---|---|---|
PUT | https://<<powervc_ip/hostname>>:9450/v1/os-hosts/<HYPERVISOR_ID> |
Updates the user_hostname for the hypervisor. |
- Normal response code: OK (201)
- Error response codes: Bad Request (400), Forbidden (403), Not Found (404), Unauthorized (401), Conflict (409)
Name | Style | Type | Description |
---|---|---|---|
user_hostname | body | string | Specifies the user_hostname that must be updated for the hypervisor. |
{
"user_hostname": "<USER_SPECIFIED_NAME>"
}
Removing hypervisor from the reservation host group
The operation removes the hypervisor host from the reservation host group. This API neither takes a request body nor returns a response body.
Method | URI | Description |
---|---|---|
DELETE | https://<<powervc_ip/hostname>>:9450/v1/os-hosts/<HYPERVISOR_ID> |
Removes the host from the reservation host group. |
- Normal response code: No Content (204)
- Error response codes: Unauthorized (401), Not Found (404), Forbidden (403)
Host reservation APIs
The host reservation APIs are associated with the CRUD operations on reservation of hypervisor host.
Host reservation API options
Method | URI | Description |
---|---|---|
POST | :9450/v1/leases |
Creates the lease. |
GET | :9450/v1/leases |
Retrieves the list of all leases. |
GET | :9450/v1/leases/{lease_id} |
Retrieves specific lease details. |
PUT | :9450/v1/leases/{lease_id} |
Updates the lease name and expiration_date. |
GET | :9450/v1/reservations |
Retrieves the list of all reservations. |
GET | :9450/v1/reservations?resource_type=host |
Retrieves the list of all host reservations. |
GET | :9450/v1/reservations/{reservation_id} |
Retrieves specific reservation details. |
PUT | :9450/v1/reservations/{reservation_id} |
Adds or removes hosts to or from the reservation. |
DELETE | :9450/v1/leases/{lease_id} |
Deletes the lease. |
Creating a lease with reservation of reservation hosts
This operation creates a lease with reservation of the dedicated hosts.
Method | URL | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:9450/v1/leases |
Creates the lease. |
- Normal response code: OK (201)
- Error response codes: Bad Request (400), Unauthorized (401), Forbidden (403), Conflict (409), Internal Server Error (500)
Request parameters
The table lists the parameters in the request for create reservation.
Name | Style | Type | Description |
---|---|---|---|
name |
body |
string |
The name of the lease. |
reservations | body | array |
A list of reservation objects. |
resource_type |
body |
string |
For dedicated host reservation, this parameter must
be"physical:host" |
hosts | body | array | Specifies the list of host machine type machine serial (MTMS) name to be reserved as part of this lease request. Optionally, user_hostname can also be mentioned to set the display_name for the host. |
{
"name": "Test_Lease",
"reservations":
[
{
"resource_type": "physical:host",
"hosts":
[
{
"host":"828642A_21C1B7V",
"user_hostname": "P10_B7V"
}
]
}
]
}
{
"name": "Test_Lease",
"reservations":
[
{
"resource_type": "physical:host",
"hosts":
[
{ "user_display_name": "<<host_display_name>>",(optional)
"host": "828642A_21C1B7V"
},
{ "user_display_name": "<<host_display_name>>",
"host": "828642A_21C1B5V"
}
]
}
]
}
Retrieving the list of all leases
This operation fetches a list of all leases that is created within the user context project. This API does not take any request body. The response body contains details of leases.
Method | URI | Description |
---|---|---|
GET | https://<<powervc_ip/hostname>>:9450/v1/leases |
Retrieves the list of all leases. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Retrieving specific lease details
This operation fetches specific lease details created within the user context project. This API does not take any request body. The response body contains details of lease.
Method | URI | Description |
---|---|---|
GET | https://<<powervc_ip/hostname>>:9450/v1/leases/<LEASE_ID> |
Retrieves specific lease details. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Retrieving the list of all reservations
This operation fetches a list of all reservations created within the user context project. This API does not take any request body. The response body contains all reservation details. This API can be used to fetch the reservation host groups associated with the particular user. This API also returns the list of host(s) that are part of the reservation host group.
Method | URI | Description |
---|---|---|
GET | /<HYPERVISOR_ID(or)MTMS> |
Fetches the details about the host(s) resource. |
GET | https://<<powervc_ip/hostname>>:8774/v2.1/<PROJECT_ID>/shared-proc-pools?host=<HOST_MTMS> |
Fetches the details about the SPPs associated with a host. |
GET | https://<<powervc_ip/hostname>>:9450/v1/reservations |
Retrieves the list of all reservations. |
GET | https://<<powervc_ip/hostname>>:9450/v1/reservations?resource_type=physical:host |
Retrieves the list of all dedicated host related reservations. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Retrieving specific reservation details
This operation fetches a specific reservation detail that is created within user context project. This API does not take any request body. The response body contains reservation details.
Method | URI | Description |
---|---|---|
GET | https://<<powervc_ip/hostname>>:9450/v1/reservations/<UUID> |
Retrieves specific reservation details. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Updating the lease
This operation allows the user to update the name and expiration of lease.
Method | URI | Description |
---|---|---|
PUT | https://<<powervc_ip/hostname>>:9450/v1/leases/<LEASE_ID> |
Updates the lease. |
- Normal response code: Accepted (200)
- Error response codes: Bad Request (400), Unauthorized (401), Forbidden (403), Conflict (409), Internal Server Error (500)
Name | Style | Type | Description |
---|---|---|---|
name | body | string | The name of the lease. |
end_date | body | string | The lease expiration date, which is only for the Ops team. |
{
"name": "New_Lease",
"end_date": "2023-11-25 12:00
}
Adding or removing the host to or from the reservation
This operation allows users to add or remove specific host to or from reservation created within the user context project. The response body contains the reservation details.
Method | URI | Description |
---|---|---|
PUT | https://<<powervc_ip/hostname>>:9450/v1/reservations/
<reservation_id> |
Adding or removing the host to or from reservation. |
- Normal response code: OK (200)
- Error response codes: Unauthorized (401), Forbidden (403)
Name | Style | Type | Description |
---|---|---|---|
add_hosts | body | array | The list of hypervisor host names that must be added to an existing reservation. Optionally, you can also specify the user_hostname. |
remove_hosts | body | array | The list of hypervisor host names that must be removed from a reservation. |
{
"add_hosts":
[
{
"host": "824742L_2120FEA",
"user_hostname": "P10-FEA"
}
]
}
{
"remove_hosts":
[
"824742L_2120FEA"
]
}
- Hosts will be deleted from the reservation only if there are no virtual machines (VMs) that are deployed on the host. VMs, if any must be deleted or cleaned up. If you want to retain the VMs, make sure that you work with the Support team to migrate the VMs based on the business need, and then retry the operation.
- After the host is removed from the current reservation, the host moves back to the default reservation group.
- Only an admin user of the project can add or remove hosts from a dedicated host group.
Deleting a lease
The operation removes a hypervisor host from the list of reservation host list. This API neither takes a request body nor returns a response body.
Method | URI | Description |
---|---|---|
DELETE | https://<<powervc_ip/hostname>>:9450/v1/leases/
<lease_id> |
Deletes a lease. |
- Delete the entire lease or reservation.
- Delete the reservation but keep the VMs intact.
{
"task_id": "d319d674-a567-48c7-ac38-19adaee2a3d5"
}
The response body contains a task id that is associated with the delete lease call.
To obtain the status of the delete request status, you can use a GET call by using the task id.
Method | URI | Description |
---|---|---|
GET | https://<<powervc_ip/hostname>>:9450/v1/leases/
progress?task_id=d319d674-a567-48c7-ac38-19adaee2a3d5 |
Fetches the status of the delete request status by using the task id. |
Deploying VMs to the reservation host group
This operation deploys VMs to the dedicated host group.
Method | URI | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:8774/v2.1/{tenant_id}/servers |
Creates servers. |
- Normal response code: Accepted (202)
- Error response codes: Bad Request (400), Forbidden (403), Not Found (404), Unauthorized (401), Conflict (409), Item Not Found (404)
{
"server": {
"name": "Test",
"description": "",
"imageRef": "a2c5782b-2c5a-42b0-a780-d41ecf8010c2",
"availability_zone": "8a209e43-56bb-4676-9450-dc4c214426c1",
"block_device_mapping_v2": [],
"flavor": {
"ram": 4096,
"vcpus": 1,
"disk": 30,
"extra_specs": {
"powervm:availability_priority": "127",
"powervm:dedicated_proc": "false",
"powervm:max_mem": "6144",
"powervm:max_proc_units": "1",
"powervm:max_vcpu": "1",
"powervm:min_mem": "2048",
"powervm:min_proc_units": "0.1",
"powervm:min_vcpu": "1",
"powervm:proc_units": "0.5",
"powervm:shared_weight": "128",
"powervm:uncapped": "true",
"powervm:storage_connectivity_group":
"5b31ea7b-fd5f-4ff7-8e02-33d06a8b02ed"
}
},
"max_count": 1,
"config_drive": true,
"networks": [
{
"uuid": "125c04b7-0cea-45aa-b208-6cc29bde0601"
}
],
"metadata": {
"primary_network": "125c04b7-0cea-45aa-b208-6cc29bde0601"
}
},
"os:scheduler_hints": {
"group": "17e31978-f78d-4be1-b0f3-96d3643a3b1d",
"reservation": "8a209e43-56bb-4676-9450-dc4c214426c1"
}
}
Sharing reservations with a secondary project
This operation creates a new lease in the secondary project by mapping the reservation from the parent project.
Method | URI | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:9450/v1/leases/<parent_lease_id>/action |
Creates a lease. |
- Normal response code: OK (201)
- Error response codes: Bad Request (400), Unauthorized (401), Forbidden (403), Conflict (409), Internal Server Error (500)
Name | Style | Type | Description |
---|---|---|---|
name |
body | string | The name of the lease. If the name of the lease is not provided, the shared lease uses the name of primary lease. This is an optional parameter. |
project_id |
body | array | Specifies the UUID of project with whom the lease can be shared with. This is a mandatory parameter. |
reservation_ids |
body | array | List of reservation_ids that can be shared with the project for partial sharing of reservation. This is an optional parameter. |
{
"share":
[
{
"name": "my_share_lease_1”,
"project_id": "4b9c3a64df7944338d46cda09164a902",
},
{
"name": "my_share_lease_2”,
"project_id": "67afe757c3041e292b82058579f6d8f",
}
],
}
Retrieving the list of all shared leases for a specific lease from the primary project
This operation returns the list of leases shared with other projects for a specific lease.
Method | URI | Description |
---|---|---|
GET | /v1/leases/{lease_id} |
Retrieves lease details and shared leases for specific lease. The response
property containsShared = true/false value. |
GET | /v1/leases/{lease_id}?include_shared=true |
Lists a detailed view of the shared lease with the lease_id. |
GET | /v1/leases?shared=true |
Returns all the shared leases. |
- Normal response code: OK (200)
- Error response codes: Bad Request (400), Unauthorized (401)
GET https://<powervc_ip>:9450/v1/leases/75de2b9b-8ccb-472b-
b450-311de53f2e73?include_shared=true
GET https://<powervc_ip>:9450/v1/leases?shared=true
After the lease is shared with the secondary project, the secondary project cannot share the shared lease with another project, and the sharing fails.
{
"error_code": 500,
"error_message": "The requested lease cannot be shared.",
"error_name": 500
}
Removing or unsharing the shared lease
This operation removes the lease that is shared with other projects.
Method | URI | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:9450/v1/leases/<lease_id>/action |
Deletes the shared lease. |
- Normal response code: Accepted (202)
- Error response codes: Bad Request (400), Unauthorized (401), Forbidden (403), Conflict (409), Internal Server Error (500)
Name | Style | Type | Description |
---|---|---|---|
project_id |
body | array | Specifies the UUID of the project with whom the lease can be shared with. |
force |
body | string | Specifies whether to unshare a lease forcefully. This is an optional parameter. |
{
"unshare":
{
"project_id": "a53746a4632140ccb9607359ae776c50",
"force": "true",
}
}
Planned and unplanned maintenance in a dedicated host group
A new maintenance_host_in_reservation_host_group
flag is added in the response
of the GET os-hypervisor
call.
For the newly added host, project admins can set the
maintenance_host_in_reservation_host_group
flag in
ibm_compute_node_metadata
as False by using this API.
Method | URI | Description |
---|---|---|
POST | https://<<powervc_ip/hostname>>:8774/v2.1/{tenant_id}/os-hosts/{host-mtms}/update-registration |
An existing nova API that is used to update host registration in PowerVC. |
{"maintenance_host_in_reservation_host_group": "false"}