XenServer Cheatsheet
#
XenServer is a leading virtualization management platform optimized for server, desktop, and application virtualization. The XenServer CLI, known as xe
, allows administrators to manage their XenServer environments through command-line commands.
General Commands
#
Command/Option | Example | Description |
---|
xe help | xe help | Display general help for xe commands |
xe version | xe version | Show the XenServer version |
Session Management
#
Command/Option | Example | Description |
---|
xe session-login | xe session-login username=root password=password | Log in to a XenServer session |
xe session-logout | xe session-logout | Log out of the current session |
VM Management
#
Command/Option | Example | Description |
---|
xe vm-list | xe vm-list | List all virtual machines |
xe vm-start | xe vm-start vm=<vm_uuid> | Start a virtual machine |
xe vm-shutdown | xe vm-shutdown vm=<vm_uuid> | Shut down a virtual machine |
xe vm-reboot | xe vm-reboot vm=<vm_uuid> | Reboot a virtual machine |
xe vm-suspend | xe vm-suspend vm=<vm_uuid> | Suspend a virtual machine |
xe vm-resume | xe vm-resume vm=<vm_uuid> | Resume a suspended virtual machine |
xe vm-create | xe vm-create name-label="my-vm" template=<template_uuid> | Create a new virtual machine |
xe vm-destroy | xe vm-destroy vm=<vm_uuid> | Destroy a virtual machine |
Storage Management
#
Command/Option | Example | Description |
---|
xe sr-list | xe sr-list | List all storage repositories |
xe sr-create | xe sr-create name-label="my-sr" type=lvm device-config:device=/dev/sdb | Create a new storage repository |
xe sr-destroy | xe sr-destroy uuid=<sr_uuid> | Destroy a storage repository |
xe vdi-list | xe vdi-list sr-uuid=<sr_uuid> | List all VDIs in a storage repository |
xe vdi-create | xe vdi-create sr-uuid=<sr_uuid> name-label="my-vdi" virtual-size=10GiB | Create a new VDI in a storage repository |
xe vdi-destroy | xe vdi-destroy uuid=<vdi_uuid> | Destroy a VDI |
Network Management
#
Command/Option | Example | Description |
---|
xe network-list | xe network-list | List all networks |
xe network-create | xe network-create name-label="my-network" | Create a new network |
xe network-destroy | xe network-destroy uuid=<network_uuid> | Destroy a network |
xe vif-create | xe vif-create vm-uuid=<vm_uuid> network-uuid=<network_uuid> device=0 | Create a virtual network interface for a VM |
xe vif-destroy | xe vif-destroy uuid=<vif_uuid> | Destroy a virtual network interface |
Snapshot Management
#
Command/Option | Example | Description |
---|
xe vm-snapshot | xe vm-snapshot vm=<vm_uuid> new-name-label="my-snapshot" | Create a snapshot of a VM |
xe snapshot-list | xe snapshot-list | List all snapshots |
xe snapshot-revert | xe snapshot-revert snapshot-uuid=<snapshot_uuid> | Revert a VM to a snapshot |
xe snapshot-destroy | xe snapshot-destroy uuid=<snapshot_uuid> | Destroy a snapshot |
Host Management
#
Command/Option | Example | Description |
---|
xe host-list | xe host-list | List all hosts |
xe host-disable | xe host-disable uuid=<host_uuid> | Disable a host |
xe host-enable | xe host-enable uuid=<host_uuid> | Enable a host |
xe host-reboot | xe host-reboot uuid=<host_uuid> | Reboot a host |
xe host-shutdown | xe host-shutdown uuid=<host_uuid> | Shut down a host |
Pool Management
#
Command/Option | Example | Description |
---|
xe pool-list | xe pool-list | List all pools |
xe pool-create | xe pool-create name-label="my-pool" | Create a new pool |
xe pool-destroy | xe pool-destroy uuid=<pool_uuid> | Destroy a pool |
Miscellaneous
#
Command/Option | Example | Description |
---|
xe task-list | xe task-list | List all running tasks |
xe event-listen | xe event-listen | Listen for events on the XenServer |
This cheatsheet covers the most commonly used XenServer CLI commands and options, helping you to manage sessions, virtual machines, storage, networks, snapshots, hosts, and pools effectively.