libvirt_domain_get_info Extract information about a domain
&reftitle.description; Array libvirt_domain_get_info resource domain

Extract information about a domain. Note that if the connection used to get the domain is limited only a partial set of the information can be extracted.

&reftitle.parameters;

domain

  Domain resource of domain to get information for.

&reftitle.returnvalues;

&false; is returned on failure. On success associative array containing information is returned.

The array contains these values:

- maxMem - the maximum memory in KBytes allowed
- memory - the memory in KBytes used by the domain
- nrVirtCpu - the number of virtual CPUs for the domain
- cpuUsed - the CPU time used in seconds
- state - the running state (one of `VIR_DOMAIN_NOSTATE`, `VIR_DOMAIN_RUNNING`, `VIR_DOMAIN_BLOCKED`, `VIR_DOMAIN_PAUSED`, `VIR_DOMAIN_SHUTDOWN`, `VIR_DOMAIN_SHUTOFF` or `VIR_DOMAIN_CRASHED`)

&reftitle.examples;

`libvirt_domain_get_info` example

Example of getting domain info for domain named `test`.

    <?php

    	$dom=libvirt_domain_lookup_by_name($connection,"test");
    	$dominfo=libvirt_domain_get_info($dom);
    	print_r($dominfo);

    ?>

&example.outputs.similar;

    Array
    (
        [maxMem] => 1048576
        [memory] => 524288
        [state] => 1
        [nrVirtCpu] => 2
        [cpuUsed] => 98718.23
    )

&reftitle.seealso;

- `libvirt_domain_get_name`
- `libvirt_domain_get_uuid`
- `libvirt_domain_get_uuid_string`