http://wiki.xensource.com/xenwiki/Command_Line_Interface
Virtual Machines
List of available virtual machines
xe vm-listGet 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=trueShutdown 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/>xSet the number of CPUS at startup:
xe vm-param-s<wbr/>et VCPUs-at-s<wbr/>tartup=8 uuid=xxxxx<wbr/>xSet the max number of CPUS:
xe vm-param-s<wbr/>et VCPUs-max=<wbr/>8 uuid=xxxxx<wbr/>xxHosts
List hosts
xe host-listShutdown 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-9222993b71f9Get VMs running on specified host
xe vm-list resident-on=<host uuid=""> is-control-domain=falsePending tasks:
xe task-list #to view the Pending tasksLast resort:
xe task-cancel force=true uuid=<UUID> #to cancel a specific task
xe-toolstack-restartNetworking
Lists networks
xe network-listLists Physical Network Cards with specified MAC Address
xe pif-list MAC=1c:c1:de:6b:9f:22Create a new Network
xe network-create name-label=VLAN_DMZAssign 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=205Backups
Export VM or snapshot to XVA
xe vm-export vm=<uuid_or_name> filename=/backup/Ubuntu_backup.xvaImport XVA file
xe vm-import vm=<name> filename=/backup/Ubuntu_backup.xvaCreate 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"
No comments:
Post a Comment