Build virtual machine

Builds a new virtual machine based on the arguments provided to this endpoint. Virtual machines will be built in the background. This task will return an task object that will allow you to monitor the build process using the appropriate API action. This action only offers a small subset of the full functionality needed when provisioning virtual machines - see the `build_from_spec` action for a full advanced virtual machine creation method.

POST
https://api.katapult.io/core/v1/organizations/{organization}/virtual_machines/build

If successful, this endpoint will return a 201 Created status.

Scopes

One of the following scopes are required to use this endpoint.

Arguments

The following arguments are supported for this endpoint.

Name Type Default Value

organization Required

Organization Lookup None

zone

Zone Lookup None

data_center

Data Center Lookup None

package Required

Virtual Machine Package Lookup None

disk_template

Disk Template Lookup None

disk_template_options

KeyValue Array None

network

Network Lookup None

hostname

String None

annotations

Annotations to add to this virtual machine & its associated build.

KeyValue Array None

Potential Errors

The following errors may occur during this request.

Details HTTP status

data_center_not_found

No data center was found matching any of the criteria provided in the arguments

404 Not Found

disk_template_not_found

No disk template was found matching any of the criteria provided in the arguments

404 Not Found

location_required

A zone or a data_center argument must be provided

422 Unprocessable Entity

network_not_found

No network was found matching any of the criteria provided in the arguments

404 Not Found

organization_not_activated

An organization was found from the arguments provided but it wasn't activated yet

403 Forbidden

organization_not_found

No organization was found matching any of the criteria provided in the arguments

404 Not Found

organization_suspended

An organization was found from the arguments provided but it was suspended

403 Forbidden

package_not_found

No package was found matching any of the criteria provided in the arguments

404 Not Found

permission_denied

The authenticated identity is not permitted to perform this action

403 Forbidden

resource_creation_restricted

The organization chosen is not permitted to create resources

403 Forbidden

validation_error

A validation error occurred with the object that was being created/updated/deleted

422 Unprocessable Entity

zone_not_found

No zone was found matching any of the criteria provided in the arguments

404 Not Found

Returned Object

When the request is successful, you can expect an object matching the specification below to be returned.

{
    task: Task {
        id: String
        name: String
        status: TaskStatusEnum
    }
    build: VirtualMachineBuild {
        id: String
        state: VirtualMachineBuildStateEnum
    }
    virtual_machine_build: VirtualMachineBuild {
        id: String
        state: VirtualMachineBuildStateEnum
    }
    hostname: String
    annotations: [ KeyValue {
        key: String
        value: String?
    } ]
}