Thursday 26 May 2011

xe command list

Here is a list of the most common commands, for more information visit:
http://wiki.xensource.com/xenwiki/Command_Line_Interface

Virtual Machines
List of available virtual machines
xe vm-list
Get uuids of all running VMs
xe vm-list is-control-domain=false power-state=running params=uuid | egrep -o "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"
Force shutdown a virtual machine
xe vm-reset-powerstate uuid=uuid-of-the-VM force=true
Shutdown VM
xe vm-shutdown vm=<uuid>
Suspend VM
xe vm-suspend vm=<uuid>
List all the parameters available on the selected host
xe vm-param-list uuid=1b334f12-66cf-73cc-b0f9-3059519ace27

CPUs
Set the number of cores with:
xe vm-param-s<wbr/>et platform:c<wbr/>ores-per-soc<wbr/>ket=4 uuid=xxxxx<wbr/>x
Set the number of CPUS at startup:
xe vm-param-s<wbr/>et VCPUs-at-s<wbr/>tartup=8 uuid=xxxxx<wbr/>x
Set the max number of CPUS:
xe vm-param-s<wbr/>et VCPUs-max=<wbr/>8 uuid=xxxxx<wbr/>xx
Hosts
List hosts
xe host-list
Shutdown host
xe host-shutdown host=<uuid>
Remove Host from Pool
xe host-forget uuid=<toasted_host_uuid>
Get Pool Master UUID
xe pool-list params=master | egrep -o "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"
Eject host from pool
xe pool-eject host-uuid=9712025f-9b98-4c25-81ef-9222993b71f9
Get VMs running on specified host
xe vm-list resident-on=<host uuid=""> is-control-domain=false
Pending tasks:
xe task-list #to view the Pending tasks
xe task-cancel force=true uuid=<UUID> #to cancel a specific task
Last resort:
xe-toolstack-restart
Networking
Lists networks
xe network-list
Lists Physical Network Cards with specified MAC Address
xe pif-list MAC=1c:c1:de:6b:9f:22
Create a new Network
xe network-create name-label=VLAN_DMZ
Assign a network to a Physical Network Card with a VLAN
xe vlan-create network-uuid=329b55d1-0f77-512a-63ed-8b6bcf429e99 pif-uuid=80c1ea1a-4beb-c1ee-f69d-14e3a699587e vlan=205
Backups
Export VM or snapshot to XVA
xe vm-export vm=<uuid_or_name> filename=/backup/Ubuntu_backup.xva
Import XVA file
xe vm-import vm=<name> filename=/backup/Ubuntu_backup.xva
Create a snapshot
xe vm-snapshot vm="<vm_name>" new-name-label="snapshot_name"
Convert snapshot to template
xe snapshot-copy uuid=<snapshot_uuid> sr-uuid=<sr_uuid> new-name-description="Description" new-name-label="Template Name"

Possibly Related Posts

No comments:

Post a Comment