CloudCreateHosts

Create one or more hosts from a cloud given the host-type and size.

The cloud will match the host-type and size to one (or more) source(s) from the cloud in order to fill the entire order. Host types and sizes cannot be mixed in a single API call. All the hosts must be the same type/size. The method will fail if the cloud's sources cannot accomodate that many hosts of the given type/size.

Any user who is a member of a project that has been given permission to allocate from this cloud can create instances.

URL

/cubit_api/1/allocate_hosts_from_cloud

Authentication

This method requires authentication using an API key.

Parameters

alloc_hours ( zero or once )
Amount of time for which to allocate the host. The allocation limit is subject to the limit set by the project or cloud administrator.
Type: Float
alloc_minutes ( zero or once )
Similar to alloc_hours parameter, but in minutes. It is mutually exclusive with the alloc_hours option, neither of these options should be specified, or only one of these options should be specified. If alloc_hours or alloc_minutes is set to 0, or if alloc_hours and alloc_minutes is unset, the allocation time defaults to the longest possible time available in the project.
Type: Integer
cloud ( Required, once )
Name of Lab Management cloud to allocate instances from.
Type: String
count ( zero or once )
The number of identical instances to bring up. The instances will all be running the same profile and version. Must be an integer greater than 0. If unset, defaults to 1.
Type: Integer
descr ( zero or once )
Set the specified string as a description for the allocated hosts. This is useful if you wish to uniquely identify a group of hosts which have all been allocated to the same user at the same time for the same purpose.
Type: String
dont_delete ( zero or once )
By default, EC2 instances will automatically be deleted when they are deallocated. If dont_delete is set to True, the instances created will not be deleted when they are deallocated, and will instead revert back to the project pool.
Type: String
host_type ( Required, once )
The name of the host_type of machine to create. Must be one of the host-types supported by the cloud.
Type: String
profile ( Required, once )
Name of the profile to assign to the host. The profile must, of course, be a profile that is eligible to be built by the host-type/size you selected.
Type: String
project ( Required, once )
Name of Lab Management project to place hosts into. You must have permission to add hosts to this project: that is, you must either be a Project Admin or Delegated Host Management must be turned on in your project.
Type: String
revision ( zero or once )
Revision number of the profile you wish to assign to the host. Mutually exclusive with the version option, but at least one of the version or revision options must be specified.
Type: Integer
sig ( Required, once )
API authentication hash signature.
Type: String
size ( Required, once )
The name of the machine size to create. Must be one of the sizes supported by the given host_type.
Type: String
userid ( Required, once )
The login name of the user initiating the request.
Type: String
version ( zero or once )
Version number or tag name of the profile you wish to assign to the host. The special version tag HEAD always denotes the latest version of the profile at the moment of execution. Note that profile tags can move between versions: this is a useful feature, but you should be aware of it. Mutually exclusive with the revision option, but at least one of the version or revision options must be specified.
Type: String

Example Response

        
    Successful allocation of 10 instances:
    <?xml version='1.0'?>
    <cubit version='1'>
        <status>OK</status>
        <output>ec2-pending-1204832590-85</output>
        <output>ec2-pending-1204832595-09</output>
        <output>ec2-pending-1204832599-97</output>
        <output>ec2-pending-1204832611-49</output>
        <output>ec2-pending-1204832615-60</output>
        <output>ec2-pending-1204832620-29</output>
        <output>ec2-pending-1204832624-25</output>
        <output>ec2-pending-1204832628-46</output>
        <output>ec2-pending-1204832640-90</output>
        <output>ec2-pending-1204832645-60</output>
    </cubit>

    <?xml version='1.0'?>
    <cubit version='1'>
        <status>OK</status>
    </cubit>

    If the user lacks permission to create hosts in the project:
    <?xml version='1.0'?>
    <cubit version='1'>
        <error>You are not authorized to create hosts in this project.</error>
    </cubit>

    If the project does not have the permissions to allocate from the
    requested cloud:
    <?xml version='1.0'?>
    <cubit version='1'>
        <error>This project is not authorized to create hosts in this cloud.</error>
    </cubit>

    If the cloud does not have enough space on the sources to allocate that many hosts:
    <?xml version='1.0'?>
    <cubit version='1'>
        <error>This cloud does not have enough resources to create [n] hosts.</error>
    </cubit>
    

Response Codes