Useful commands in the XCP-ng Command Line Interface (CLI)

XCP-NG Useful Commands

Here are some useful commands in the XCP-ng Command Line Interface (CLI) that can help you manage and interact with your virtualization environment:

 

 

1. Listing VMs and Hosts:

xe vm-list

List all hosts:

xe host-list

 

 

2. VM Operations:

xe vm-start vm=<VM UUID>

 

xe vm-shutdown vm=<VM UUID>

 

xe vm-reboot vm=<VM UUID>

 

xe vm-suspend vm=<VM UUID>

 

xe vm-reset-powerstate uuid=******* --force

 

 

3. Host Operations:

xe host-reboot host=<Host UUID>

 

xe host-shutdown host=<Host UUID>

 

xe host-disable host=<Host UUID>

 

 

4. Snapshot Management:

xe vm-snapshot vm=<VM UUID> new-name-label=<Snapshot Name>


 

xe vm-revert-to-snapshot snapshot=<Snapshot UUID>


 

xe snapshot-list vm=<VM UUID>

 


 

5. Storage Operations:

xe sr-list

 

xe sr-scan

 

 

6. Networking:

xe pif-list host=<Host UUID>


 

xe vif-list vm=<VM UUID>


 


 

7. Resource Pool Operations:

List resource pools:

xe pool-list

 

xe pool-create name-label=<Pool Name>

 

 

8. Performance Monitoring:

xe vm-param-list uuid=<VM UUID> | grep guest-metrics

 

 

9. Logs and Diagnostics:

less /var/log/xensource.log


 

less /var/log/xensource/vm-logs/<VM UUID>.log

 

 

These are just a few examples of the commands you can use to manage your XCP-ng environment. Be sure to refer to the official XCP-ng documentation for more details and command options specific to your version and setup. Always exercise caution when using CLI commands, especially in production environments.



 

 

 

 


Revision #1
Created 19 August 2023 18:43:39
Updated 19 January 2024 18:19:58