Questo contenuto non è disponibile nella lingua selezionata.
Chapter 15. Virtual Machines
15.1. Virtual Machine Elements
Copia collegamentoCollegamento copiato negli appunti!
		The 
vms collection provides information about virtual machines in a Red Hat Virtualization environment. An API user accesses this information through the rel="vms" 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 resource representation.
	
| Element | Type | Description | Properties | 
|---|---|---|---|
| link rel="applications" | relationship | A link to the applicationssub-collection for virtual machine resources, which shows the applications installed on the virtual machine. | |
| link rel="disks" | relationship | A link to the diskssub-collection for virtual machine resources. | |
| link rel="nics" | relationship | A link to the nicssub-collection for virtual machine resources. | |
| link rel="numanodes" | relationship | A link to the numanodessub-collection for virtual machine resources. | |
| link rel="cdroms" | relationship | A link to the cdromssub-collection for virtual machine resources. | |
| link rel="snapshots" | relationship | A link to the snapshotssub-collection for virtual machine resources. | |
| link rel="tags" | relationship | A link to the tagssub-collection for virtual machine resources. | |
| link rel="permissions" | relationship | A link to the permissionssub-collection for virtual machine permissions. | |
| link rel="statistics" | relationship | A link to the statisticssub-collection for virtual machine resources. |   | 
| link rel="reporteddevices" | 
						relationship
					 | 
						A link to the  reporteddevicessub-collection for virtual machine resources. | |
| link rel="watchdogs" | 
						relationship
					 | 
						A link to the  watchdogssub-collection for virtual machine resources. | |
| link rel="sessions" | 
						relationship
					 | 
						A link to the  sessionssub-collection for virtual machine resources. | |
| type | enumerated | The virtual machine type. A list of enumerated values are available in capabilities. |   | 
| status | See below | The virtual machine status. |   | 
| memory | integer | The amount of memory allocated to the guest in bytes. | |
| cpu | complex | 
						Defines CPU details for the virtual machine. The  topologysub-element sets number of logicalsocketsavailable to the guest and the number ofcoresper socket. The total cores available to the virtual machine equals the number of sockets multiplied by the cores per socket.
						The  cputunesub-element maps virtual CPUs to physical host CPUs using a series ofvcpupinelements. Eachvcpupinelements contains a virtual CPU attribute (vcpu) and an attribute to define which physical to use (cpuset). Set thecpusetto either a single CPU (cpuset="0"), multiple CPUs (cpuset="0,2"), a CPU range (cpuset="0-3") or a CPU range with exclusion (cpuset="0-3,^2").
						The  cpu_modesub-element defines how closely the virtual CPU relates to the host CPU. It has three values:customis the default if no mode is given,host_modelcopies the host CPU as best as libvirt can understand, andhost_passthroughpasses all aspects of the host to the guest, even those that libvirt does not recognize. However,host_passthroughwill prevent migration of that virtual machine. | |
| 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 the virtual machine is configured to boot. This option supports booting a Linux kernel directly rather than through the BIOS bootloader. | |
| osinitrd | string | A path to an initrd image to be used with the previously specified kernel. This option supports booting a Linux kernel directly rather than through the BIOS bootloader. | |
| oscmdline | string | A kernel command line parameter string to be used with the defined kernel. This option supports booting a Linux kernel directly rather than through the BIOS bootloader. | |
| high_availability | complex | Set enabledtotrueif the virtual machine should be automatically restarted if the virtual machine or its host crashes. Apriorityelement controls the order in which virtual machines 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.
						The  smartcard_enabledsub-element is a Boolean (trueorfalse) to specify if a Smartcard attached to a client is passed through to a virtual machine. The default isfalse. | |
| cluster id= | GUID | A reference to the virtual machine's host cluster. |   | 
| template id= | GUID | A reference to the template on which this virtual machine is based. |     | 
| domain id= | GUID | A reference to the virtual machine's domain. |   | 
| start_time | xsd:dateTimeformat:YYYY-MM-DDThh:mm:ss | The date and time at which this virtual machine was started. |   | 
| stop_time | xsd:dateTimeformat:YYYY-MM-DDThh:mm:ss | The date and time at which this virtual machine was stopped. |   | 
| creation_time | xsd:dateTimeformat:YYYY-MM-DDThh:mm:ss | The date and time at which this virtual machine was created. |   | 
| origin | One of rhev,ovirt,vmwareorxen | The system from which this virtual machine originated. |   | 
| stateless | Boolean: true or false | trueif the virtual machine is stateless. A stateless virtual machine contains a snapshot of its disk image taken at boot and deleted at shutdown. This means state changes do not persist after a reboot. | |
| delete_protected | Boolean: true or false | If set to true, the virtual machine cannot be deleted. | |
| sso | string | A reference to the method of single sign-on for the virtual machine. Includes a methodelement with anipattribute. | |
| 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. Use multiplehostelements to specify a subset of preferred hosts within a cluster. | |
| memory_policy | complex | Sets the memory policy for virtual machines. Defines the minimum amount of guaranteedmemory on a host in order for the virtual machine to run. | |
| quota id= | GUID | Sets a quota for the virtual machine. | |
| 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. | |
| usb | complex | Defines the USB policy for a virtual machine. 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.
						 | |
| migration_downtime | integer | Represents the maximum number of milliseconds the virtual machine can be down during live migration. A value of 0 means that the VDSM default will be used. | |
| cpu_profile id= | GUID | A reference to the virtual machine's cpu profile. | |
| next_run_configuration | Boolean: true or false | trueif changes to the virtual machine's configuration will be applied when the virtual machine is next restarted. | |
| numa_tune_mode | string | Reference to the mode of memory allocation ( interleave,strict, orpreferred) of the host NUMA node. | |
| guest_info | complex | A reference to the guest client information. Includes an ipelement with anaddress=attribute. |   | 
| vmpool | complex | A reference to the virtual machine pool. This element only appears for virtual machines part of a pool. |   | 
| timezone | tz database format: Area/Location | The Sysprep timezone setting for a Windows virtual machine. | |
| domain | complex | The Sysprep domain setting for a Windows virtual machine. Requires a namefrom thedomainscollection. | |
| initialization | complex | 
						Defines a list of values applied to the virtual machine on boot using Cloud-Init for Linux-based virtual machines, or Sysprep for Windows-based virtual machines.
					 
 
 | |
| payloads | complex | 
						Defines a set of  payloadelements to deliver content to a virtual machine upon boot. Eachpayloadrequires atypeattribute, eithercdromorfloppy, and a set offileelements. Within eachfileelement is anameelement that specifies the name and location of the file, and acontentelement that defines the content to deliver to the file.
						The  payloadselement is used by thecloud-initfeature. Whencloud-initis used to configure a virtual machine, a payload is automatically created with thetypeattribute set tocd-romand twofilesub-elements,openstack/latest/meta_data.jsonandopenstack/latest/user_data, which pass configuration parameters to the virtual machine. | 
		The 
status contains one of the following enumerative values: unassigned, down, up, powering_up, powered_down, paused, migrating_from, migrating_to, unknown, not_responding, wait_for_launch, reboot_in_progress, saving_state, restoring_state, suspended, image_illegal, image_locked or powering_down. These states are listed in vm_states under capabilities.