Questo contenuto non è disponibile nella lingua selezionata.
Chapter 17. Templates
17.1. Virtual Machine Template Elements
Copia collegamentoCollegamento copiato negli appunti!
		The 
templates collection provides information about the virtual machine templates in a Red Hat Virtualization environment. An API user accesses this information through the rel="templates" link obtained from the entry point URI.
	
		Additional information can be retrieved for 
GET requests using the All-Content: true header.
	
		The following table shows specific elements contained in a virtual machine template resource representation.
	
| Element | Type | Description | Properties | 
|---|---|---|---|
| link rel="disks" | relationship | A link to the diskssub-collection for virtual machine template resources. |   | 
| link rel="nics" | relationship | A link to the nicssub-collection for virtual machine template resources. | |
| link rel="cdroms" | relationship | A link to the cdromssub-collection for virtual machine template resources. |   | 
| link rel="permissions" | relationship | A link to the permissionssub-collection for virtual machine template permissions. | |
| type | enumerated | The type of virtual machine the template provides. A list of enumerated values are available in capabilities. | |
| status | One of illegal,lockedorok | The template status. These states are listed in template_statesundercapabilities. |   | 
| memory | integer | The amount of memory allocated to the guest, in bytes. | |
| cpu | complex | The CPU topology(i.e. number ofsocketsandcores) available to the guest. | |
| ostype= | string, e.g. RHEL5orWindowsXP | The guest operating system type. | |
| osboot dev= | enumerated | A list of boot devices, described by a devattribute on abootelement. A list of enumerated values are available incapabilities. | |
| oskernel | string | A path to a kernel image which the template is configured to boot from. | |
| osinitrd | string | A path to an initrd image to be used with the kernel above. | |
| oscmdline | string | A kernel command line parameter string to be used with the kernel above. | |
| cluster id= | GUID | A reference to the template's host cluster. |   | 
| vm id= | GUID | A reference to the VM on which this template is based. |     | 
| domain id= | GUID | A reference to the template's domain. |   | 
| creation_time | xsd:dateTimeformat:YYYY-MM-DDThh:mm:ss | The date and time at which this template was created. |   | 
| origin | One of rhev,ovirt,vmwareorxen | The system from which this template originated. |   | 
| high_availability | complex | Set enabledtotrueif the VM should be automatically restarted if the host crashes. Apriorityelement controls the order in which VMs are re-started. | |
| display | complex | The display type(eithervncorspice), port, and the number ofmonitors. Theallow_reconnectBoolean value specifies if a client can reconnect to the machine via display. | |
| stateless | Boolean: true or false | A stateless template contains a snapshot of its disk image taken at boot and deleted at shutdown. This means state changes do not persist after a reboot. | |
| usb | complex | Defines the USB policy for a virtual machine template. Requires an enabledelement set to a Boolean value and atypeelement set to eithernativeorlegacy.Important 
							The Legacy USB option has been deprecated and will be removed in Red Hat Virtualization 4.1.
						 | |
| placement_policy | complex | Sets the placement policy for virtual machine migration. Requires a default host=and anaffinity(one ofmigratable,user_migratableorpinned). Leave thehostelement empty to set no preferred host. | |
| custom_properties | complex | A set of user-defined environment variable passed as parameters to custom scripts. Each custom_propertycontainsnameandvalueattributes. A list of enumerated values are available incapabilities. | |
| timezone | tz database format: Area/Location | The the Sysprep timezone setting for a Windows virtual machine template. | |
| domain | complex | The the Sysprep domain setting for a Windows virtual machine template. Requires a namefrom thedomainscollection. |