Cosmic User 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 NameDescriptionRequired
displaytextthe display text of the template. This is usually used for display purposes.true
namethe name of the templatetrue
bits32 or 64 bitfalse
cpuflagsOptionally specify CPU flags to pass to VMfalse
detailsTemplate details in key/value pairs using format details[i].keyname=keyvalue. Example: details[0].hypervisortoolsversion=xenserver61false
hypervisorthe target hypervisor for the templatefalse
isdynamicallyscalabletrue if template contains XS tools inorder to support dynamic scaling of VM cpu/memoryfalse
isfeaturedtrue if this template is a featured template, false otherwisefalse
ispublictrue if this template is a public template, false otherwisefalse
maclearningSet mag learning boolean, defaults to falsefalse
maintenancepolicyMaintenance policy for this template, either LiveMigrate or ShutdownAndStart.false
manufacturerstringManufacturer String to put in hardware info, defaults to 'Mission Critical Cloud'false
optimiseforOptimise for 'Windows' or 'Generic'false
ostypeidthe ID of the OS Type that best represents the OS of this template.false
passwordenabledtrue if the template supports the password reset feature; default is falsefalse
projectidcreate template for the projectfalse
snapshotidthe ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed infalse
templatetagthe tag for this template.false
urlfalse
virtualmachineidDEPRECATED 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 BareMetalfalse
volumeidthe ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed infalse

Response Tags

Response NameDescription
idthe template ID
accountthe account name to which the template belongs
accountidthe account id to which the template belongs
bootabletrue if the ISO is bootable, false otherwise
checksumchecksum of the template
cpuflagsAny CPU flags to pass to VM
createdthe date this template was created
crossZonestrue if the template is managed across all Zones, false otherwise
detailsadditional key/value details tied with template
displaytextthe template display text
domainthe name of the domain to which the template belongs
domainidthe ID of the domain to which the template belongs
formatthe format of the template.
hostidthe ID of the secondary storage host for the template
hostnamethe name of the secondary storage host for the template
hypervisorthe hypervisor on which the template runs
isdynamicallyscalabletrue if template contains XS tools inorder to support dynamic scaling of VM cpu/memory
isextractabletrue if the template is extractable, false otherwise
isfeaturedtrue if this template is a featured template, false otherwise
ispublictrue if this template is a public template, false otherwise
isreadytrue if the template is ready to be deployed from, false otherwise.
isremotegatewaytemplatetrue if the template is allowed to take the network gateway ip, false otherwise
maclearningEnable MAC learning true or false
maintenancepolicyThe maintenance policy for the VM
manufacturerstringManufacturer string in hardware
namethe template name
optimiseforOptimise for Generic of Windows VMs
ostypeidthe ID of the OS type for this template.
ostypenamethe name of the OS type for this template.
passwordenabledtrue if the reset password feature is enabled, false otherwise
projectthe project name of the template
projectidthe project id of the template
removedthe date this template was removed
sizethe size of the template
sourcetemplateidthe template ID of the parent template if present
sshkeyenabledtrue if template is sshkey enabled, false otherwise
statusthe status of the template
templatetagthe tag of this template
templatetypethe type of the template
urlThe URL where the templates originally was downloaded from
zoneidthe ID of the zone for this template
zonenamethe name of the zone for this template
tags(*)the list of resource tags associated with tempate
accountthe account associated with the tag
customercustomer associated with the tag
domainthe domain associated with the tag
domainidthe ID of the domain associated with the tag
keytag key name
projectthe project name where tag belongs to
projectidthe project id the tag belongs to
resourceidid of the resource
resourcetyperesource type
valuetag value
jobidthe ID of the latest async job acting on this object
jobstatusthe current status of the latest async job acting on this object