XenServer

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/OptionExampleDescription
xe helpxe helpDisplay general help for xe commands
xe versionxe versionShow the XenServer version

Session Management #

Command/OptionExampleDescription
xe session-loginxe session-login username=root password=passwordLog in to a XenServer session
xe session-logoutxe session-logoutLog out of the current session

VM Management #

Command/OptionExampleDescription
xe vm-listxe vm-listList all virtual machines
xe vm-startxe vm-start vm=<vm_uuid>Start a virtual machine
xe vm-shutdownxe vm-shutdown vm=<vm_uuid>Shut down a virtual machine
xe vm-rebootxe vm-reboot vm=<vm_uuid>Reboot a virtual machine
xe vm-suspendxe vm-suspend vm=<vm_uuid>Suspend a virtual machine
xe vm-resumexe vm-resume vm=<vm_uuid>Resume a suspended virtual machine
xe vm-createxe vm-create name-label="my-vm" template=<template_uuid>Create a new virtual machine
xe vm-destroyxe vm-destroy vm=<vm_uuid>Destroy a virtual machine

Storage Management #

Command/OptionExampleDescription
xe sr-listxe sr-listList all storage repositories
xe sr-createxe sr-create name-label="my-sr" type=lvm device-config:device=/dev/sdbCreate a new storage repository
xe sr-destroyxe sr-destroy uuid=<sr_uuid>Destroy a storage repository
xe vdi-listxe vdi-list sr-uuid=<sr_uuid>List all VDIs in a storage repository
xe vdi-createxe vdi-create sr-uuid=<sr_uuid> name-label="my-vdi" virtual-size=10GiBCreate a new VDI in a storage repository
xe vdi-destroyxe vdi-destroy uuid=<vdi_uuid>Destroy a VDI

Network Management #

Command/OptionExampleDescription
xe network-listxe network-listList all networks
xe network-createxe network-create name-label="my-network"Create a new network
xe network-destroyxe network-destroy uuid=<network_uuid>Destroy a network
xe vif-createxe vif-create vm-uuid=<vm_uuid> network-uuid=<network_uuid> device=0Create a virtual network interface for a VM
xe vif-destroyxe vif-destroy uuid=<vif_uuid>Destroy a virtual network interface

Snapshot Management #

Command/OptionExampleDescription
xe vm-snapshotxe vm-snapshot vm=<vm_uuid> new-name-label="my-snapshot"Create a snapshot of a VM
xe snapshot-listxe snapshot-listList all snapshots
xe snapshot-revertxe snapshot-revert snapshot-uuid=<snapshot_uuid>Revert a VM to a snapshot
xe snapshot-destroyxe snapshot-destroy uuid=<snapshot_uuid>Destroy a snapshot

Host Management #

Command/OptionExampleDescription
xe host-listxe host-listList all hosts
xe host-disablexe host-disable uuid=<host_uuid>Disable a host
xe host-enablexe host-enable uuid=<host_uuid>Enable a host
xe host-rebootxe host-reboot uuid=<host_uuid>Reboot a host
xe host-shutdownxe host-shutdown uuid=<host_uuid>Shut down a host

Pool Management #

Command/OptionExampleDescription
xe pool-listxe pool-listList all pools
xe pool-createxe pool-create name-label="my-pool"Create a new pool
xe pool-destroyxe pool-destroy uuid=<pool_uuid>Destroy a pool

Miscellaneous #

Command/OptionExampleDescription
xe task-listxe task-listList all running tasks
xe event-listenxe event-listenListen 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.

XenServer

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.