xe command reference
This section groups commands by the objects they apply to. The objects are listed in alphabetical order.
This list is not exhaustive.
You can list all xe commands with xe help --all. To get help for a specific command, use xe help <command>.
To return only specifics values in response of <OBJECT>-list commands, use the optional parameter params=param1,param2,... (or params=all).
Appliance commands
Commands for creating and modifying VM appliances (also known as vApps).
Appliance parameters
Appliance commands have the following parameters:
| Parameter Name | Description | Type |
|---|---|---|
uuid | The appliance uuid | Required |
name-description | The appliance description | Optional |
paused | Optional | |
force | Force shutdown | Optional |
appliance-assert-can-be-recovered
appliance-assert-can-be-recovered uuid=appliance-uuid database:vdi-uuid=vdi-uuid
Tests whether storage is available to recover this VM appliance/vApp.
appliance-create
appliance-create name-label=name-label [name-description=name-description]
Creates an appliance/vApp. For example:
xe appliance-create name-label=my_appliance
Add VMs to the appliance:
xe vm-param-set uuid=VM-UUID appliance=appliance-uuid
appliance-destroy
appliance-destroy uuid=appliance-uuid
Destroys an appliance/vApp. For example:
xe appliance-destroy uuid=appliance-uuid
appliance-recover
appliance-recover uuid=appliance-uuid database:vdi-uuid=vdi-uuid [paused=true|false]
Recover a VM appliance/vApp from the database contained in the supplied VDI.
appliance-shutdown
appliance-shutdown uuid=appliance-uuid [force=true|false]
Shuts down all VMs in an appliance/vApp. For example:
xe appliance-shutdown uuid=appliance-uuid
appliance-start
appliance-start uuid=appliance-uuid [paused=true|false]
Starts an appliance/vApp. For example:
xe appliance-start uuid=appliance-uuid
Audit commands
Audit commands download all of the available records of the RBAC audit file in the pool. If the optional parameter since is present, it downloads only the records from that specific point in time.
audit-log-get parameters
audit-log-get has the following parameters
| Parameter Name | Description | Type |
|---|---|---|
filename | Write the audit log of the pool to file name | Required |
since | Specific date/time point | Optional |
audit-log-get
audit-log-get [since=timestamp] filename=filename
For example, to obtain audit records of the pool since a precise millisecond timestamp, run the following command:
Run the following command:
xe audit-log-get since=2009-09-24T17:56:20.530Z filename=/tmp/auditlog-pool-actions.out
Bonding commands
Commands for working with network bonds, for resilience with physical interface failover. For more information, see the Networking section.
The bond object is a reference object which glues together master and member PIFs. The master PIF is the bonding interface which must be used as the overall PIF to refer to the bond. The member PIFs are a set of two or more physical interfaces that have been combined into the high-level bonded interface.
Bond parameters
Bonds have the following parameters:
| Parameter Name | Description | Type |
|---|---|---|
uuid | Unique identifier/object reference for the bond | Read only |
master | UUID for the master bond PIF | Read only |
members | Set of UUIDs for the underlying bonded PIFs | Read only |
bond-create
bond-create network-uuid=network_uuid pif-uuids=pif_uuid_1,pif_uuid_2,...
Create a bonded network interface on the network specified from a list of existing PIF objects. The command fails in any of the following cases:
- If PIFs are in another bond already
- If any member has a VLAN tag set
- If the referenced PIFs are not on the same XCP-ng server
- If fewer than 2 PIFs are supplied
bond-destroy
bond-destroy uuid=bond_uuid
Deletes a bonded interface specified by its UUID from a host.
bond-set-mode
bond-set-mode uuid=bond_uuid mode=bond_mode
Change the bond mode.
CD commands
Commands for working with physical CD/DVD drives on XCP-ng servers.
CD parameters
CDs have the following parameters:
| Parameter Name | Description | Type |
|---|---|---|
uuid | Unique identifier/object reference for the CD | Read only |
name-label | Name for the CD | Read/write |
name-description | Description text for the CD | Read/write |
allowed-operations | A list of the operations that can be performed on this CD | Read only set parameter |
current-operations | A list of the operations that are currently in progress on this CD | Read only set parameter |
sr-uuid | The unique identifier/object reference for the SR this CD is part of | Read only |
sr-name-label | The name for the SR this CD is part of | Read only |
vbd-uuids | A list of the unique identifiers for the VBDs on VMs that connect to this CD | Read only set parameter |
crashdump-uuids | Not used on CDs. Because crashdumps cannot be written to CDs | Read only set parameter |
virtual-size | Size of the CD as it appears to VMs (in bytes) | Read only |
physical-utilisation | Amount of physical space that the CD image takes up on the SR (in bytes) | Read only |
type | Set to User for CDs | Read only |
sharable | Whether or not the CD drive is shareable. Default is false. | Read only |
read-only | Whether the CD is read-only, if false, the device is writable. Always true for CDs. | Read only |
storage-lock | Value is true if this disk is locked at the storage level. | Read only |
parent | Reference to the parent disk, if this CD is part of a chain. | Read only |
missing | Value is true if SR scan operation reported this CD as not present on disk | Read only |
other-config | A list of key/value pairs that specify extra configuration parameters for the CD | Read/write map parameter |
location | The path on which the device is mounted | Read only |
managed | Value is true if the device is managed | Read only |
xenstore-data | Data to be inserted into the xenstore tree | Read only map parameter |
sm-config | Names and descriptions of storage manager device config keys | Read only map parameter |
is-a-snapshot | Value is true if this template is a CD snapshot | Read only |
snapshot_of | The UUID of the CD that this template is a snapshot of | Read only |
snapshots | The UUIDs of any snapshots that have been taken of this CD | Read only |
snapshot_time | The timestamp of the snapshot operation | Read only |
cd-list
cd-list [params=param1,param2,...] [parameter=parameter_value]
List the CDs and ISOs (CD image files) on the XCP-ng server or pool, filtering on the optional argument params.
If the optional argument params is used, the value of params is a string containing a list of parameters of this object that you want to display. Alternatively, you can use the keyword all to show all parameters. When params is not used, the returned list shows a default subset of all available parameters.
Optional arguments can be any number of the CD parameters listed at the beginning of this section.