Cosmic Admin API Reference
createTemplate
Creates a template of a virtual machine. The virtual machine must be in a STOPPED state. A template created from this command is automatically designated as a private template visible to the account that created it.
Request parameters
Parameter Name | Description | Required |
displaytext | the display text of the template. This is usually used for display purposes. | true |
name | the name of the template | true |
bits | 32 or 64 bit | false |
cpuflags | Optionally specify CPU flags to pass to VM | false |
details | Template details in key/value pairs using format details[i].keyname=keyvalue. Example: details[0].hypervisortoolsversion=xenserver61 | false |
hypervisor | the target hypervisor for the template | false |
isdynamicallyscalable | true if template contains XS tools inorder to support dynamic scaling of VM cpu/memory | false |
isfeatured | true if this template is a featured template, false otherwise | false |
ispublic | true if this template is a public template, false otherwise | false |
maclearning | Set mag learning boolean, defaults to false | false |
maintenancepolicy | Maintenance policy for this template, either LiveMigrate or ShutdownAndStart. | false |
manufacturerstring | Manufacturer String to put in hardware info, defaults to 'Mission Critical Cloud' | false |
optimisefor | Optimise for 'Windows' or 'Generic' | false |
ostypeid | the ID of the OS Type that best represents the OS of this template. | false |
passwordenabled | true if the template supports the password reset feature; default is false | false |
projectid | create template for the project | false |
snapshotid | the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in | false |
templatetag | the tag for this template. | false |
url | false | |
virtualmachineid | DEPRECATED SINCE 5.1.0: Optional, VM ID. If this presents, it is going to create a baremetal template for VM this ID refers to. This is only for VM whose hypervisor type is BareMetal | false |
volumeid | the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in | false |
Response Tags
Response Name | Description |
id | the template ID |
account | the account name to which the template belongs |
accountid | the account id to which the template belongs |
bootable | true if the ISO is bootable, false otherwise |
checksum | checksum of the template |
cpuflags | Any CPU flags to pass to VM |
created | the date this template was created |
crossZones | true if the template is managed across all Zones, false otherwise |
details | additional key/value details tied with template |
displaytext | the template display text |
domain | the name of the domain to which the template belongs |
domainid | the ID of the domain to which the template belongs |
format | the format of the template. |
hostid | the ID of the secondary storage host for the template |
hostname | the name of the secondary storage host for the template |
hypervisor | the hypervisor on which the template runs |
isdynamicallyscalable | true if template contains XS tools inorder to support dynamic scaling of VM cpu/memory |
isextractable | true if the template is extractable, false otherwise |
isfeatured | true if this template is a featured template, false otherwise |
ispublic | true if this template is a public template, false otherwise |
isready | true if the template is ready to be deployed from, false otherwise. |
isremotegatewaytemplate | true if the template is allowed to take the network gateway ip, false otherwise |
maclearning | Enable MAC learning true or false |
maintenancepolicy | The maintenance policy for the VM |
manufacturerstring | Manufacturer string in hardware |
name | the template name |
optimisefor | Optimise for Generic of Windows VMs |
ostypeid | the ID of the OS type for this template. |
ostypename | the name of the OS type for this template. |
passwordenabled | true if the reset password feature is enabled, false otherwise |
project | the project name of the template |
projectid | the project id of the template |
removed | the date this template was removed |
size | the size of the template |
sourcetemplateid | the template ID of the parent template if present |
sshkeyenabled | true if template is sshkey enabled, false otherwise |
status | the status of the template |
templatetag | the tag of this template |
templatetype | the type of the template |
url | The URL where the templates originally was downloaded from |
zoneid | the ID of the zone for this template |
zonename | the name of the zone for this template |
tags(*) | the list of resource tags associated with tempate |
account | the account associated with the tag |
customer | customer associated with the tag |
domain | the domain associated with the tag |
domainid | the ID of the domain associated with the tag |
key | tag key name |
project | the project name where tag belongs to |
projectid | the project id the tag belongs to |
resourceid | id of the resource |
resourcetype | resource type |
value | tag value |
jobid | the ID of the latest async job acting on this object |
jobstatus | the current status of the latest async job acting on this object |