3.53.1. Create server with scheduler hints

 
MethodURIDescription
POST/v2/{tenant_id}/servers​{?security_group,​user_data,​availability_zone}

Creates a server with scheduler hints that are passed directly to the scheduler.

Normal response codes: 200

 3.53.1.1. Request

This table shows the URI parameters for the create server with scheduler hints request:

NameTypeDescription

{tenant_id}

​String

The ID for the tenant or account in a multi-tenancy cloud.

This table shows the query parameters for the create server with scheduler hints request:

NameTypeDescription

security_group

​String

(Required)

The name of the security group. If blank, the server is created in the default security group.

user_data

​String

(Optional)

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

availability_zone

​String

(Optional)

The availability zone in which to launch the server.

 

Example 3.442. Create server with scheduler hints: JSON request

{
    "server": {
        "name": "new-server-test",
        "imageRef": "70a599e0-31e7-49b7-b260-868f441e862b",
        "flavorRef": "1"
    },
    "os:scheduler_hints": {
        "hypervisor": "xen",
        "near": "2b7c42eb-7736-4a0f-afab-f23969a35ada"
    }
}

 

Example 3.443. Create server with scheduler hints: XML request

<server
        xmlns="http://docs.openstack.org/compute/api/v1.1"
        xmlns:OS-SCH-HNT="http://docs.openstack.org/compute/ext/scheduler-hints/api/v2"
        name='new-server-test'
        imageRef='70a599e0-31e7-49b7-b260-868f441e862b'
        flavorRef='1'
>
        <OS-SCH-HNT:scheduler_hints>
                <hypervisor>xen</hypervisor>
                <near>eb999657-dd6b-464e-8713-95c532ac3b18</near>
        </OS-SCH-HNT:scheduler_hints>
</server>

This operation does not require a request body.

 3.53.1.2. Response

 

Example 3.444. Create server with scheduler hints: JSON response

{
    "server": {
        "adminPass": "yjzytFHb7XHc",
        "id": "f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45",
        "links": [
            {
                "href": "http://openstack.example.com/v2/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45",
                "rel": "bookmark"
            }
        ]
    }
}

 

Example 3.445. Create server with scheduler hints: XML response

<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="a14a9bf5-93b3-49e4-85f1-01d7cf2645b4" adminPass="Q6jfHPrnvB9X">
  <metadata/>
  <atom:link href="http://openstack.example.com/v2/openstack/servers/a14a9bf5-93b3-49e4-85f1-01d7cf2645b4" rel="self"/>
  <atom:link href="http://openstack.example.com/openstack/servers/a14a9bf5-93b3-49e4-85f1-01d7cf2645b4" rel="bookmark"/>
</server>

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...