Extract information about a domain

libvirt_domain_get_id
libvirt_domain_get_job_info
Libvirt Functions
PHP Manual

# libvirt_domain_get_info

(php-libvirt 0.1)

libvirt_domain_get_info — Extract information about a domain

### 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.

### Parameters

`domain`

  Domain resource of domain to get information for.

### Return Values

`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`)

### Examples

Example #1 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);
?>`

The above example will output something similar to:

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

### See Also

- libvirt_domain_get_name() - Get the public name for that domain
- libvirt_domain_get_uuid() - Get the UUID for a domain as binary string.
- libvirt_domain_get_uuid_string() - Get the UUID for a domain as string.

libvirt_domain_get_id
libvirt_domain_get_job_info
Libvirt Functions
PHP Manual